Turn detection / interruption handling makes agent too sensitive and causes Agent interrupting the user
Turn detection / interruption handling makes agent too sensitive and causes user interruptions
tldr; It seems that interruption logic is shared across the agentβs thinking and speaking states and canβt be tuned independently.
That's why it's not possible to make the agent that is hard to interrupt but still friendly to slow speakers. Would love to solve it with available settings, but not sure if possible now.
What we've tried
1. Defaults
too interruptable
2. Less sensitive to interruptions
{
"turn_detection": "vad",
"min_interruption_words": 3,
"min_interruption_duration": 1.0,
"min_endpointing_delay": 1.0
}
3. Also tested
- Multiple min_interruption_words β [1..3]
- min_interruption_duration β [0.3..1.5]
- min_endpointing_delay β [0..1.5]
- With and without a turn detection model
We couldn't find a configuration that:
- Ignores brief interruptions while the agent is speaking, and
- Avoids agent interrupting the user while the user speaks slowly and deliberately.
Proposed enhancements (either/or or combined)
1. Per-state interruption profiles
- Separate parameters for speaking vs thinking states:
speaking_min_interruption_wordsspeaking_min_interruption_durationspeaking_min_endpointing_delaythinking_*counterparts
2. Agent-level dynamic overrides
- Allow all interruption and turn detection settings to be set/updated at agent level (not only global/session), and changeable at runtime on
agent_state_changed.
3. Uninterruptible words
- List of words that are never interrupting the agent
Environment
- LiveKit agent SDK: 1.2.2
- LLM: gpt-4o
- TTS: cartesia
- VAD - silero
- Turn Detection Model - Livekit Multilingual
- Languages: English/German
Would be great to get @longcw and @theomonnom opinion on that. We are fairly new to livekit, and this seems like a core logic of the sdk, but we would be happy to contribute if you think one of above makes sense lmk and will figure it out.
+1
fyi, you can modify the min_endpointing_delay in the event handler (#3227), and to update min_interruption_words and min_interruption_duration, simply change the session.options via session.options.min_interruption_duration = 0.5.
so maybe you can already implement the per-state interruption options in the agent_state_changed event handler, I am curious to see if that could fix the issue, we can add it to the framework if it's better.
Good idea, I missed this option. We came up with this config and shipped it, while testing it seemed much better, I hope
@self.session.on("agent_state_changed")
def on_agent_state_changed(event: AgentStateChangedEvent):
logger.info("Agent state changed: %s", event)
if event.new_state == "speaking":
self._update_silero_vad_options(min_speech_duration=0.05)
self.session.options.min_interruption_words = 2
self.session.options.min_interruption_duration = 1.0
self.session.options.min_endpointing_delay = 0.5
elif event.new_state == "thinking":
self._update_silero_vad_options(min_speech_duration=0.01)
self.session.options.min_interruption_words = 0
self.session.options.min_interruption_duration = 0.01
self.session.options.min_endpointing_delay = 0.01
else:
self._update_silero_vad_options(min_speech_duration=0.05)
self.session.options.min_interruption_words = 0
self.session.options.min_interruption_duration = 0.5
self.session.options.min_endpointing_delay = 0.5
Thanks for help ππΌββοΈ
Thanks for help, closing the issue for now, if we will see the need for the improvements we will come up with pr and let's continue from there
@Bnowako just confirming: are you still experiencing the original problem, or did the update address it?