ProjectBuild an AI Voice Receptionist: the explanation · Module 8: Knowing when the caller has finished · part 10 of 23
Part 10 · Module 8: Knowing when the caller has finished

Module 8: Knowing when the caller has finished

20 min read·
About 35 minutes · Needs: Module 5 (the low-level design: PCM16 audio and its protocol), Module 2 (the voice loop) · Code: backend/app/voice/vad.py, backend/app/voice/audio.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 VAD (blue: this module) listens to the caller's audio as it arrives on the voice socket and decides where each turn ends.

The caller's browser streams microphone audio over the voice socket without pause. Something has to decide where one caller turn ends, so the receptionist can transcribe it and answer. That is this module: the VAD reads the audio as it arrives, finds the start and end of each turn, and hands each finished turn to Whisper (Module 9). Answer too early and the receptionist cuts the caller off; too late and every reply feels slow.

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