Overview
The problem
A 108 call in Chennai is often in Tamil or Tanglish (Tamil written in English letters, mixed with English). It is often panicked, and often vague about where the caller is. The usual dispatch rule, "send the nearest ambulance", ignores three things:
- Capability. Is the nearest unit equipped (ALS vs BLS) for what is probably happening?
- Uncertainty. Triage from a short, noisy call is a probability, not a label.
- The next call. Taking the only ALS unit out of a busy area makes the next cardiac arrest there wait longer.
What Vaazhvu does
Caller ──────────────► Intake ──► Understanding ──► Safety ──► Dispatch ──► Response ──► Hospital
iPhone app / web / voice speech-to-text fixed risk model simulated ER board,
SMS / SOS button SMS, SOS language ID rules over all units on pre-arrival
text Tanglish→Tamil R1–R9 feasible real roads, checklist,
Tamil→English bundles vitals, FHIR R4
LLM triage (×5) NEWS2
geocoder
▲ │
└──────────── AI call-taker talks to the caller the whole time ◄───────┘
(status, ETA, questions, safety instructions)
- Intake.
- The caller holds the SOS orb (GPS sent), taps Call (live two-way voice with the AI) or taps Message (chat thread).
- Repeat messages from the same number join the same incident.
- Understanding.
- The language is identified and Tanglish is transliterated into Tamil script. Tamil is translated into English as an extra view.
- An LLM reads the call 5 times independently and extracts structured findings, each with an evidence quote. A finding counts only if its quote really appears in what the caller said.
- The votes become a severity distribution (critical / urgent / non-urgent), plus a confidence.
- A gazetteer built from OpenStreetMap turns "near Guindy bridge" into coordinates.
- Safety policy. Deterministic rules can raise severity, add mandatory capabilities (ALS, cardiac…) or require a human to approve. They never lower acuity. A likely-critical call is dispatched provisionally and verified afterwards, never held.
- Risk dispatch.
- Every feasible response is scored, including combined ones: one ambulance, police or fire first responder plus ALS, or two ambulances.
- The score is expected harm over the severity distribution, plus a penalty for spread, plus the cost of leaving areas uncovered.
- The decision records why the nearest unit lost.
- Response.
- Units drive OSRM road geometry under a simulation clock.
- Road closures re-route them.
- A NeuroKit2 patient monitor streams vitals. Rising NEWS2 re-triages the patient and can send a backup unit or change hospital.
- Hospital. The receiving ER gets an alert with ETA, severity, vitals and a preparation checklist. FHIR R4 bundles go to HAPI FHIR.
- Conversation.
- All the way through, the AI call-taker writes every sentence the caller hears or reads. It uses the live incident state: what is known, which unit is coming, the ETA.
- It asks only what is still missing, gives standard pre-arrival instructions, and is checked before anything reaches the caller.
- Voice and chat are separate conversations on the same incident.
- Operations.
- The dispatcher console shows everything live and lets a human approve, override, reply to the caller, redeploy units or inject road closures.
- Crews follow their job on the crew app.
- Every step is an event, written to SQLite, streamed to every screen and mirrored to NATS.
Design principles
- No scripted dialogue, no keyword lists. Triage has no regex symptom rules. The call-taker has no fixed questions; its brief is in
config/calltaker.yaml. UI text comes from the server (config/app.yaml). - The AI is never the authority. LLM output is schema-checked, evidence-checked and vote-aggregated. The safety policy and the optimiser are deterministic and auditable. Low confidence goes to a human.
- Everything degrades, nothing stops. Each external service has a fallback:
- DeepSeek falls back to local Gemma.
- OSRM falls back to Haversine distance.
- Whisper falls back from MLX to faster-whisper (always faster-whisper in Docker).
- If no LLM is reachable at all, triage abstains, the safety policy sends ALS and a human decides.
- Tests run with no external services.
- Real geography. Hospitals, stations, localities and landmarks come from OpenStreetMap. The fleet is placed by an optimisation model (MEXCLP), not by hand.
- Measured claims.
scripts/eval_dispatch.pycompares the risk engine against nearest-unit baselines over 10 seeds. Results, including where it does not help, are indocs/eval/RESULTS.md.
Two code paths
| Path | Entry point | Status |
|---|---|---|
| Live operations | backend/app/ops/controller.py (OpsController), API under /api/ops, views in frontend/src/live/, iOS apps in ios/Vaazhvu | The product. Everything in these docs refers to this path unless marked legacy. |
| Legacy scenario runner | backend/app/sim/runner.py::run_scenario, API under /api/*, views under /legacy* | The original single-run demo, kept for regression tests. |