ProjectBuild an AI Voice Receptionist: the explanation · Module 5: Low-level design: data and protocols · part 7 of 23
Part 7 · Module 5: Low-level design: data and protocols

Module 5: Low-level design: data and protocols

24 min read·
About 45 minutes · Needs: Module 4 (the high-level design) · Code: backend/app/models/, backend/alembic/, backend/app/schemas/__init__.py, backend/app/voice/audio.py, backend/app/voice/session.py, backend/app/voice/stt.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
This module defines what flows between the highlighted parts (blue): the rows in Postgres, the messages on the voice socket and the interface between voice and the agent.

Module 4's high-level design drew the boxes. This module defines what flows between them: the rows Postgres keeps, the bytes and events on the voice WebSocket, and the Python interfaces where the voice part meets the brain. These three contracts are what let four parts of the code be built at the same time and still fit.

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