The problem why quote enforcement matters
When someone reports a crime at a police station in India, they often speak in Gujarati, Hindi, Tamil, or another regional language while someone else types a formal record. Details drop out or get reworded, and speed-focused AI drafting tools add a new risk: guessing at intent or filling in facts nobody said.
How it works immutable source & six-lane audit
- 10 explicit languages The citizen picks their language (English, Hindi, Gujarati, Marathi, Bengali, Tamil, Telugu, Kannada, Malayalam, or Punjabi). The system never auto-guesses.
- In-memory transcription & private key Audio is transcribed in memory with Whisper Large v3 and never saved to disk or cloud storage. The citizen receives a public case ID (FS-...) and private access key (FSC-...), stored only as a SHA-256 hash.
- Deterministic quote normalizer Every extracted field must point to a contiguous, word-for-word quote in the locked transcript. In a Hindi snatching test, “स्टेशन रोड के पास” passes, while an inferred “black motorcycle” is dropped because the citizen only said “बाइक”.
- Six-lane officer audit workspace Officers review Immutable Source, Citizen Context, Citizen Corrections, AI Aids, Officer Corrections, and Audit History side by side. Possible Bharatiya Nyaya Sanhita (BNS) sections come only from a fixed catalogue, tied to quotes, and marked for officer review.
Testing & architecture verification & stack
56 automated tests pass across quote enforcement, schema limits, and tRPC routers. In 10 hostile prompt-injection tests targeting made-up charges, 6 failed JSON validation outright and 2 unsafe legal suggestions were caught by the deterministic normalizer—zero unsafe outputs reached the officer view.
This prototype runs on a self-hosted Raspberry Pi 5 using Groq for inference to keep costs at zero; a production police deployment would swap the single transcription interface to self-hosted Indic models such as AI4Bharat or Bhashini on Indian infrastructure for data residency.
- Frontend
- React 19, TypeScript, Tailwind CSS 4, Wouter, GSAP (UI built with Manus from my designs)
- Backend
- Node 22, Express 4, tRPC 11 with Zod validation on every request
- Database
- Supabase Postgres with Row-Level Security and SHA-256 hashed citizen keys
- AI pipeline
- Groq API (whisper-large-v3 + openai/gpt-oss-20b) gated by deterministic quote normalizer
- Hosting
- Self-hosted Raspberry Pi 5 (systemd + Cloudflare Tunnel) with GitHub Actions ARM64 runner
- Tests
- 56 Vitest checks + 10 adversarial prompt-injection tests (0 unsafe suggestions passed)