Two STT issues with inference.STT (Deepgram) on SIP/phone calls
Setup
livekit-agents— cascaded mode, SIP/phone outbound call- STT: Deepgram Nova-3 via
inference.STT,language="hi" - TTS: Sarvam Bulbul v3 (direct plugin, not inference)
- Turn detection:
MultilingualModel,max_delay=1.0s, adaptive interruption enabled - NC:
krisp_enabled=Trueon the SIP participant (no in-agent NC object) aec_warmup_duration=1.5,min_consecutive_speech_delay=0.30
Issue 1 — ~4s STT dead zone after agent’s first TTS playback
After the agent finishes its opening TTS utterance and enters listening state,
Deepgram stops emitting any events — including heartbeat/metrics — for ~3.9 seconds.
Any user speech during this window is completely dropped with no interim and no final
transcript produced.
What we see in the traces
34.71s Agent enters listening (first TTS done)
34.87s STT metrics ← heartbeats firing normally
35.94s STT metrics
37.84s STT metrics
38.69s STT metrics ← last event before gap
[user spoke here — zero Deepgram output for 3.9s]
42.59s STT metrics + [STT FINAL] ‘Hello.’ ← user’s repeat captured
The STT heartbeats were firing every ~1–2s before the gap and resumed normally
after it. The gap only appears after the first TTS playback of the session —
subsequent TTS → listening transitions do not show the same dead window.
Question
Is there a known reconnection or buffer-flush behaviour in inference.STT that
causes this dead window after the agent’s first TTS output on a SIP call?
Is there any way to detect this state or warm the STT connection before the agent
speaks its opening line?
Issue 2 — Deepgram interim never finalizes; stream only flushes at disconnect
When the user speaks during the agent’s listening state on a phone/SIP call,
Deepgram produces an interim transcript but never emits a final — keeping the
turn open for 15+ seconds. The final only arrives when the STT stream is torn down
at participant disconnect.
What we see in the traces
53.99s Agent enters listening
56.45s STT metrics
60.54s STT metrics ← user spoke around here, no transcript
65.54s STT metrics
67.54s [STT interim] ‘thoda’ ← Deepgram heard the user
68.04s STT metrics
69.00s Inactivity timer fires (15s expired — no STT FINAL arrived)
[agent speaks inactivity warning]
72.76s Agent re-enters listening
73–77s STT metrics ← Deepgram still processing
82.83s Participant disconnects
82.91s [STT FINAL] ‘thoda’ ← stream flushed at disconnect, ~15s after interim
Hypothesis
The inactivity warning’s TTS audio echoes back through the PSTN path. Since NC is
handled at the SIP trunk level and not inside the agent, Deepgram’s endpointing
sees continuous audio and refuses to close the utterance. It keeps accumulating
audio from both the user and the echoed TTS, never reaching a silence threshold to
emit the final.
This creates a compounding problem: the inactivity timer fires because no final
arrives → agent speaks → that TTS echo prevents the next final → repeat.
Questions
-
On SIP/phone calls, is there a known issue with
inference.STT(Deepgram)
keeping transcripts in interim state indefinitely when TTS audio echoes back
through the PSTN path? -
Is there an
utterance_end_msor equivalent endpointing parameter exposed
throughinference.STTto force finalization after N ms of continuous speech? -
Is there a recommended way to handle AEC on the agent side when
krisp_enabled
is set at the SIP trunk level — specifically to prevent TTS echo from confusing
Deepgram’s endpointing?
What we have tried
krisp_enabled=Trueon the SIP participant to handle NC at the trunk levelaec_warmup_duration=1.5to suppress early echolanguage="hi"(not"multi"— multi hallucinated non-Hindi languages on
Hindi speakers)
Any pointers appreciated.