An AI-powered conversational onboarding agent using LangGraph and Chainlit. Guides users through structured data collection journeys via a dynamic chat interface with auto-generated forms.
User (browser)
↓ chat message
Chainlit UI (ui/app/main.py → drive_conversation)
↓
agent_handler.py (call_langgraph)
↓
run_graph() (backend/agents/graph.py)
↓
Response contract (MessageContract | UIFormContract)
↓
AGUIForm.jsx (public/elements/) — renders dynamic form in browser
Conversations are persisted per thread_id using LangGraph's in-memory checkpointer. Each turn the graph decides whether to send a plain message or a structured form.
pitching/
├── backend/
│ ├── server.py # FastAPI server (REST endpoints)
│ └── agents/
│ ├── graph.py # LLM setup, run_graph() entry point
│ ├── state.py # Placeholder for now
│ ├── nodes/
│ │ ├── planner_node.py # Placeholder for now
│ │ ├── reviewer_node.py # Placeholder for now
│ │ └── ui_node.py # Placeholder for now
│ └── schemas/
│ ├── enums.py # GraphResponseType, FieldType, TextSubType
│ ├── base_schema.py # Shared Pydantic base with strict validation
│ ├── graph_input_schema.py
│ ├── graph_output_schema.py
│ ├── state_schema.py
│ ├── planner_schema.py
│ ├── reviewer_schema.py
│ ├── ui_contract.py # UIFormContract response type
│ ├── ui_schema.py # UIField definition
│ ├── ui_llm_schema.py # Structured LLM output schema
│ └── graph_base_contract.py
├── ui/
│ └── app/
│ ├── main.py # Chainlit entry point + drive_conversation()
│ ├── agent_handler.py # LangGraph interface layer
│ ├── handlers.py # Chainlit event handlers
│ ├── starters.py # Quick-start conversation buttons
│ ├── constants.py # TIMEOUT
│ └── logger.py # structlog setup
├── public/
│ └── elements/
│ └── AGUIForm.jsx # Dynamic React form component (shadcn UI)
├── .chainlit/
│ └── config.toml # Chainlit framework configuration
├── pyproject.toml
├── Makefile
├── .env.example
└── README.md
- Starter buttons — one-click launchers for Gold Loan, Current Account, Savings Account journeys
- Dynamic forms — backend drives the UI; supports
text,select,date,file_upload,confirmation,OTP, andsummaryfield types - Real-time validation — email regex, 10-digit phone, 6-digit OTP, currency input with selector
- Form timeout — 4-minute countdown timer; auto-submits as chat fallback at zero
- "Reply in Chat" fallback — users can bypass any form and respond in free text
- Structured logging — JSON or console output, configurable per environment
- Thread persistence — conversation state maintained per
thread_idacross turns
uv venv && source .venv/bin/activateuv syncpip install -e .cp .env.example .envEdit .env and fill in your credentials.
pip install -e .
chainlit run -h ui/app/main.py
chainlit run -w -h app.pyThe application will start at http://localhost:8000