Day 5: CashFlow Chat
A Telegram accounting bot that speaks your language
Date: March 5, 2026 Repo: venkatesh3007/cashflow-bot Status: ✅ Complete — Telegram bot, running 24/7
The Problem
Every small business in India has the same accounting setup: a mix of Tally, Excel spreadsheets, WhatsApp messages to the CA, and that one notebook where the owner writes things down with a pen. The pen notebook is usually the most accurate.
I wanted something simpler. Not Tally — that’s a desktop application designed for accountants, not founders. Not QuickBooks — that’s built for American small businesses and doesn’t understand lakhs. Not a spreadsheet — because nobody updates a spreadsheet at 10 PM when they remember they paid the electricity bill.
I wanted to type a message on my phone and have it recorded:
Paid rent 25000
Got salary 1L
Owed Vinayak 5000 for dinner
That’s it. Natural language. Indian number formats. On the device I’m already holding.
What We Built
CashFlow Chat is a Telegram bot. You message it like you’d message a friend:
You: Paid rent 25000
Bot: ✅ Recorded: Expense ₹25,000 — Rent
📊 Today: ₹25,000 spent
You: Got payment from TaxBuddy 2.5L
Bot: ✅ Recorded: Income ₹2,50,000 — TaxBuddy payment
📊 This month: ₹2,50,000 income, ₹25,000 expenses
You: Owed Vinayak 5000
Bot: ✅ Outstanding: ₹5,000 payable to Vinayak
You: /report
Bot: 📊 March 2026 Summary
Income: ₹2,50,000
Expenses: ₹25,000
Net: ₹2,25,000
Outstanding: ₹5,000 payable
Multi-book support. Separate personal and business accounts. /switch personal or /switch business. Because every founder mixes the two, and the CA always asks them to separate them.
Indian number formats. 1L = ₹1,00,000. 1Cr = ₹1,00,00,000. 25K = ₹25,000. The bot understands how Indians talk about money.
Recurring transactions. /recurring rent 25000 monthly — automatically records rent on the 1st of every month.
Outstanding management. Track who owes you and who you owe. /outstanding shows the aging report. Because the hardest part of running a small business in India isn’t making money — it’s collecting it.
The Architecture
1,833 lines of TypeScript:
bot.ts(521 lines) — Grammy-based Telegram bot, handles commands and message routingservices/llm-parser.ts(254 lines) — Sends natural language to Claude API, gets structured transaction data backservices/database.ts(346 lines) — SQLite operations, transaction CRUD, book managementservices/reports.ts(317 lines) — Report generation, monthly summaries, outstanding agingtypes/index.ts(197 lines) — TypeScript interfaces for transactions, books, reports
The LLM parser is the key piece. When you type “Paid rent 25000”, the bot sends it to Claude with a structured prompt. Claude returns JSON. The bot validates it, saves it to SQLite, and confirms.
This is a pattern that works surprisingly well: natural language in, structured data out, with an LLM as the parser. No NLP training. No regex. No predefined formats.
The prompt took four iterations to get right. The key was giving Claude examples of Indian English and number formats:
"Paid 25K for groceries" → expense, 25000
"Got 1L from client" → income, 100000
"Owed 5000 to Vinayak" → outstanding_payable, 5000
"1.5Cr revenue" → income, 15000000
The Stack
Node.js + TypeScript, SQLite (single file, zero config), grammY (Telegram bot framework), Claude API for parsing. Running as a systemd service on the same $24/month server. Total cost for the LLM parsing: maybe ₹50/month at 10 transactions a day.
The Day’s Pattern
Day 5 was two things: understanding and building. The morning was research — studying how the factory works at scale. The afternoon was practice — building a product that applies the patterns.
CashFlow Chat isn’t sophisticated software. It’s 1,833 lines and a Telegram bot. But it uses the LLM as a parser — not a chatbot, not a code generator, but a structured data extractor. That’s a pattern from the factory: use AI where it’s strong (understanding natural language), keep it away from where it’s weak (managing state, handling money arithmetic).
The LLM doesn’t touch the database. It doesn’t calculate totals. It doesn’t manage recurring transactions. It translates human language into structured data, and deterministic code handles the rest.
LLM for understanding. Deterministic code for execution. Graceful degradation for failures.
That’s the pattern. Day 5 proved it works.
What I Learned
SQLite is criminally underused. One file. Zero configuration. Survives server restarts. For a personal accounting tool, it’s perfect. No Postgres, no connection pooling, no managed database service. Just a file.
Indian money is different. Not just the currency symbol. The number system (lakhs and crores), the writing conventions (“1L” not “100K”), the mixed formality. Building for India means building for these conventions.
The real product is the habit. CashFlow Chat isn’t competing with Tally. It’s competing with “I’ll write it down later.” The value is that it’s on Telegram, where you already are, and recording a transaction takes three seconds. The best accounting system is the one you actually use.