Voice-First Retail Intelligence & Point-of-Sale System for Indian Store Owners.
Built for small retail businesses, supermarkets, and kirana stores with native multilingual Indic speech recognition, double-entry financial accounting, and safety-guarded voice commands.
All voice input and output is exclusively powered by Gnani.ai (Gnani Prisma STT & Gnani Timbre TTS).
- Overview
- Problem Statement
- Project Objectives
- Key Features
- Exclusive Gnani.ai Voice Engine
- Technologies & Tools Used
- System Architecture
- Repository Structure
- Screenshots & Demo
- Installation & Setup
- Running the Application
- Usage Instructions & Voice Queries
- Running the Test Suite
- Future Enhancements
- License
BharatVoice AI is an intelligent, voice-first retail management, Point-of-Sale (POS), and assistive technology platform designed to bridge the digital divide for retail shopkeepers across India. Powered exclusively by Gnani.ai's neural Indic voice stack alongside strict double-entry ledger mechanics, BharatVoice AI enables store ownersโincluding differently-abled, visually impaired, and elderly merchantsโto operate their business completely hands-free. By speaking naturally in their mother tongue (Telugu, Hindi, Indian English, Tamil, Kannada, or Malayalam), shopkeepers can check inventory, calculate gross and net profits, generate itemized tax receipts, and record expenses safely without keyboard or mouse dependency.
Traditional enterprise retail software and modern POS tools present steep barriers for independent store owners in India:
- Severe Exclusion of Differently-Abled & Elderly Merchants: Conventional POS and billing software strictly mandate visual inspection, manual keyboard typing, and precise mouse/touchscreen interactions. Store owners with physical disabilities, visual impairments, tremors, arthritis, or limited motor dexterity are systematically excluded from managing their own billing and inventory, making them vulnerable to financial dependence or exploitation.
- Language Barriers: Most commercial retail software is strictly English-first, ignoring native regional languages spoken daily by shopkeepers in non-metro and rural belts.
- Counter Speed & Keyboard Friction: In crowded neighborhood kiranas and busy supermarkets, typing item names and finding buttons creates long queues and operational fatigue.
- Financial Vulnerability in Voice Systems: Generic voice-to-action tools lack safety checkpoints; an unintended utterance or misrecognized number could trigger destructive balance transfers, ledger corruptions, or incorrect cash drawer settlements.
- Cloud Brittleness: Many cloud-only platforms crash or freeze when suburban and rural connectivity drops, paralyzing checkout lines.
- Empower Differently-Abled & Motor-Impaired Store Owners: Transform retail billing into an accessible, hands-free experience so individuals with visual, physical, or motor disabilities can run their businesses with dignity and full operational autonomy.
- Democratize Retail Technology Through Indic Voice: Provide an intuitive voice interface where shopkeepers speak comfortably in their native language (Telugu, Hindi, Tamil, Kannada, Malayalam, English).
- Enforce Financial Integrity: Implement strict double-entry ledger mechanics where every transaction maintains debit/credit parity and generates tamper-evident audit trails.
- Guarantee Action Safety: Introduce a Financial Safety Confirmation Gate that catches balance-altering operations and requires explicit voice or button verification before ledger commitment.
- Exclusively Integrate Indic AI Voice: Standardize 100% of speech recognition and voice synthesis on Gnani.ai (Prisma STT & Timbre TTS), removing third-party or browser-fallback dependencies.
- โฟ Inclusive Assistive Technology for Differently-Abled Retailers: Voice-in and voice-out bidirectional feedback allows visually impaired, motor-disabled, and elderly shopkeepers to manage store operations hands-free and eyes-free with 100% voice clarity.
- ๐ฃ๏ธ Exclusive Gnani.ai Indic Voice Engine: 100% powered by Gnani Prisma STT for speech transcription and Gnani Timbre TTS for natural Indic speech synthesis across Telugu, Hindi, Indian English, Tamil, Kannada, and Malayalam.
- ๐ก๏ธ Financial Safety Confirmation Gate: Any spoken or typed command altering finances (e.g., "Record electricity expense of 500 rupees") is caught by an amber confirmation gate, preventing unapproved ledger mutations.
- ๐ Real-Time Central Dashboard: Tracks Today's Sales, Completed Transactions, Products Listed, and Low-Stock Warnings alongside a 7-day sales velocity AreaChart.
- ๐งพ Point-of-Sale (POS) & Tax Invoicing: Creates sequential bill records (
BV-SALE-...), generates itemized tax receipts, and exports financial spreadsheets to CSV. - ๐ฆ Inventory & Real-Time Stock Search: Complete catalog management with real-time substring filtering, stock level indicators, and reorder alerts.
- ๐ช Dynamic Store Personalization: Configurable owner profiles, phone numbers, tax/GSTIN credentials, and store rebranding across all views.
- ๐งช Comprehensive Test Coverage: 119 unit and integration tests covering API routes, duplicate detection, fault injection, and financial consistency.
BharatVoice AI eliminates all generic or browser-based speech synthesis in favor of an exclusive integration with Gnani.ai's conversational AI platform:
+-----------------------------------------------------------------------------+
| Gnani.ai Voice Stack |
+-----------------------------------------------------------------------------+
| 1. Speech-to-Text (STT): |
| - HTML5 MediaRecorder captures raw shopkeeper audio (16-bit 48 kHz WAV) |
| - Sent to backend `/api/voice/transcribe` |
| - Processed by Gnani Prisma STT (vachana.ai API endpoint) |
| - Handles mixed Indian vocabulary, retailer slang, and accent shifts |
| |
| 2. Text-to-Speech (TTS): |
| - Intent response synthesized by Gnani Timbre TTS |
| - Generated via backend `/api/voice/process` & `/api/voice/tts` |
| - High-fidelity 48 kHz linear PCM WAV encoded to base64 audio stream |
| - Decoded and played directly in browser via HTML5 Audio API |
| |
| 3. Supported Indic Languages: |
| - Telugu (te-IN - เฐคเฑเฐฒเฑเฐเฑ) |
| - Hindi (hi-IN - เคนเคฟเคจเฅเคฆเฅ) |
| - Indian English (en-IN) |
| - Tamil (ta-IN - เฎคเฎฎเฎฟเฎดเฏ) |
| - Kannada (kn-IN - เฒเฒจเณเฒจเฒก) |
| - Malayalam (ml-IN - เดฎเดฒเดฏเดพเดณเด) |
+-----------------------------------------------------------------------------+
- Framework: FastAPI (Python 3.11+)
- Server: Uvicorn (ASGI high-concurrency server)
- ORM & Database: SQLAlchemy 2.0 with SQLite (WAL mode)
- Validation: Pydantic v2
- HTTP Client: HTTPX
- Voice Services: Gnani.ai Prisma STT & Timbre TTS REST APIs (Exclusive Voice AI Engine)
- Testing: pytest &
pytest-asyncio
- Framework: React 18 + TypeScript
- Build Tool: Vite
- Charts: Recharts (Responsive Area Charts)
- Icons: Lucide React
- Styling: Modular Responsive CSS with theme variables and accessibility cues
graph TD
User(["Store Owner / Cashier"])
subgraph Frontend ["Frontend (React 18 + Vite + TypeScript)"]
UI["Retail Workspace & Navigation"]
VoiceComp["Voice Assistant Modal (Multilingual)"]
i18n["Localization Engine (te / hi / en / ta / kn / ml)"]
end
subgraph Backend ["Backend API (FastAPI)"]
API["REST Router (/api/...)"]
NLP["Voice NLP & Intent Parser"]
SafetyGate["Financial Confirmation Gate"]
Accounting["Double-Entry Ledger Engine"]
end
subgraph SpeechEngines ["Exclusive Voice Engine"]
GnaniSTT["Gnani Prisma STT (Speech-to-Text)"]
GnaniTTS["Gnani Timbre TTS (Text-to-Speech)"]
end
subgraph Persistence ["Persistence Layer"]
DB[("SQLite Database (WAL Mode)")]
Audit[("Audit & Fingerprint Log")]
end
User <-->|Voice / Touch| UI
UI <--> VoiceComp
VoiceComp <-->|Speech Stream| SpeechEngines
VoiceComp -->|Structured Query| API
UI -->|CRUD Requests| API
API --> NLP
NLP --> SafetyGate
SafetyGate --> Accounting
API --> Accounting
Accounting --> DB
Accounting --> Audit
BharatVoiceAI/
โโโ backend/ # FastAPI Python backend
โ โโโ app/ # Application source code
โ โ โโโ accounts_service.py # Cash drawer and settlement management
โ โ โโโ auth.py # Multi-store API key authorization
โ โ โโโ bill_import_service.py # Bulk bill ingestion and duplicate detection
โ โ โโโ database.py # Database engine and sessionmaker
โ โ โโโ finance_service.py # Double-entry ledger and P&L calculations
โ โ โโโ gnani_service.py # Gnani AI Prisma STT & Timbre TTS integration
โ โ โโโ main.py # FastAPI application routes and startup logic
โ โ โโโ migrations.py # Database migration runner
โ โ โโโ models.py # SQLAlchemy ORM models
โ โ โโโ schemas.py # Pydantic request and response schemas
โ โ โโโ seed.py # Initial catalog and sales seed data
โ โ โโโ voice_service.py # NLP entity extraction and intent mapping
โ โโโ tests/ # Pytest automated test suite (119 tests)
โ โโโ .env.example # Backend environment configuration template
โ โโโ OPERATIONS.md # Backend operational playbook
โ โโโ requirements.txt # Python dependencies
โโโ docs/ # Documentation and visual architecture
โ โโโ architecture.md # Detailed engineering design specifications
โ โโโ screenshots/ # Application interface screenshots
โโโ frontend/ # React 18 + TypeScript frontend
โ โโโ src/ # UI source components
โ โ โโโ App.tsx # Main application dashboard and tabs
โ โ โโโ Onboarding.tsx # Store setup and onboarding wizard
โ โ โโโ i18n.tsx # Multilingual translations and state
โ โ โโโ api.ts # Typed API client
โ โ โโโ types.ts # Domain TypeScript interfaces
โ โ โโโ onboarding.css # Onboarding layout styling
โ โ โโโ styles.css # Main workspace stylesheet
โ โโโ .env.example # Frontend environment configuration template
โ โโโ package.json # Node.js dependencies
โ โโโ tsconfig.json # TypeScript configuration
โ โโโ vite.config.ts # Vite bundler configuration
โโโ .env.example # Root environment configuration template
โโโ .gitignore # Git exclusion rules (secrets, caches, builds)
โโโ CONTRIBUTING.md # Contribution guidelines
โโโ LICENSE # MIT License
โโโ pytest.ini # Pytest discovery configuration
โโโ README.md # Repository overview and documentation
โโโ requirements.txt # Root Python dependencies manifest
โโโ start-backend.bat # Windows backend startup script
โโโ start-backend.sh # Unix / Linux / macOS backend startup script
โโโ start-frontend.bat # Windows frontend startup script
โโโ start-frontend.sh # Unix / Linux / macOS frontend startup script
Real-time KPIs (Today's Sales, Completed Bills, Listed Products, Stock Alerts) and 7-day sales velocity chart.
Voice assistant in Telugu (เฐคเฑเฐฒเฑเฐเฑ) with the Financial Safety Confirmation Gate intercepting financial operations.
Itemized tax invoice receipt modal with export bill (TXT), print, and CSV spreadsheet download capabilities.
- Python 3.10+ (Python 3.11 recommended)
- Node.js 18+ and npm 9+
- Git
git clone https://github.com/itzPardhiv/BharatVoiceAI.git
cd BharatVoiceAI# Create and activate a Python virtual environment
python -m venv .venv
# On Windows:
.venv\Scripts\activate
# On Linux / macOS:
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Configure environment variables
cp .env.example .envTip
Add your GNANI_API_KEY and GNANI_ACCESS_KEY to .env to activate live neural voice transcription (Gnani Prisma STT) and voice synthesis (Gnani Timbre TTS).
cd frontend
npm install
cp .env.example .env
cd ..Windows:
- Double-click
start-backend.bat(Starts FastAPI onhttp://127.0.0.1:8000) - Double-click
start-frontend.bat(Starts Vite onhttp://localhost:5173)
Linux / macOS:
chmod +x start-backend.sh start-frontend.sh
./start-backend.sh &
./start-frontend.shTerminal 1 (Backend):
python -m uvicorn app.main:app --app-dir backend --reload --port 8000- API Base URL:
http://127.0.0.1:8000 - Interactive Swagger Documentation:
http://127.0.0.1:8000/docs
Terminal 2 (Frontend):
cd frontend
npm run dev- Web Application:
http://localhost:5173
Once the application is running, open http://localhost:5173 in your browser. Complete the initial 4-step onboarding or launch the Voice Assistant directly from the top-right header:
| Language | Spoken / Typed Query | Meaning / Action Triggered |
|---|---|---|
Telugu (te) |
"เฐ เฐฐเฑเฐเฑ เฐ เฐฎเฑเฐฎเฐเฐพเฐฒเฑ เฐเฐเฐค?" | Queries today's gross sales and returns spoken Telugu audio. |
Telugu (te) |
"เฐเฐพเฐเฐพ เฐธเฐพเฐฒเฑเฐเฑ เฐธเฑเฐเฐพเฐเฑ เฐเฐเฐค?" | Looks up current stock quantity for Tata Salt. |
Hindi (hi) |
"เคเค เคเฅ เคฌเคฟเคเฅเคฐเฅ เคเคฟเคคเคจเฅ เคนเฅ?" | Returns today's sales and completed bill count in Hindi. |
Hindi (hi) |
"เคเคฎ เคธเฅเคเฅเค เคตเคพเคฒเฅ เคเคเคเคฎ" | Lists all products currently below their reorder threshold. |
English (en) |
"Record an electricity expense of 500 rupees" | Triggers the Financial Safety Gate; prompts user confirmation before committing. |
English (en) |
"Add 10 packets of Sugar price 45" | Creates an inventory addition bill and updates stock levels. |
The backend contains 119 automated unit, integration, and fault-injection tests validating API routes, double-entry ledgers, and NLP intent parsing:
# Run pytest directly from repository root
pytest
# Run with verbose output
pytest -vTest Suite Coverage:
test_advanced_features.py(Advanced multi-item queries and ledger adjustments)test_api_endpoints.py(REST contract testing across products, bills, summary)test_bill_parser.py(Receipt parsing and line-item extraction)test_database_models.py(SQLAlchemy schema constraints and foreign keys)test_duplicate_detection.py(Tamper-evident fingerprint and double-billing guards)test_e2e_and_fault_injection.py(Database disconnections and simulated network timeouts)test_financial_integrity_and_acceptance.py(Debit/Credit ledger balance validation)test_migrations.py(Schema migration resilience)test_retail_and_voice.py(Multilingual intent and entity mapping)
- WhatsApp Invoice Sharing: Automated PDF receipt delivery via WhatsApp Cloud API.
- Offline Barcode Scanner Integration: Camera-based barcode and QR scanning for fast checkout.
- Direct UPI Dynamic Soundbox: Audio confirmation webhook on real-time UPI payment settlement.
- Federated Sync: Multi-store data synchronization between cloud PostgreSQL and local edge nodes.
This project is licensed under the MIT License.