in my agent when agent is being interrupted, the e...
# ask-ai
f
in my agent when agent is being interrupted, the entire message shows in the transcript, so llm doesn't have the context of the interruption. how to resolve this?
t
Thanks for reaching out, Amjad. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I want to make sure you feel confident about how LiveKit Agents handle interruptions, so here’s a little overview: to keep the LLM’s context accurate during interruptions, the system automatically marks interrupted messages and includes just the part that the user actually heard. This works thanks to synchronized transcripts and automatic history truncation. If you’d like to tailor this behavior to fit your needs, here are some options you can explore: • You can use the
interrupted: true
flag to clearly mark interrupted messages in the chat context. • Take advantage of synchronized transcripts to forward only the portion of the message that was heard. • Adjust parameters like
min_interruption_duration
and
false_interruption_timeout
to fine-tune how interruptions are handled. • Or, if you prefer more manual control, you can use methods like
allow_interruptions=False
or
interrupt()
. Please feel free to reach out if you want more details or a hand with implementing any of these features—I’m here to help! Sources: Tool definition and use | LiveKit Docs | Bringing AI avatars to voice agents | agents/src/voice/agent_activity.ts | Turn detection and interruptions | LiveKit Docs | tests/test_agent_session.py
f
But the default is not working as expected for me. What could be wrong?
t
I'd love to help you get this sorted out! Could you share a bit more about what's not working as you'd expect? For instance: • Are interruptions not being detected at all? • Are interruptions happening too often or at unexpected times? • Is the LLM context not updating properly after an interruption? Knowing these details will really help me guide you through the best troubleshooting steps. Looking forward to your reply! Sources: examples/voice_agents/README.md | Turn detection and interruptions | LiveKit Docs