ProjectBuild an AI Voice Receptionist: the explanation · Module 2: The solution: listen, think, act, speak · part 4 of 23
Part 4 · Module 2: The solution: listen, think, act, speak

Module 2: The solution: listen, think, act, speak

23 min read·
About 40 minutes · Needs: Module 1 (the problem and the requirements) · Code: backend/app/voice/session.py, backend/app/agent/graph.py, backend/app/agent/runtime.py

Where this fits

WHERE THIS FITS The Medilane voice receptionist this module CLIENT React API LAYER FastAPI SAFETY SPEECH IN BRAIN LangGraph SPEECH OUT KNOWLEDGE AND DATA pgvector OPERATIONS Langfuse, Prometheus Caller app browser mic Staff app desk and admin REST API staff, sessions Voice socket audio both ways Auth + RBAC staff roles, voice tokens Guardrails emergency, PII VAD Silero, turns Whisper speech to text Language en, hi, Hinglish Agent tools, confirm Open models Groq: gpt-oss, Qwen Kokoro TTS en + hi voices Retrieval multilingual Ingestion clinic documents PostgreSQL clinic, calls, vectors Redis events, limits Front desk live events, hand-offs Observability traces, metrics Evaluation WER, safety, latency
The path of one caller turn (blue: the parts this module walks through). Each later module opens one of these stages.

Module 1 listed what the receptionist must do. This module follows one caller turn through the whole system, from the microphone to the speaker, and names each stage. The highlighted parts form the path every turn takes: the call page, the voice socket, the end-of-turn detector, Whisper, language detection, the guards, the agent and Kokoro. Later modules open each stage in detail; here you see how they fit together and why they are in this order.

The rest of this project is yours to keep

This project is bought on its own, once, and stays readable afterwards, including the parts added to it later.

Or open everything with a plan