Conversational Quote Assistant
A chat-based front end that replaces a multi-field insurance quote form with a guided, step-by-step conversation, calling the exact same backend the original web form uses.
- 0backend changes needed
- Chatreplaces a multi-field form
Tech stack
- Python
- Flask
- Flask-Session
- Gunicorn
- Docker
How it works
- 1Collect vehicle + location details
- 2Collect policy type + prior policy info
- 3Check eligible partners
- 4Fetch a quote per partner
- 5Present results
Problem
Turn an existing multi-field two-wheeler insurance quote form into a step-by-step chat flow, without changing the backend that actually generates quotes.
Why it was difficult
The conversation has real branching logic — whether the customer has a prior policy changes which follow-up questions appear, and how long ago that policy lapsed changes which quote type gets requested. Free-text vehicle input has to resolve to the exact structured record the backend expects, and one partner's API failing should not block quotes from the others.
Architecture
A Flask app tracks conversation progress as a named step in a server-side session, with a step-to-handler dispatch table driving what gets asked next. Once enough details are collected, it checks which partners are eligible to quote this vehicle, then calls each eligible partner in turn for a price.
Technical approach
This is a scripted state machine, not an LLM — deterministic step handlers with format-based input validation and a fixed set of response options at each step. Vehicle lookups match against a local reference dataset, falling back to fuzzy search when there is no exact match and re-prompting the user whenever a search turns up more than one plausible result.
Implementation
Runs behind Gunicorn in a Docker container. Each partner's quote call is individually isolated so one partner erroring does not stop the others — failures are collected and surfaced as a count of partners that had errors rather than failing the whole request. A backend connection failure trips a demo mode with sample data, so the chat UI stays testable even when the backend is unreachable.
Challenges
Reproducing the exact nested payload shape the production web form sends, field for field, so the backend accepts a chat-originated request exactly like a normal form submission.
Solution
The payload-building logic was isolated into its own module that mirrors the web form's request shape directly, so the chat flow and the web form stay compatible with the same unmodified backend.
Evaluation
Not documented — no automated tests or evaluation scripts exist yet for this project.
Results
Not documented — ask Suraj for real numbers (completion rate, quote turnaround) if he wants them included.
Future improvements
There is a clear, already-scoped extension path: adding a private-car product by adding its vehicle data and swapping the payload shape, and reusing the same chat pattern for the other vehicle categories the matching engine above covers.
Want something like this built?
Let’s talk