This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend
What I Built
I built OpenKhata for my friend Rahul, whose family runs a traditional kirana (neighborhood grocery) shop in India.
Customer credit (udhar) is traditionally tracked in a physical khata. During busy hours, entering and finding handwritten transactions can be inconvenient, especially as the number of customers and transactions grows.
OpenKhata is a local-first digital khata that lets a shopkeeper record credit transactions through fast typed entry or spoken voice notes.
The important part isn't just the AI. Nothing from an uncertain voice entry is silently written to the ledger. The shopkeeper gets a confirmation step before the transaction is saved.
Demo
- Demo Video: https://drive.google.com/file/d/1PMPooBlJqikraozcAmFbAUmQreW5YTBW/view?usp=sharing
-
Key Demonstration:
- Quick Entry β Record a normal credit transaction directly into the local SQLite ledger.
- Voice Safety Gate β The shopkeeper says: "Rahul-er 340 na 3400 baaki". Whisper produces the transcript, and an application-level check detects that two monetary amounts were spoken: βΉ340 and βΉ3,400. Instead of choosing one, OpenKhata clears the amount and requires the shopkeeper to resolve the ambiguity before saving.
- WhatsApp Reminder β The Ledger generates a pre-filled payment reminder link. OpenKhata does not automatically send the message.
Code
ishaanchowdhury1
/
OpenKhata
A local-first digital khata for small shops with voice-assisted credit entry, human confirmation, and a SQLite ledger.
π OpenKhata
A local-first digital khata for a small kirana shop.
OpenKhata lets a shopkeeper record customer credit using typed entry or voice. AI assists with transcription and extraction, but the shopkeeper confirms the transaction before anything is written to the ledger.
Core flow
Voice β Local Whisper β Transcript β Local Gemma 3 4B β Structured transaction β Human confirmation β SQLite
Features
- Quick typed credit/payment entry
- Browser voice recording
- Local Whisper transcription
- Local Gemma 3 4B extraction through Ollama
- Human confirmation before saving voice transactions
- Ambiguous amounts are not silently selected
- Existing-customer selection for unrecognised spoken names
- Explicit confirmation before creating a new customer
- SQLite customer ledger
- Optional WhatsApp reminder with a pre-filled message
- No automatic WhatsApp sending
Known limitations
Whisper medium can mishear Bengali/Hindi/English code-mixed speech and can produce names in different scripts. Voice is therefore an assisted workflow rather than an automatic write path.
Requirements
- Pythonβ¦
- GitHub: https://github.com/ishaanchowdhury1/OpenKhata
- License: MIT
-
Tests: 7 automated unit tests covering extraction-safety rules in
tests/test_safety.py
How I Built It
graph TD
A[Shopkeeper Spoken Audio] --> B[Local Whisper Model]
B --> C[Raw Transcript]
C --> D[Local Gemma 3 4B via Ollama]
D --> E[Pydantic Validation]
E --> F[Deterministic Safety Checks]
F --> G[Human Confirmation]
G --> H[Local SQLite Ledger]
H --> I[WhatsApp Reminder Link]
Local speech-to-text
Whisper medium runs locally on the laptop. One of the most important things I learned while building this was that code-mixed Bengali/Hindi/English speech is not reliably transcribed every time. For example, a phrase like "Ramesh-da 2 kg rice, 340 baaki" was transcribed incorrectly during testing. So I didn't try to hide that failure. Instead, voice became an assisted workflow, and uncertain entries require confirmation before they can affect the ledger.
Local structured extraction
Gemma 3 4B runs locally through Ollama and converts the transcript into structured transaction data: customer, items, amount, due-date expression, transaction type, confidence values, and ambiguities.
Deterministic safety layer
This is deliberately separate from the model. Python application-level rules check things such as low amount confidence, low customer confidence, negative amounts, multiple possible monetary amounts, quantity numbers (e.g., 5 kg vs. monetary values), and future payment promises vs payments already received. The principle is simple: Don't make the LLM the final authority over financial data.
Storage and UI
The application uses Streamlit, SQLite, Pydantic, local Whisper, and local Gemma 3 4B through Ollama.
Why Local and Open Technology Matter
Customer names and outstanding balances are sensitive information. OpenKhata keeps the core AI processing local on the laptop after the models have been downloaded, rather than requiring every transaction to be sent to a cloud LLM API.
This also means the application can continue to perform its core ledger and AI processing without depending on a per-request cloud AI service.
WhatsApp reminders are different: they generate a web link, so using WhatsApp itself requires internet access. The project is MIT-licensed, while Gemma 3 4B is an open-weight model used locally through Ollama.
Real Friend Handover
I handed the prototype to Rahul and asked him to use it and give honest feedback.
- What he liked: Rahul said he loved it because it felt fast, helpful, and modern. He also said that writing every transaction manually in a diary/khata isn't always practical anymore.
- What was confusing? He said it was somewhat confusing at first because it was his first time using the application.
- What would he change? His main request was broader multilingual support, rather than limiting the experience to only Bengali or Hindi.
- Would he use it? Rahul said he would use it in the shop because he found it helpful for reducing manual bookkeeping.
What I Learned
The biggest lesson wasn't that AI can replace the khata. It was that AI should know when not to guess.
Whisper made mistakes. Gemma can be uncertain. Names can appear in different scripts. Amounts can be ambiguous.
So instead of trying to make the AI look perfect, I designed the system around those failures:
AI assists β deterministic checks verify β human confirms β database saves.
That ended up being more important than adding another AI feature.
Best Use of Gemma
OpenKhata uses Gemma 3 4B via Ollama to transform noisy, code-mixed shopkeeper speech into structured transaction data with confidence and ambiguity information. The model is useful because it handles the messy language layer, while the application code remains responsible for the final financial safety checks.
What's Next
Based on Rahul's feedback, the next improvement would be broader multilingual support. I also want to improve speech recognition for real-world Bengali/Hindi/English code-mixed shop speech. For now, OpenKhata deliberately keeps the human in control.
Top comments (0)