Case study
A voice assistant for government service kiosks
It speaks Urdu and English, through an avatar I host myself. Built at the National IT Board for a one-stop government service centre in Islamabad.
Problem
Citizens visiting a one-stop government service centre needed to know where to go, what to bring, and what to pay for 69 services across 13 departments, including NADRA, Passports, IESCO, SNGPL, and FBR. Many prefer to ask out loud, in Urdu or a mix of Urdu and English, and a public kiosk must never invent a fee or discuss politics.
Solution
A voice agent that listens, works out what the person needs and calls tools to do it. It only answers from the official service catalogue, and an avatar speaks the reply. We rolled it out in three phases: information first, then real queue tokens, then government services and payments.
What I built
- Speech-to-speech agent on Gemini Live and OpenAI Realtime behind one switchable interface
- 20+ function-calling tools: catalogue search, CNIC scan with NADRA sign-in, queue tokens and printed slips, vehicle tax, challan, and licence lookups, complaints
- RAAST payment demo where the server, not the model, enforces the SMS one-time code
- Self-hosted avatar: Whisper, Kokoro TTS, MuseTalk 1.5 lip-sync, and aiortc WebRTC, replacing a paid avatar service
- Edge answer cache of pre-rendered speech and lip-sync clips on each kiosk
- A meeting mode where the assistant joins Google Meet, Zoom, or Teams
Numbers
- Swapping the lip-sync decoder for TAESD took the avatar from 6.5 to 32 fps; it streams 720p at 25 fps
- Barge-in stops the avatar within 85 ms of the citizen speaking
- Cached answers start playing in under 100 ms instead of 550 to 890 ms
- Moving the 290 KB catalogue into tool calls cut the prompt from 75K to 8K tokens
- Avatar GPUs on GCP NVIDIA L4, later moved to an on-premises NVIDIA L40S
Tech stack
- Gemini Live, OpenAI Realtime, OpenAI Agents SDK
- Whisper, Kokoro TTS, MuseTalk 1.5, Silero VAD, WebRTC
- Next.js, React, TypeScript, Python, FastAPI
- Docker, nginx, GCP, NVIDIA L4 and L40S
Outcome
- Running on the centre's kiosks, answering in Urdu, English, Punjabi, Sindhi, and Pashto
- Each phase has its own build and live link, so the next phase ships the day it is approved
- Politics and religion are refused; answers come only from the catalogue