ADR-0052: Voice channel language locks at first utterance — no mid-call switching
The master record is kept in the project's private repository.
Date: 2026-05-07 Status: Accepted Deciders: the project author Supersedes the mid-call language-switch sub-decisions in ADR-0051 Relates to: ADR-0049 (voice pipeline), ADR-0050 (Twilio/LiveKit SIP integration)
Context
ADR-0051 made the agentic voice orchestrator the only voice path and added a language-switch LLM tool plus a regex fast-path to support mid-call language switching. Two pilot calls in the following days surfaced a structural problem with the design:
- 2026-05-07, first pilot call — caller said "Do you speak English?" in English. Deepgram-NL phonetically hallucinated "Duursteking licht spelen". The fast-path eventually caught it but the LLM loop already burned 47 s.
- 2026-05-07, second pilot call — caller said "Do you speak English?" mid-call, after 8 successful Dutch turns. Deepgram-NL produced NO transcript at all for the English speech. The fast-path could not fire because there was nothing for the regex to match. The caller waited 30 s and gave up.
The second case is the structural one: once a voice call has locked to a single language at the STT layer, Deepgram in single-language mode silently emits zero transcripts on speech in other languages. There is no signal — neither gibberish nor partial — for any mid-call detector (regex, lexical, or LLM) to act on. Multi-language mode would solve this but it badly degrades Flemish accuracy ("Wat zijn de bezoekuren" → "Hå at zen de bezukjuren" in earlier measurements). The trade-off would cost the large majority of callers, who stay in one language, for the sake of a rare mid-call-switch case.
Decision
The voice channel's language is locked at the first utterance for the duration of the call. Mid-call switching is unsupported.
The design is hospital-agnostic: tenants configure their supported language set and default language through their taxonomy configuration, but the lock-and-stay policy applies regardless of which languages a tenant supports — whether that's a single-language tenant (nl-only) or a multi-language tenant (nl/fr/en/it).
The first-utterance probe in the voice agent continues to detect the caller's actual spoken language at call start (multi-mode STT for the first turn, then locks). After that, the call stays in that language even if the caller asks to switch. The agent's response when asked to switch mid-call: politely offer a transfer to the helpdesk.
Consequences
Removed
- The language-switch tool from the agentic orchestrator's tool list, with its handler and its system-prompt description
- The mid-call regex fast-path in the streaming query path (the backend mirror of the voice agent's probe pattern) and the in-loop short-circuit that handled it
- The tests that covered the tool and the fast-path
Net: roughly 80 lines of code removed.
Preserved
- The voice agent's first-utterance probe (still the primary language-detection mechanism)
- The client-side language-request detection that feeds the probe at call start
- The probe's one-time reconfiguration of speech-to-text and text-to-speech at call start
- A language-switch value in the response schema (kept for backwards compatibility; no orchestrator path emits it now, but the probe-time event uses it)
- The system-prompt instruction to politely transfer if the caller asks to switch language mid-call
Positive
- Single source of truth for language state — the voice agent owns it, sets it once, never mutates it. The backend orchestrator is language-aware (via the detected language passed with each request) but never changes it.
- Eliminates the silent-failure class caused by Deepgram's single-mode-no-transcript behaviour on cross-language speech.
- Simpler agentic surface — 3 tools instead of 4, fewer short-circuit paths in the loop, fewer integration tests to maintain.
- Hospital-agnostic by construction — no language-set hardcoded in the policy. Each tenant configures via taxonomy.
Negative / Trade-offs
- Caller who starts in EN and needs a Dutch medical term mid-call cannot have the agent switch language. Mitigation: the agent transfers to helpdesk on explicit ask. Frequency: rare in the pilot calls observed (no figure was recorded).
- If a tenant wants real multi-language switching mid-call in the future (e.g., a medical-tourism hospital where bilingual conversations are common), this ADR will need to be revisited. At that point we'd reconsider Deepgram multi-mode plus a per-tenant flag, or evaluate a different STT vendor.
Implementation
The change removed the tool, helper and patterns from the voice orchestrator, updated the system-prompt tool list, and removed or deleted the corresponding unit and integration tests. The master record is kept in the project's private repository.
Follow-ups
- The remaining script-2 (English) test deck still exercises a language-switch turn ("Kan je in het Nederlands verder gaan?") — that turn's expectation needs to update from "agent switches" to "agent politely declines and offers transfer". Will update when next test deck is generated.
- Voice eval harness (next batch) — with mid-call switching out of scope, the harness can assume single-language conversations, which simplifies its scoring rubric.
References
- ADR-0049: voice pipeline lineage.
- ADR-0051: the immediate predecessor; this ADR removes the language-switch tool and patterns it added.
- Deepgram Nova-3 announcement — STT model spec, language coverage, and the single-language-mode silence behaviour that motivates the lock-and-stay policy.
- LiveKit Agents documentation — runtime where the first-utterance probe and the orchestrator co-exist.