Police emergency-response platform
A next-generation emergency call-taking and dispatch platform for the Islamabad 15 police helpline, with AI that assists call-takers but never makes the decision.
calls · sms · whatsapp → fastapi core └─ ai: suggests only
01 — Context
When someone dials 15, every second and every detail matters. The platform takes calls over phone, SMS, WhatsApp and a citizen app, builds a case and dispatches field officers who use a mobile app with live tracking.
02 — The problem
The system had to handle sudden call spikes without dropping calls, survive component failures, keep a tamper-evident record of every action, and use AI on Urdu speech without letting a model's mistake turn into a wrong decision.
03 — What I did
- Built across the platform: voice through Asterisk and WebRTC, messaging channels, case handling, dispatch, and a React Native responder app.
- Integrated AI where a model suggests and a person decides. Self-hosted Qwen (on vLLM) or Claude proposes the case type, nature, hoax likelihood and distress level, each with confidence scores and a recorded human verdict.
- Added Urdu speech-to-text (Whisper, Qwen3-ASR) with per-speaker labels, a voice agent and WhatsApp chatbot that hand off to a person, and post-call form filling that quotes the caller's own words.
- Kept AI safe: models run on premises so no audio leaves the deployment, simulated output is always labelled, and changes must pass an evaluation suite in CI.
- Ran load, stress, soak and failover tests, then fixed what broke.
04 — Architecture
Simplified on purpose: no infrastructure details. AI workers sit beside the core and only suggest; a person records every decision.
05 — Results (pre-production load tests)
| Metric | Before | After |
|---|---|---|
| 1,000 callers, 100 agents | 70–111 failed calls | 0 failed |
| Portal p95 response (150 users) | 2.8 s | 1.4 s |
| Portal median response | 1.2 s | 78 ms |
| Backlog filed after a backend outage | ~10 min | ~20 s |
| 20-minute soak | stopped at ~3.5 min | 3,000 calls, 0 failed |
| Redis failover | — | promoted in 3–4 s, 0 of 400 live updates lost |
Figures are from pre-production tests on a development machine, not the production servers.
06 — Stack
[Python, FastAPI, Next.js, React Native, PostgreSQL, PostGIS, Redis, Asterisk, vLLM, Qwen, Claude, Whisper, Prometheus, OpenTelemetry, Docker, Kubernetes]
07 — Honest limits
Some integrations (WhatsApp Business, SMS gateway, external identity provider) were still behind mock drivers at last review, and load tests still need to run on the pilot servers.