I'm building a multi-agent conversational system. ...
# agents
e
I'm building a multi-agent conversational system. In it, I get all of the tokens for multiple agents being streamed from LangGraph. I have implemented an LLM node adapter for each that pulls their agent's tokens sequentially. In my first implementation, I register a callback in each LLM adapter that enables each to directly call
session.update_agent
once we detect from the LangGraph stream that we are now streaming the next agent's response. However, this doesn't seem to be the correct way to do this as I'm getting the following problem: (1) It seems like sometimes some of the agents' responses are skipped (2) I rely on the
on_conversation_item_added
event to store the previous response to my database. I want to use this rather than saving elsewhere in the flow to handle interruptions (i.e., if the user cuts off an agent at "Hi my name is..." I only want to save the fragment that was spoken to the database). Does anybody have any insight on the best way to do this with LiveKit Agents? TL;DR: Where is the proper place to call
session.update_agent
to hand off to another agent immediately after one agent is done speaking?