Kirana Store Owner
Hindi · Telugu · Tamil · English
owner inputs
Layer 1 — Input Channels
— zero keyboard, any device
🗣
Voice
Wake word + natural speech in any Indian language. 3–5 sec end-to-end response.
Sarvam STT
📸
Invoice Photo
WhatsApp invoice photo → SKU, qty, price, batch extracted by Gemini Vision.
Gemini Vision
📱
Barcode Scan
ML Kit camera scan. GS1 / ONDC pre-fills name, MRP. Owner confirms qty by voice only.
ML Kit
🚚
Distributor API
Auto-bootstrap 6-month purchase history at sign-up. Zero owner effort required.
Auto-Bootstrap
💻
POS Webhook
Optional Vyapar / GoFrugal connector. Real-time deduction on each sale. No workflow change.
Optional
normalized + enriched
Layer 2 — Ingestion Engine
— SKU normalization, dedup, expiry tagging
⚙
SKU Normalization & Dedup
Merge aliases ("Aata" → wheat flour), standardize kg / g / ml / pcs. Assign canonical IDs across all ingestion channels.
FastAPI service
🏷
Product Enrichment
GS1 + ONDC metadata: MRP, brand, category, shelf-life standard, perishable flag, cold chain requirement per SKU.
GS1 + ONDC
📆
Expiry & Batch Tagging
Voice-read or camera-captured expiry per batch. FSSAI defaults as regulatory fallback. FIFO tracking for all perishables.
FSSAI rules
enriched records → PostgreSQL
Layer 3 — Inventory Intelligence
— live stock state, passive sales inference, no POS required
📊 Augmented Kalman Filter — 7 Passive Signals
- Stock delta (weekly voice count) W: 0.90
- Reorder velocity (invoice frequency) W: 0.80
- UPI transaction mining (GMV proxy) W: 0.70
- POS webhook (if connected) W: 1.00
- Festival demand multiplier +15–40%
- IMD weather effect model +5–15%
- Croston SBA (slow-mover fallback) Alt.
// State prediction
x̂ₖ = Aₖx̂ₖ₋₁ + Bᵤuₖ
Pₖ = AₖPₖ₋₁Aₖᵀ + Qₖ
// Kalman gain + update
Kₖ = PₖHₖᵀ(HₖPₖHₖᵀ + Rₖ)⁻¹
Confidence = 1 − (Pₖ / P₀)
x̂ₖ = Aₖx̂ₖ₋₁ + Bᵤuₖ
Pₖ = AₖPₖ₋₁Aₖᵀ + Qₖ
// Kalman gain + update
Kₖ = PₖHₖᵀ(HₖPₖHₖᵀ + Rₖ)⁻¹
Confidence = 1 − (Pₖ / P₀)
🗄 Inventory Database (PostgreSQL 15)
sku_id uuid PK
tenant_id uuid FK · RLS
name · category · unit
current_qty float
confidence_score float
velocity_7d · velocity_30d
batch_code · expiry_date
reorder_threshold · cost_price
perishable_flag · supplier_id
source_channel · last_updated
tenant_id uuid FK · RLS
name · category · unit
current_qty float
confidence_score float
velocity_7d · velocity_30d
batch_code · expiry_date
reorder_threshold · cost_price
perishable_flag · supplier_id
source_channel · last_updated
V2 tables: reorder_items · expiry_actions
supplier_info · daily_briefings
supplier_info · daily_briefings
Depletion & Threshold Engine
📉 Depletion Tracker
Kalman estimator updates stock level on each signal. Confidence score decays as days-since-count grows.
Probabilistic
⚡ Velocity Calculator
Rolling 7d + 30d velocity per SKU. Adjusts for day-of-week, festivals, weather, and seasonal patterns.
Rolling window
🔔 Threshold Monitor
Per-SKU min-stock rules (owner or AI-set). Fires reorder events factoring in distributor lead time.
Event-driven
depletion events + context → LLM
Layer 4 — AI Orchestration
— Gemini 1.5 Flash · function_caller.py · Sarvam TTS response
🤖 Gemini Multi-Agent COO Brain
llm_service.py + function_caller.py — context-aware, tenant-scoped, multilingual
☀Daily COO Briefing
🚚Reorder Intelligence
⚠Expiry & Waste
🌞Festival Demand
📈Margin & Analytics
👍 / 👎 Feedback Loop
Owner voice accept / reject logged per recommendation. Cross-store anonymous learning improves cold-start accuracy.
Self-improving
🔮 What-If Simulations
"What if I order 50% more rice for Pongal?" — cash flow, waste and stockout outcomes modeled before committing.
Pre-decision
📋 Owner Audit Trail
Every AI action fully traceable: what recommended, why, which data used, what was ordered on owner's behalf.
Full transparency
smart actions generated
Layer 5 — Smart Action Layer (V2)
— all 6 phases complete · FastAPI REST endpoints
📦
Auto Reorder
Days-of-cover model. Festival-adjusted PO qty. Auto-fulfill or one-tap WhatsApp approval.
Udaan · Jumbotail
⚠
Expiry Alerts
3, 7, 14-day staged alerts. Actions: discount, front shelf, return to supplier, donate.
FSSAI-Aware
🌞
Festival Prep
50+ regional festivals. 7-day advance suggestions with distributor lead-time. Post-festival slow-stock review.
IMD + Calendar
☀
Daily Briefing
30-second morning voice brief at 8 AM. Yesterday's revenue, top sellers, 3 urgent actions via Sarvam TTS.
Sarvam TTS
📈
Margin Analysis
Per-SKU margin, dead stock detection, category performance, wastage trends, profit vs. revenue.
Per-SKU
delivered to owner's preferred channel
Layer 6 — Delivery Channels
— every output through the channel they already use daily
🔊
Jarvis ESP32-S3
Counter-top voice device. Wake word "Jarvis". Proactive 8 AM briefing. WebSocket to FastAPI backend.
Hardware · ₹800
💬
WhatsApp-First
Expiry alerts, order confirmations, daily reports pushed to owner's number. One-tap approve. No app install.
WA Cloud API
💻
Web Portal
Chain managers, distributors, brand dashboards. Full analytics, franchise territory oversight.
Vite + React
📱
Mobile App
Barcode scanner, stock count, analytics. Offline-capable with background sync for low-connectivity India.
React Native