ProjectBuild an AI Voice Receptionist: the explanation · Module 16: Models, routing, fallbacks and prompts · part 18 of 23
Part 18 · Module 16: Models, routing, fallbacks and prompts

Module 16: Models, routing, fallbacks and prompts

25 min read·
About 40 minutes · Needs: Module 11 (the agent graph and its tools), Module 3 (infrastructure: why open models on Groq) · Code: backend/app/agent/router.py, backend/app/agent/llm.py, backend/app/agent/prompts.py, backend/app/services/prompt_service.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 (blue) covers how the agent picks one of three open models on Groq and which stored prompt version it answers with; admins edit prompts in the staff app, and versions live in PostgreSQL.

Module 11 showed the agent deciding what to do. This module covers what it leans on every turn: which model answers, and with which written instructions. Both change while calls run, so both need the care of code.

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