ProjectBuild an AI Voice Receptionist: the explanation · Start here · part 1 of 23
Part 1 · Start here

Build an AI Voice Receptionist: the explanation

2 min read·

A working voice receptionist for a fictional clinic in Pune, taken apart in illustrated modules. Callers talk in the browser in English, Hindi or Hinglish; the receptionist answers from the clinic's own documents, books, moves and cancels appointments after checking who is calling, stops talking the moment the caller interrupts, and sends every emergency straight to 112 and the front desk. Everything runs on open models: Whisper for listening, open-weight language models on Groq for thinking, and Kokoro for speaking on an ordinary CPU.

Who it is for: anyone who knows a little Python and wants to understand, rebuild or extend a real-time voice AI application, from beginners to working engineers. Each module says what to read first.

How each module is laid out

SectionAnswers
Where this fitsthe same system map in every module, with this module's parts highlighted
What it doesthe idea in one picture, then each production practice at a glance: what, why, how, when, where
Use cases and examplesthe same practice in this clinic and in other industries
How it worksthe mechanism step by step, one figure per step, with real values
Code tourthe real files, short excerpts, every line explained, concept boxes for new ideas, and a "what happens when" trace
Design decisionswhat was chosen, the alternatives and why, with measured numbers, and when to choose differently
What can go wrongfailures and attacks, how the code handles each, and the test that proves it
Try it yourselfexact commands and what you should see
Check yourself, Key termsa short quiz and a glossary

Figures use one colour language: blue is our system, amber is a model or anything uncertain, green is correct or safe, red is failure or attack, grey is background.

Modules

#ModuleMain code
0Project overview: a guided tour of the running appscreenshots of the real app, no code
1The problem a clinic phone line hasresearch/, data/
2The solution: listen, think, act, speakvoice/session.py, agent/graph.py
3Choosing models and infrastructureresearch/, core/config.py, docker-compose.yml
4High-level designmain.py, voice/ws.py, agent/runtime.py
5Low-level design: data and protocolsmodels/, alembic/, the WebSocket protocol
6Staff sign-in, roles and voice sessionscore/security.py, core/rbac.py, api/routes/voice.py
7Doctors, slots and safe bookingservices/clinic_service.py
8Knowing when the caller has finishedvoice/vad.py
9Speech to text with Whispervoice/stt.py
10English, Hindi and Hinglishagent/language.py, voice/normalize.py
11The agent: tools, identity and confirmationagent/graph.py, agent/tools.py
12Answering from clinic documentsrag/
13Giving the receptionist a voicevoice/tts.py
14The live call: streaming and barge-invoice/session.py, voice/ws.py
15Safety: emergencies, scope and personal dataagent/guardrails.py, core/pii.py
16Models, routing, fallbacks and promptsagent/router.py, agent/llm.py, agent/prompts.py
17Evaluating a voice agentevals/
18Watching calls liveobservability/, services/events.py
19The call page and the staff appfrontend/src
20Containers and the local stackbackend/Dockerfile, docker-compose.yml
21Deploying to Google Cloud with CI/CDdeploy/gcp/, .github/workflows/