# TARS

> Voice-first AI billing & ERP for noisy Indian shops

The page: https://tushar-is-a-dev-portfolio.vercel.app/work/tars

2026 · System

🏆 Live Production · Gemini Live Audio · Real-Time ERP

Shopkeepers just hold the mic and speak naturally in Hinglish, Tanglish, or Marathi — Gemini Live handles the messy audio while a strict backend checks stock, applies schemes, and outputs clean invoices or manager approvals in real time.

## What it does

- **Barge-in safe voice state machine** over `/ws/voice/{session_id}` with `OrderOrchestrator` continuity, Hold-to-Talk turn control, and transactional `CONFIRMING` → `DRAFT` rollback.
- **Deterministic 10-table ERP engine** on Neon PostgreSQL (`psycopg` v3) enforcing SKU availability, trade schemes (`SCH-001`), credit ceilings, and manager approval routing with zero LLM math.
- **Real-time SSE observability** streaming every orchestrator step, tool invocation, and rule evaluation over `/api/trace/stream` into a live Trace console.
- **Dialect-aware serverless persistence** adapting between local SQLite and pooled Neon PostgreSQL, auto-seeding 30 retail outlets, catalog SKUs, and active schemes.
- Verified by **202 backend pytest tests**, strict `mypy --strict` typing across all modules, `ruff` lint, and an automated 4-scene demo rehearsal (`rehearse_demo.py`).

## Built with

Gemini Live, FastAPI, Neon PostgreSQL, SQLAlchemy 2.0, React, TypeScript, PWA, Docker, Azure Container Apps, Vercel

- [Demo](https://tars-chi-nine.vercel.app)
- [Repo](https://github.com/tusharsingh-sde/TARS)

## Screenshots

![TARS 1](https://tushar-is-a-dev-portfolio.vercel.app/work/tars-1.webp)

![TARS 2](https://tushar-is-a-dev-portfolio.vercel.app/work/tars-2.webp)

![TARS 3](https://tushar-is-a-dev-portfolio.vercel.app/work/tars-3.webp)
