Skip to main content

Voice Language Locking

ADR: ADR-0052 Date: 2026-05-07 Status: Accepted

Deepgram Nova-3 is the production STT model; this page documents how the voice channel adapts to its single-language vs multi-language operating modes.

The problem​

ADR-0051 added a switch_language tool to the agentic orchestrator and a rule-based fast-path for mid-call language detection. Two pilot calls within days proved the design structurally broken:

Pilot call 1 — Caller said "Do you speak English?" in English. Deepgram (configured for Dutch/NL) phonetically hallucinated "Duursteking licht spelen" — no English phoneme coverage. The fast-path eventually matched, but the LLM loop had already run for 47 seconds before the switch fired.

Pilot call 2 — Caller said "Do you speak English?" mid-call, after 8 successful Dutch turns. Deepgram in single-language mode produced no transcript at all for the English speech — not gibberish, not a partial transcription, nothing. The fast-path could not fire because there was no text to match. The caller waited 30 seconds in silence and hung up.

The second case is structural: once Deepgram is configured for a single language at the STT layer, it silently emits zero transcripts on speech in any other language. There is no signal — neither garbage text nor an error event — that any downstream detector (rule-based, lexical, or LLM) can act on.

Multi-language Deepgram mode exists and would solve the silence problem, but it badly degrades Flemish accuracy. Earlier informal team observations showed Dutch queries going from "Wat zijn de bezoekuren" to "Hå at zen de bezukjuren" under multi-language mode. The trade-off would cost every Dutch caller accuracy in order to handle the rare mid-call-switch case; the project did not measure the share of such calls.

Deepgram operating-point comparison​

The team evaluated three Deepgram operating points before the decision. The trade-off table below records what was observed (qualitative; based on informal team observations, not a structured measurement, and flagged with * below).

Operating pointFlemish (nl-BE) accuracyCross-language coverageMid-call switching
Single-language (nl)High* — "Wat zijn de bezoekuren" recognised cleanlyZero — silent on English / French / Italian speech (no transcript emitted at all)Impossible — no signal for any detector to act on
Multi-language (multi)Degraded — "Wat zijn de bezoekuren" → "Hå at zen de bezukjuren" (informal team observation)Yes — English / French / Italian transcribedPossible — both languages parsed
First-utterance probe + lockHigh* — same as single-language for the rest of the callDetected once at call start; locked thereafterNot supported (deliberate trade-off)

The observations above merit a structured measurement pass against the current Deepgram Nova-3 (@deepgram_nova3) build; the qualitative ranking has held in pilot calls.

The decision (ADR-0052)​

The voice channel's language is locked at the first utterance for the duration of the call. Mid-call language switching is not supported.

The voice agent worker uses multi-language STT for the very first utterance only, detects the caller's actual spoken language, then locks Deepgram to that language for the remainder of the call. If the caller asks to switch language mid-call, the agent's response is a polite transfer offer:

"Ik kan u helaas niet omschakelen naar een andere taal. Ik kan u wel doorverbinden met een medewerker die u kan helpen. Wilt u dat ik dat doe?"

(Translated: "Unfortunately I cannot switch to another language. I can transfer you to a colleague who can help. Would you like me to do that?")

Implementation​

The lock is owned entirely by the voice agent; the backend never changes language state, it only reads it. The sequence is:

  1. Before the first utterance, no language is set.
  2. The first utterance is transcribed with multi-language STT and the spoken language is detected.
  3. STT and TTS are reconfigured once for the detected language, which is then locked for the call.
  4. Every subsequent turn, the voice agent sends the locked language with the query; the orchestrator reads it and never modifies it.

The detected language travels with every backend call. The orchestrator is language-aware (it uses it to select the right tenant FAQ overlay and voice system prompt variant) but has no mechanism to change it.

What was removed​

The following were deleted as part of ADR-0052:

ArtifactWhy removed
The switch_language tool in the orchestratorLanguage switching is no longer an orchestrator responsibility
Mid-call language fast-pathCovered a case that Deepgram's silence makes undetectable
In-loop switch_language short-circuit handlingNo tool to dispatch to
switch_language system-prompt tool descriptionRemoved from tool list
The unit and integration tests for the deleted pathTest code that no longer applies

Net: a small amount of code removed and 4 tools → 3 tools (search, transfer to helpdesk and end call remain; switch_language is gone).

What was preserved​

ArtifactWhy kept
First-utterance language detectionStill used for the first-utterance probe
The one-time language switch at call startCalled once at call start by the probe
The switch_language intent valueBackwards compatibility; no orchestrator path emits it currently
System-prompt instruction to politely decline and offer transfer on mid-call switch requestsThe agent still needs to handle the request gracefully

Hospital-agnostic parameterisation​

The lock-and-stay policy is universal — it applies to every tenant regardless of their supported language set. A single-language tenant (the pilot: Dutch) and a multi-language tenant (e.g., a medical-tourism hospital: nl/fr/en/it) both use the lock. The difference is what language the first-utterance probe detects and locks to.

Tenant language configuration is database-driven, the same path as all other tenant data. No language is hardcoded in source.

If a future tenant requires genuine mid-call language switching (bilingual conversations are common in their population), this ADR will need revisiting. The options at that point are: Deepgram multi-language mode with a per-tenant Flemish-accuracy trade-off accepted, or an alternative STT vendor that handles code-switching natively.

Contract test​

An integration test pins the language plumbing across the voice-agent-to-backend handoff: the voice agent locks the language at the first utterance and sends it on every turn, and the orchestrator must read and use it, never infer or override it. The test also asserts that no switch-language intent is emitted.

References​

  • ADR-0052: Voice Language Locked at First Utterance
  • ADR-0051: The agentic voice orchestrator (the ADR this one supersedes on language switching)
  • Deepgram Nova-3 — production STT model; the single-language vs multi-language trade-off is the empirical input to this ADR
  • Pilot call transcripts (a 47-second gibberish loop and a 30-second silent hang-up) are kept in the project's private logs.
  • Radford et al. 2023