ProjectBuild an AI Voice Receptionist: the explanation · Module 12: Answering from clinic documents · part 14 of 23
Part 14 · Module 12: Answering from clinic documents

Module 12: Answering from clinic documents

25 min read·
About 45 minutes · Needs: Module 11 (the agent and its tools), Module 10 (languages and scripts) · Code: backend/app/rag/retriever.py, backend/app/rag/chunking.py, backend/app/rag/ingest.py, backend/app/agent/graph.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
Ingestion fills Postgres with clinic document chunks; retrieval (blue: this module) finds the right ones for each question.

When a caller asks about timings, fees, insurance or test preparation, the answer must come from Medilane's own documents. This module stores the clinic's documents as searchable chunks in Postgres and finds the few passages that answer a question, whether it was asked in English, Hindi or Hinglish. A wrong passage here becomes a confident wrong answer, read aloud.

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