AI-powered WhatsApp ERP for India's 63 million MSMEs
Project description
SUTRA Core
AI-Powered WhatsApp ERP for India's 63 Million MSMEs
Voice. Text. Hinglish. Zero training. Runs on a โน800/month VPS.
SUTRA (Systematic Unstructured Text & Resource Allocator) โ a textile merchant in Surat sends a Hinglish voice note; SUTRA transcribes, checks stock, confirms the order, deducts inventory, generates a GST invoice, and sends it back via WhatsApp. No app. No login. No training.
โจ Features
| Capability | What It Does |
|---|---|
| ๐๏ธ Voice-to-Order | Hinglish voice notes โ transcribed โ structured order in <30s |
| ๐ฆ Auto Inventory | Stock deducted on confirmation. Restock alerts before stockout. |
| ๐ฐ Udhaar (Credit) Mgmt | Track credit limits, aging, auto-reminders on WhatsApp |
| ๐งพ GST Invoicing | PDF invoices generated and delivered in the same WhatsApp thread |
| ๐ข Multi-Tenant | One deployment serves unlimited businesses with isolated data |
| ๐ SOC 2 Ready | AES-256 encryption, JWT auth, webhook security, RBAC |
| ๐ฅ๏ธ Owner Dashboard | Analytics-only Next.js dashboard for month-end review |
| ๐ก Monitoring | Prometheus + Grafana stack. Alertmanager for critical events. |
๐ Quick Start
git clone https://github.com/ravikumarve/sutra-core.git
cd sutra-core && cp .env.example .env # configure your API keys
docker compose up --build # starts FastAPI + Redis + PostgreSQL
That's it. Your webhook listener is live at http://localhost:8000. Configure it as your Meta WhatsApp webhook URL and start receiving orders.
๐ Full deployment guide โ
๐ง How It Works
SUTRA is an asynchronous multi-agent mesh. Three specialized agents process every message through an event-driven pipeline:
WhatsApp โโโบ Webhook โโโบ Redis Queue โโโบ โโโโโโโโโโโ โโโโโโโโโโโโโ
(Voice/Text) (Event Bus) โ Liaison โโโโโบโ Strategistโ
โ (Intent)โ โ(Execution)โ
โโโโโโโโโโโ โโโโโโโฌโโโโโโ
โ
โโโโโโโโโโโ โ
โ Auditor โโโโโโโโโโโ
โ(Ledger) โโโโบ PDF Invoice
โโโโโโโโโโโ WhatsApp Reply
| Agent | Role | Integrations |
|---|---|---|
| Liaison | Decode intent from raw text/audio | Whisper-Hinglish, Sentiment Analyzer |
| Strategist | Validate & execute against DB | Inventory, Credit Scoring, Pricing |
| Auditor | Immutable ledger + compliance | PDF Generator, GST Validator |
No agent calls another directly. All communication is through AgentMessage objects on Redis Streams โ enabling independent scaling, restart, and replacement.
๐ ๏ธ Technology Stack
| Layer | Technology |
|---|---|
| Backend | FastAPI (Python 3.12+) |
| Database | PostgreSQL 15 with schema-level multi-tenancy |
| Queue | Redis Streams (per-tenant namespaced) |
| STT | OpenAI Whisper (CPU, Hinglish post-processing) |
| Dashboard | Next.js 14 + shadcn/ui (analytics-only) |
| Monitoring | Prometheus + Grafana + Alertmanager |
| CI/CD | GitHub Actions (test โ lint โ security scan โ deploy) |
| Deployment | Docker Compose / systemd |
๐ Architecture Decisions
| Decision | Why |
|---|---|
| Headless (WhatsApp-first) | Shop owners are on WhatsApp 8 hours/day. No app to install. Zero adoption friction. |
| PostgreSQL over NoSQL | Financial ledger requires ACID. Udhaar entries must be atomic with inventory. |
| Redis Streams over Kafka | Single VPS deployment. Kafka is overkill. Redis handles the throughput comfortably. |
| CPU-only Whisper | 30s async transcription latency is acceptable. No GPU = deployable anywhere. |
๐ Roadmap
| Feature | Status |
|---|---|
| Multi-agent pipeline (Liaison โ Strategist โ Auditor) | โ
v1.0.0 |
| Whisper-Hinglish NLP pipeline | โ
v1.0.0 |
| Multi-tenancy with isolated schemas | โ
v1.0.0 |
| GST-compliant PDF invoicing | โ
v1.0.0 |
| Docker + systemd deployment | โ
v1.0.0 |
| CI/CD + Monitoring stack | โ
v1.0.0 |
| Security audit (SOC 2 framework) | โ
v1.0.0 |
| Owner analytics dashboard | ๐ In progress |
| Image-based order parsing (photo โ SKU) | ๐ Planned v1.1 |
| UPI payment link injection | ๐ Planned v1.1 |
| Fine-tuned Whisper for 8 regional accents | ๐ Planned v1.2 |
๐ฐ Pricing Model
| Plan | Price | For |
|---|---|---|
| Starter | โน499/month | 1 WhatsApp number, 500 orders/mo |
| Growth | โน1,499/month | 3 numbers, 2K orders/mo, 3 users |
| Business | โน4,999/month | Unlimited, dedicated support, custom integrations |
Self-hosted is MIT licensed and free. Paid plans include managed hosting, SLA, and priority support.
๐ Documentation
| Document | Description |
|---|---|
| Deployment Guide | Step-by-step production setup |
| Security Hardening | Production security measures |
| Monitoring Setup | Prometheus + Grafana guide |
| Backup Procedures | Backup & disaster recovery |
| Runbooks | Operational runbooks |
| Executive Summary | Business overview |
๐ค Contributing
We actively welcome contributions in these high-impact areas:
- Dialect Maps โ Hinglish vocabulary, regional terms, unit aliases
- Industry Presets โ New business-type configs (electronics, furniture, etc.)
- Test Audio Fixtures โ Real Hinglish voice note transcriptions
- Query Optimizations โ PostgreSQL performance with EXPLAIN ANALYZE
See CONTRIBUTING.md for detailed guidelines.
๐ License
MIT โ see LICENSE.
Built for the bazaar. Runs in the background. Never misses a bill.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sutra_core-1.0.0-py3-none-any.whl.
File metadata
- Download URL: sutra_core-1.0.0-py3-none-any.whl
- Upload date:
- Size: 100.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c2a2f977af19447ab045f618ebcdc4aa5cafb9d6ca2363a2970895dabcb1030
|
|
| MD5 |
fc1e665356d9625776370a1ba7ffd72d
|
|
| BLAKE2b-256 |
ff20909409701759b75d376c73351996729ea85fcd9a535484262906b14325ee
|