Skip to main content

A Voice Call, End-to-End

The voice channel is documented one concept at a time — architecture, language-locking, the Value Framework, citation pipeline, answer-shaping, triple-defense. This page is the connective tissue for the spoken channel: it follows one real four-turn phone call — a caller booking a cardiology appointment — through every stage, so you can see how the pieces compose across a conversation. It is the voice sibling of the text channel's A Query, End-to-End.

Every value here is real

The intents, confidences, follow-up resolutions, routing decisions, capability hits, enrichment counts, and spoken answers below were captured live from the pilot on 2026-06-01 — by driving the public query connection as the voice channel for the four turns and reading the backend's own logs for that conversation, not illustrative placeholders. This is a single scripted call run by the project team, an illustration of the flow rather than a measurement of quality. Names of real clinicians have been replaced by roles.

This page is an honest hybrid: the backend cognition is live-captured; the agent-side stages with no backend log — Deepgram STT confidence, language voting, the three-tier filler ladder, ElevenLabs TTS prosody — are sourced from real code constants and documented pilot traces (for example the grace-tuning chain described on the architecture page), and are labeled as such rather than dramatized.

A voice turn at a glance​

Every turn flows through this pipeline. The fork in the middle is the part the text channel doesn't have: a turn either matches a registry capability and is answered deterministically (no LLM), or falls through to the agentic GPT-4.1 tool loop that calls the knowledge-base search tool and the RAG pipeline.

Stage legend​

Each stage links to the page that explains it in depth, plus the glossary terms it uses.

StageWhat happensConcept pageGlossary
STTDeepgram Nova-3 streams the caller's audio to a transcript; doctor names bias the recognizer.Architecture—
Language lockThe first confirmed utterance pins the call's language; later turns don't re-detect (locked-out languages produce silent transcripts).Language Locking—
Orchestrator entryThe transcript reaches the voice orchestrator as a voice-channel request. The rule-based pre-filter short-circuits greetings/farewells/safety with zero LLM cost.Architecture, Triple Defenseintent classifier
Capability forkThe shared classifier runs first; if the intent maps to a registry capability (doctor-schedule, billing, address) it is answered deterministically. Otherwise the agentic GPT-4.1 tool loop runs.Architectureintent classifier
Retrieve (agentic path)The search tool calls the same retrieval pipeline as chat, flagged as voice: hybrid retrieval + the department doctor-list injection.A Query, End-to-End, What is RAGRAG, hybrid
RerankThe Value Framework reranks chunks by intent × content-category affinity before context assembly.Value FrameworkValue Framework, reranking
Safety + shapeA rule-based post-filter checks the output; the answer shaper detects medical content, strips markdown / URLs / citation markers, formats phone numbers for prosody, caps the answer at two sentences, and prepends the disclaimer once per call.Triple Defense, Answer Shaping, Safetygrounding, medical-advice refusal
CitationsVoice answers carry no inline [N] markers (TTS would read them aloud); citations are derived from the retrieved chunks instead.Citation Pipeline—
TTSElevenLabs Multilingual v2 streams the answer back in the locked voice; punctuation drives prosody (commas chunk a phone number). The filler ladder masks backend latency.Prosody Injection, Adaptive TTS Speed, Context-Aware Filler—
What the real trace reveals

Driving four turns through the live pilot surfaced three things the architecture diagram alone does not:

  1. One conversation, two cognition paths. Turns 1–3 (ambiguous_symptom_description, doctor_lookup) have no registry capability, so they fall through to the agentic GPT-4.1, search tool and RAG path. Turn 4 (doctor_schedule_query) matches a capability and short-circuits the LLM entirely, with no retrieval at all.
  2. Follow-up resolution carries the thread. "professor [surname]" becomes the full name on turn 3, and the bare pronoun "hij" resolves to the full name of the professor on turn 4 — each done by the intent classifier reading 2–3 prior turns of history.
  3. The voice shape diverges from chat on identical retrieval. The same doctor_lookup that the chat channel renders as a full 23-name roster, the voice channel compresses to two names plus "andere cardiologen" to honor the two-sentence TTS cap.

The call, turn by turn​

A caller dials in with a symptom and walks all the way to a specific doctor's consultation hours. All values are from the live pilot trace.

Turn 1 — symptom → department (agentic RAG path)​

Star stage: the intent rewrite turns the lay symptom into a clinical term, and the safety layer prepends a spoken disclaimer before routing the caller to a department.

StageReal traceReference
Raw"Ik heb last van hartkloppingen, bij welke dienst moet ik zijn?"—
Intentambiguous_symptom_description (0.90), not a follow-up; rewrite "Welke afdelingen bij zol behandelen Palpitaties?" — hartkloppingen → Palpitaties (lay → clinical); classifier latency about 3.6 sintent classifier
Pathno registry capability for this intent → agentic search tool → RAG (intent already classified, so the retrieval pipeline skips its own classifier call)Architecture
Retrievethe taxonomy resolves "hartkloppingen" to the specialty cardiologie; 5 chunks retrieved; Value Framework primary category clinical_info, mismatch rate 0.000hybrid
Safety + shapemedical content detected → disclaimer prepended; phone formatted for prosodyAnswer Shaping
Spoken"Daar kan ik geen specifiek medisch advies over geven; voor hartkloppingen kunt u terecht bij de afdeling Cardiologie van ZOL via het nummer ..." (the department's phone number, read out in digit groups)medical-advice refusal

Turn 2 — doctor list (agentic RAG path, doctor-list injection)​

Star stage: the department doctor-list injection feeds the full roster into context, but the voice answer-shaper compresses it to fit the two-sentence cap.

StageReal traceReference
Raw"Welke artsen werken er op de dienst cardiologie?"—
Intentdoctor_lookup (0.95), follow-up, 1 prior turn; rewrite "Welke artsen werken bij de afdeling Cardiologie…"intent classifier
Pathdoctor_lookup has no registry capability → agentic search tool → RAGArchitecture
Retrievethe department doctor-list injection found 25 doctors for Cardiologie; taxonomy enrichment applied with 23 doctors; Value Framework primary category generalStage 5c injection
Shapetwo-sentence cap → two named doctors + "andere cardiologen" (the chat channel lists all 23)Answer Shaping
Spoken"Op de afdeling Cardiologie werken onder andere Dr. A en Prof. Dr. B, samen met andere cardiologen. Wenst u informatie over een specifieke arts of wilt u een afspraak maken?"grounding

Turn 3 — doctor profile (agentic RAG path, follow-up resolution)​

Star stage: follow-up resolution expands the bare reference "professor (surname)" into the canonical full name using two turns of history.

StageReal traceReference
Raw"Vertel me meer over professor (surname)."—
Intentdoctor_lookup (0.95), follow-up, 2 prior turns; the rewrite expands the question to the professor's full name and asks which department he works in — the bare surname was resolved to the full nameintent classifier
Pathagentic search tool → RAG; taxonomy enrichment with 24 doctors; Value Framework primary category appointmentsArchitecture
Spoken"Prof. Dr. B is cardioloog op de afdeling Cardiologie van Ziekenhuis Oost-Limburg. Hij houdt raadplegingen op twee campussen. Wenst u een afspraak of meer details?"grounding

Turn 4 — schedule (deterministic capability short-circuit)​

Star stage: the bare pronoun "hij" resolves to the doctor, the intent matches a registry capability, and a structured consultation-schedule lookup answers without any RAG retrieval.

StageReal traceReference
Raw"Wanneer werkt hij?"—
Intentdoctor_schedule_query (0.95), follow-up, 3 prior turns; the rewrite asks when the named professor holds consultations — pronoun "hij" resolved to the professor's full nameintent classifier
Pathintent matches a registry capability → deterministic doctor-schedule capability; the agentic orchestrator and RAG are skippedArchitecture
Lookupthe capability returns the named doctor's structured consultation schedule from the doctor's profile, with a citation; the tenant's fallback phone number is used because the per-doctor phone is emptyCitation Pipeline
Spoken"Prof. Dr. B houdt raadpleging op woensdagvoormiddag (wekelijks), donderdagnamiddag (wekelijks), ... U kan een afspraak maken via 089/acht nul, ... acht nul, ... acht nul." (the helpdesk number 089 80 80 80)grounding

What's voice-specific​

The same retrieval pipeline powers chat and voice, but the voice flag flips a set of behaviours visible in the trace above:

  • Language is locked at the first confirmed utterance — every turn above stayed nl (Language Locking).
  • No inline [N] markers — TTS would read "open bracket one"; citations are derived from chunks instead.
  • Two-sentence cap — turn 2 lists two cardiologists + "andere cardiologen" rather than the chat channel's full roster (Answer Shaping).
  • Disclaimer once — turn 1's medical content triggers the spoken disclaimer; later turns don't repeat it.
  • Phone prosody — phone numbers such as 089 80 80 80 are spoken with comma boundaries so ElevenLabs chunks the digits (Prosody Injection).
  • Filler ladder — while the backend thinks, tiers at 1.5 s / 4 s / 10 s mask the silence and cancel the moment the first sentence streams back (Context-Aware Filler).

Where to go next​

  • A Query, End-to-End — the same treatment for the text channel (five one-shot queries).
  • Voice Channel — Architecture — the orchestrator composition, the full dial-through-hang-up sequence diagram, and the latency budget.
  • Glossary — canonical definition of every term used above.