Inspiration
Millions of kirana shops in India run on udhaar, customer credit written in a paper notebook (the khata). Updating it while serving customers is slow, and balances get lost or disputed. I wanted a shopkeeper to just say it: "Ravi ne 200 rupees payment diya".
What it does
KhataFlow is a stateful Hinglish voice-ledger MCP server for Alexa+.
- Add credit, record payments, check balances, see history, and get a summary of the whole book
- Ask "Sabse zyada udhaar kiska hai?" or "Who has the highest payment?"
- Remembers context: after "Ravi ka kitna baaki hai?", you can say "Usme se 200 kam karo, usne cash diya" without repeating the name
- Replies in your language: English questions get English answers, Hinglish gets Hinglish
- Creates a new customer from a single sentence
How I built it
- Python MCP server (FastMCP on Starlette) exposing 7 tools:
add_udhaar,record_payment,get_balance,customer_history,summarize_book,who_owes_most,who_paid_most - A rule-based Hinglish parser handles the commands, with per-conversation memory for follow-ups
- A simulated Alexa+ web interface (clearly labelled as simulated) with live balance animations, voice input through the browser's Web Speech API and spoken replies
- SQLite ledger, hosted on Render. The code also has an optional DynamoDB backend and a Bedrock fallback parser, which are not enabled in the live demo.
Challenges
- Speech recognition spells Hinglish differently every time ("ne" becomes "neh", "usme" becomes "usmein"). I replaced strict sentence patterns with a looser parser and spelling normalisation.
- New customers. The parser first only understood names in fixed patterns. Now it also handles "add Gita 200 credit", and if the name is missing it asks "Kiska naam?" and uses your next answer.
- Matching the reply language to the language the user spoke.
- Hosting. My AWS account activation was delayed, so I deployed on Render instead.
What I learned
Voice interfaces fail on small spelling and phrasing differences, not on the main
Built With
- alexa+
- css
- fastmcp
- html
- javascript
- mcp
- model-context-protocol
- python
- render
- sqlite
- starlette
- web-speech-api
Log in or sign up for Devpost to join the conversation.