ProjectBuild an AI Voice Receptionist: the explanation · Module 11: The agent: tools, identity and confirmation · part 13 of 23
Part 13 · Module 11: The agent: tools, identity and confirmation

Module 11: The agent: tools, identity and confirmation

23 min read·
About 50 minutes · Needs: Module 2 (the voice loop and tool calling), Module 7 (slots and safe booking), Module 10 (language handling) · Code: backend/app/agent/graph.py, backend/app/agent/tools.py, backend/app/agent/runtime.py, backend/app/agent/events.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 agent (blue: this module) turns each caller turn into model calls and tool calls, and keeps the call's memory in Postgres.

The voice session hands the agent one caller turn as text, with its language. The agent decides what to do, calls the model and the clinic tools, and streams checked speech back. It is the only part that can change an appointment, so it is also where the rules about identity and confirmation must hold, whatever the model says.

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