Skip to main content

Context-aware filler (A.2)

Status

Designed and implemented 2026-04-25. First item of the Q2 naturalness sprint, follows Phase 4.3+4.4 (speculative-STT). On by default; an operator setting can turn it off.

Why context-aware fillers exist​

Tier-1 fillers fire ~300 ms after the caller stops speaking, while the backend RAG round-trip is still in flight. A generic filler ("Een ogenblikje") signals only "I heard you, working on it." A topic-aware filler ("Ik zoek de bezoekuren voor u op") additionally signals "I understood the topic" — moving caller perception from "is the system buying time?" to "the system parsed my question."

The architectural choice is to do this on the voice-agent side with pattern matching, not in the backend with LLM intent classification. The trade-offs:

DecisionChosenAlternativeRejected because
Where topic detection runsVoice agent (media-server side), rule-basedBackend, LLM-classifiedFiller must fire ~300 ms after STT-final, and the backend roundtrip already accounts for that 300 ms — putting topic detection in the backend means the filler never wins the race. Rule-based matching on the agent side takes under 1 ms.
Topic taxonomy10 hand-curated topics × 4 languagesOpen-vocabulary topic extractionHand-curated misses long-tail topics, but the fallback is the generic filler — strict subset of correct behaviour. Open-vocabulary topic extraction needs an LLM call (back to the latency problem above).
GranularityTopic noun, not exact matchEcho verbatim phraseEchoing verbatim ("Ik zoek 'wat zijn de bezoekuren bij cardiologie' voor u op") is creepy at scale; the topic-noun substitution preserves naturalness without uncanny-valley quotation.

Sacks, Schegloff & Jefferson 1974

What it is​

When a caller mentions a known hospital topic in their question, the agent's tier-1 filler swaps from generic to topic-aware:

Caller saysOld filler (generic)New filler (context-aware)
"Wat zijn de bezoekuren bij cardiologie?""Een ogenblikje.""Ik zoek de bezoekuren voor u op."
"How much is parking?""Let me check that for you.""Let me look up the parking rates for you."
"Vorrei un appuntamento""Un momento, controllo per voi.""Controllo le informazioni sull'appuntamento."

Caller perception shifts from "the system is buying time" to "the system already understood my question and is actively engaged."

How it works​

  1. The voice agent already subscribes to the media server's interim-transcript events for speculation (Phase 4.3+4.4) and distress-on-interim.
  2. On every interim transcript, the agent runs a topic detector: a per-language pattern map covering 10 hospital topics. First match wins; subsequent partials do not override.
  3. When the tier-1 filler fires (~300 ms into the retrieval round-trip), it reads the stored topic and swaps in a topic-aware template.
  4. The fallback chain avoids regressions: no topic detected means the generic filler (existing behaviour); unknown language means generic; a missing topic in the language map means generic.

Topic taxonomy (10 topics × 4 languages)​

The taxonomy is a hand-curated map in the voice agent:

TopicCoverage
Visiting hoursBezoekuren / visiting hours / heures de visite / orari di visita
ParkingParkeren / parking / tarifs de parking / parcheggio
PhoneTelefoonnummer / phone number / numéro de téléphone / numero di telefono
AppointmentAfspraak / appointment / rendez-vous / appuntamento
Opening hoursOpeningsuren / opening hours / heures d'ouverture / orari di apertura
EmergencySpoed / emergency / urgences / pronto soccorso
DoctorDokter / arts / doctor / médecin / medico
DepartmentAfdeling / dienst / department / service / reparto
AdmissionOpname / admission / hospitalisation / ricovero
AddressAdres / locatie / address / adresse / indirizzo

3 variants per topic per language (= 120 templates total) so the agent doesn't sound robotic when the same topic comes up across calls.

Failure modes​

ScenarioBehavior
Topic detection misses (no keywords matched)Generic filler — existing behavior
Caller speaks language not in the map (e.g., German)Generic filler — defaults to Dutch
Topic key found but missing in language's template mapGeneric filler — defensive fallback
Switched offGeneric filler — operator override

No path leads to a crash or silent break. The feature is purely additive layered underneath existing behavior.

Observability​

When a context-aware filler fires, the agent logs a structured event with the topic and language. Aggregating these events across a week of pilot calls tells operators which topics dominate, which informs taxonomy expansion in the next iteration.

Settings​

The feature is on by default. An operator setting reverts to the earlier generic-filler behaviour.

Test it​

Speak a multi-word question containing a known topic keyword. Listen for the topic noun in the agent's first-response filler. Examples:

  • nl: "Wat zijn de bezoekuren bij cardiologie?"
  • en: "How much does parking cost?"
  • fr: "Quel est le numéro de téléphone?"
  • it: "Vorrei un appuntamento"

Then say something not on the topic list ("Wat is uw naam?") and observe the generic filler returns. The fallback is the proof that A.2 doesn't regress existing behavior.

Latency budget​

OperationLocal-dev p50 (self-reported)
Topic pattern match (10 topics × 4 languages)< 1 ms
Filler template selection (random from 3 variants)< 0.1 ms
ElevenLabs TTS first audio chunk for filler150–250 ms* (Multilingual v2 streaming, @elevenlabs_multilingual_v2)

* Per pilot measurement pass (Phase 5 of readiness plan).

References​