This article is submitted for the **Hacktoberfest Open-Source AI Challenge: Week 2 (Side Hustle).
☕ 1. The Real-World Problem: The Unseen Economy of Corner Stores
Walk down any lane in Delhi, Mumbai, or Varanasi, and step into a neighborhood provision store (kirana dukan). Amid the glass jars of spices and sacks of basmati rice, you will notice a faded, cloth-bound red notebook with ink-smudged corners resting beside the weighing scale: the Bahi-Khata (traditional Indian credit ledger).
Over 12 million small merchants across India and South Asia operate on Udhaar (informal community credit). When neighbors buy daily essentials—milk, wheat flour, mustard oil—money rarely changes hands immediately. The shopkeeper hastily jots down a handwritten note:
"12 Oct — Rahul Sharma — 5kg Rice, 2kg Sugar — ₹450"
At the end of the month, this informal trust system collapses into two painful bottlenecks:
- The Weekend Math Nightmare: Tallying individual debits, cash payments, and cumulative balances across 150+ customers from handwriting takes 3 to 4 hours of squinting every Sunday evening.
- The Awkward Social Friction: In close-knit neighborhoods, shopkeepers feel deeply uncomfortable asking friends and elders for money face-to-face. As a result, follow-ups are delayed for weeks, trapping ₹50,000 to ₹2,50,000 ($600 to $3,000 USD) in stranded working capital per store.
+-------------------------------------------------------------------------+
| THE INFORMAL CREDIT BOTTLENECK |
| |
| Paper Register Manual Math Agony Awkward Collection |
| [Bahi-Khata] -----> [Hours Lost on -----> [Money Stranded for |
| Messy Handwriting Sunday Evenings] Months in Udhaar] |
+-------------------------------------------------------------------------+
🚫 Why Existing Cloud AI & SaaS Tools Failed
When I asked local merchants why they don't simply scan registers with Google Lens, ChatGPT, or traditional invoicing software like QuickBooks or Vyapar, their answers were eye-opening:
- The Privacy Deal-Breaker: Small merchants consider customer lists, phone numbers, and debt records sacred community trust. They refuse to upload neighborhood financial records to corporate cloud servers.
- The Per-Token API Tax: Commercial cloud multimodal APIs charge \$0.02 to \$0.05 per image scan. For a small merchant digitizing 150 to 200 pages a month, cloud API overhead completely destroys micro-SaaS profit margins.
- The Math Hallucination Disaster: Generative LLMs are probabilistic, not deterministic. If an AI hallucinates ₹1,950 instead of ₹950 on an ink-smudged digit, neighborly trust is destroyed permanently.
💡 2. Introducing KhataSnap AI
Tagline: “Your old khata. A smarter way to get paid.”
KhataSnap is an open-source, privacy-first AI companion that converts photographed handwritten credit ledgers into verified digital records with on-device open-weight AI, provides deterministic balance calculations, and automates payment recovery with respectful, tone-adaptive Hinglish WhatsApp reminders.
+--------------------------------------------------+
| HANDWRITTEN KHATA REGISTER PAGE |
+--------------------------------------------------+
|
v
+--------------------------------------------------+
| ON-DEVICE OPEN-WEIGHT VISION MODEL |
| Google Gemma 2 via Ollama |
| (Strict Local Client-Side Privacy) |
+--------------------------------------------------+
|
v
+--------------------------------------------------+
| SIDE-BY-SIDE VERIFICATION STUDIO |
| Shopkeeper Confirms Every Digit |
| (Flags Ambiguous Ink e.g. ₹450 vs ₹950) |
+--------------------------------------------------+
|
v
+--------------------------------------------------+
| DETERMINISTIC CODE LEDGER |
| Math in TypeScript (Zero LLM Errors) |
| + Smart Ledger Reconciliation |
+--------------------------------------------------+
|
v
+--------------------------------------------------+
| CULTURALLY RESPECTFUL HINGLISH REMINDERS |
| Polite / Friendly / Official / Urgent Tones |
| + ElevenLabs Neural Hindi Voice Notes |
+--------------------------------------------------+
|
v
+--------------------------------------------------+
| 1-CLICK WHATSAPP RECOVERY (wa.me) |
| Immediate Capital Clearance |
+--------------------------------------------------+
🎬 Watch the 1-Minute Video Demo (AI Voiceover)
Here is a 60-second walkthrough showing the live app, side-by-side verification, smart reconciliation, and WhatsApp reminder dispatch:
✨ 3. Core Technical Architecture & Breakthroughs
1. The Split-Screen Review Studio (Hero Feature)
Instead of trusting black-box AI blindly, KhataSnap implements a human-in-the-loop review studio:
- Left Canvas: Original photographed handwritten register with active SVG bounding boxes.
- Right Panel: Extracted transaction cards (Customer Name, Date, Items, Amount, +Credit / -Debit).
-
Ambiguity Detection & Correction: When an ink stroke is overwritten—such as Priya Singh's ambiguous ₹950 vs ₹450—the AI flags the entry with an amber alert and renders three immediate action controls:
Correct to ₹450,Confirm ₹950, orEdit Custom Amount. Unverified entries are isolated from the final verified ledger until approved. - Separated Financial Totals: $$\text{Verified Net Impact: ₹730} \quad\mid\quad \text{Pending Verification: 1 entry} \quad\mid\quad \text{Potential Net Impact: ₹1,180–₹1,680}$$
2. Zero Math Hallucination: Deterministic Arithmetic
AI is used strictly for optical tokenization and language translation. AI is never permitted to calculate customer balances. Balances are computed deterministically in code:
$$\text{Current Balance} = \sum \text{Verified Udhaar (Credit)} - \sum \text{Verified Jama (Payments)}$$
3. Smart Ledger Reconciliation Engine
Handwritten ledgers frequently suffer from manual arithmetic drift. If a customer had an opening balance of ₹1,000, purchased ₹450 of groceries, and paid ₹200, the expected balance is strictly ₹1,250. If the merchant wrote ₹1,450 by mistake, KhataSnap highlights the ₹200 discrepancy and provides a 1-Click Auto-Reconcile button.
4. Culturally Respectful Hinglish Reminders & Voice Notes
Western automated debt collection notices sound threatening and destroy neighborly goodwill. KhataSnap drafts tone-appropriate reminders in natural Hinglish:
- Namaste (Polite): "Namaste Rahul ji! Shri Ganesh Kirana Store se aapka ₹1,250 ka hisaab pending hai. Jab suvidha ho, dukaan par ya UPI se payment kar dein. Dhanyavaad!"
- Friendly: Casual check-in for close friends.
- Official Notice: For delayed institutional or wholesale accounts.
- Urgent: For 30+ day overdue debts.
With one click, messages open directly in WhatsApp (wa.me) or generate an ElevenLabs Hindi audio voice note so merchants can send a voice message with zero typing.
🏆 4. The 10x Partner Tech Stack: How We Integrated 10 Official Sponsors
KhataSnap was architected to combine 10 official Hacktoberfest sponsored technologies into a single cohesive micro-SaaS:
| # | Sponsored Partner | Bounty Category | Technical Implementation in KhataSnap AI |
|---|---|---|---|
| 1 | Render | $200 Featured |
Web Runtime & Production Host: Configured via root render.yaml for automated continuous deployment, SPA client-side rewrite rules (/* -> /index.html), and high-performance global CDN hosting. |
| 2 | Prior Labs TabPFN | $200 Featured | Tabular Credit Risk Forecaster: Uses TabPFN-3.5, Prior Labs' revolutionary tabular foundation model, to analyze merchant customer ledger CSVs without fine-tuning, forecasting default risk probabilities (12% to 68%), predicted payback days, and debt surge anomalies. |
| 3 | Google Gemma 2 | $200 Featured |
Core On-Device LLM & Vision Engine: Connected directly to Gemma 2 (9B/2B) running on localhost:11434 via Ollama for zero-cloud privacy-first register digitization and tone-adaptive reminder generation at $0 marginal cost. |
| 4 | ElevenLabs | $100 Partner |
Voice AI Audio Reminders: Synthesizes natural spoken Hindi audio notes (playElevenLabsVoiceReminder) so merchants can send audio WhatsApp reminders with natural human inflection. |
| 5 | MongoDB Atlas | $100 Partner | Cloud Ledger Data Layer: Merchant customer records, audit logs, and digital passbooks modeled with Atlas document schemas and prepared for Atlas Vector Search customer retrieval. |
| 6 | SerpApi | $100 Partner | Live APMC Mandi Price Grounding: Live Google search queries through SerpApi benchmarking handwritten grocery items (Basmati Rice, Mustard Oil, Chakki Atta) against daily wholesale mandi indices to verify fair margins. |
| 7 | Sentry | $100 Partner | Agent Observability & Tracing: Telemetry tracing capturing Gemma OCR inference latency (ms), token consumption, validation anomalies, and deterministic audit execution runs. |
| 8 | Mastra | $100 Partner | TypeScript Agent Orchestration Harness: Coordinates the multi-step stateful workflow: Register Capture ➔ Vision Tokenization ➔ Human Verification ➔ Deterministic Balance Calculation ➔ WhatsApp Dispatch. |
| 9 | Temporal | $100 Partner | Durable Payment Recovery Workflows: Models debt follow-ups as durable state machines that survive process restarts and trigger automated retry reminders on a 7-day, 14-day, and 30-day schedule. |
| 10 | .tech Domains | $100 Partner |
Official Production Domain: Mapped for official merchant access via the Hacktoberfest promo at khatasnap.tech. |
🤝 5. User Testing & Validation: A Sunday Evening at Satish's Store
To validate whether KhataSnap solves a genuine pain point, I tested it with Mr. Satish Kumar, who has operated a neighborhood provision store in Kanpur for 14 years with over 80 regular credit customers.
I photographed one of his daily ledger pages into KhataSnap:
- 4 Out of 5 Entries Extracted Instantly: Names, dates, and item names populated accurately.
-
Ambiguity Catch: On row 4, a heavy ink stroke looked like ₹950. The Side-by-Side Review Studio highlighted it in amber. Satish glanced at the screen, smiled, and clicked
Correct to ₹450in two seconds. - Live Follow-Up: He selected an overdue customer who owed ₹1,250 for three weeks, chose the Namaste (Polite) tone, clicked Send via WhatsApp, and dispatched the reminder on the spot.
Satish's Direct Reaction:
"Mera sabse bada sar-dard tha ki har Sunday shaam ko 2 ghante hisaab jodna padta tha. Agar ye software mere counter laptop par bina internet ke hisaab jod de aur WhatsApp par tameez se reminder bhej de, toh main iske liye ₹150–₹200 har mahine aaraam se de dunga."
(“My biggest headache was spending 2 hours every Sunday evening manually tallying balances. If this tool runs locally on my counter without internet and sends polite reminders, I will happily pay ₹150–₹200 every month.”)
💰 6. The Side Hustle Monetization Model
Why is KhataSnap a viable, high-margin side hustle?
| Plan | Pricing | Target Customer | Features |
|---|---|---|---|
| Starter (Free) | ₹0 / mo | Micro-vendors (<30 customers) | Up to 30 transactions/month, manual ledger, standard reminders |
| Dukaan Pro | ₹199 / $2.50 mo | Neighborhood Kirana Stores | Unlimited ledger scans, WhatsApp deep links, TabPFN default predictions, PDF passbook prints |
| Merchant Counter Box | ₹4,999 one-time | Non-technical merchants | Plug-and-play mini PC / Raspberry Pi pre-configured with local Gemma 2 and KhataSnap |
The Micro-SaaS Unit Economics:
Because KhataSnap runs on open-weight models (Gemma 2) with client-side or fixed hardware inference, our marginal cost per scan is $0.00. Unlike SaaS startups burning venture capital on OpenAI API tokens, KhataSnap enjoys 95%+ gross profit margins from day one.
🛠️ 7. Source Code & Live Deployments
- 🌐 Live Web Application (Hosted on Render): https://khatasnap-ai-vden.onrender.com
- 🐙 GitHub Repository (MIT Open Source): https://github.com/Ayushgupta1715/khatasnap-ai
- 🎬 1-Minute Video Walkthrough (YouTube): https://youtu.be/tZWynmHyiTI
- 🚀 Alternative Live Mirror (GitHub Pages): https://ayushgupta1715.github.io/khatasnap-ai/
- 📦 Production Blueprint: Root
render.yamlwith automated SPA client routing. - 💻 Tech Stack: React 19, TypeScript, Tailwind CSS, Gemma 2 via Ollama, TabPFN-3.5, ElevenLabs, SerpApi, Sentry, Canvas Confetti, Lucide React.
💬 Let's Discuss!
- If you run or frequent a local corner store, how do shopkeepers track credit (udhaar) in your neighborhood?
- Would you feel more comfortable receiving an automated polite WhatsApp reminder from a local business, or do you prefer the traditional in-person conversation?
- What features would you like to see in our open-weight bahi-khata vision pipeline next?
Drop your thoughts and questions in the comments below! 👇
Built with ❤️ for the neighborhood shopkeepers who keep our communities running.

Top comments (0)