Samanvay
Different languages. One incident. The urgent report never disappears in the crowd.
A station-controller dashboard for metro complaints. It turns Gujarati, Hindi, English and Gujlish complaints into department queues and groups reports about the same asset. When new evidence shows danger, it raises the priority. It drafts acknowledgements in the passenger's language and syncs every record to a central receiver without duplicates. All AI inference runs locally through Ollama.
Priority 3 → 5, routed to the safety queue, with the exact evidence quote shown to the controller.
How it works
- AI extracts, rules decide, the controller approves. A small local model (gemma4:e2b) returns language, station, asset, department, urgency and an exact evidence quote. Deterministic code groups incidents and sets priority.
- Grouping: same station + same explicit asset + open incident + last report within 30 minutes.
- No silent downgrades: priority is the max of the member reports. A later "it's fixed" message can't lower an open urgent incident; only a recorded controller action can.
- Validation: the evidence must be a literal substring of the original complaint. Station conflicts and invalid output go to Needs review.
- Hazard pre-screen: keywords for trapped, smoke, fire or injury in all four languages. If they fire but the AI rates the complaint low, a human reviews it.
- Offline-first sync: each change is written to an outbox in the same transaction and acknowledged by event ID, so retries never duplicate a record.
Streamlit dashboard -> station.db (complaint + outbox event, saved before inference) -> local Ollama, JSON-schema structured output -> validation + hazard pre-screen + priority rules + incident grouping -> sync -> central receiver (FastAPI) -> ack by event_id
Measured on held-out cases
11 synthetic cases across four languages (smoke, entrapment, violence, negated smoke, prompt injection and more), run with gemma4:e2b on a GTX 1650 laptop.
| Metric | Result |
|---|---|
| Department correct | 10 / 11 |
| False urgent (AI) | 0 / 8 |
| Urgent recall (AI / keyword baseline) | 2/3 / 3/3. The AI's miss is flagged for review. |
| Incorrect merges | 0 |
| Latency, warm (median) | ~6.5 s |
Small smoke test with draft labels, not production validation. The data is synthetic; the station names are real and the asset IDs are fictional.
Run it
Samanvay runs on a station laptop with a local model, so this page describes it rather than hosting it.
pip install -r requirements.txt ollama pull gemma4:e2b python -m streamlit run ps07/app.py python -m uvicorn ps07.receiver:app --port 8001
Source: github.com/tanvishdesai/MetroHack
Built for Metro Hacks: Midnight Edition (GDG Gandhinagar), problem statement PS-07. Built with Streamlit, FastAPI, Pydantic, SQLite and Ollama.