Hi, is there a way to have parallel agents within ...
# agents
g
Hi, is there a way to have parallel agents within a session in livekit. My use case is that I want an orchestrator agent always listening and constantly figuring out if the call needs to be handed off to another agent. Any thoughts on how to best implement this? Here are a few alternatives w/ issues that come to mind: 1. Have transfer tool calls on all agents so that agents have access to transfer to each other always a. This leads to a lot of hallucination + prompt usage since I have to define transfer usecases in all agents 2. Do a handback (e.g Orchestrator passes to agent 1 => agent 1 is confused, passes back to orchestrator => orchestrator passes to agent 2) a. The hardest part here is determining when "agent 1 is confused" and feels clunky
✅ 1
p
How do you determine if a call needs to be transferred to another agent?
I implemented a multi agent architecture and put them on a graph. Each agent has a goal on the graph, and once the goal is met, it makes transition. The transition is a method from the agent, which checks if there is an edge from the current agent to a target agent. If so, it transfers to the next agent. Otherwise, it hang up the call. The context isolation solved by injecting only instructions that each agent needs. And the chat history is copied between agents, conditionally, during a transition.
What kind of hallucination does your agent get into? I’m minimizing those with a few strategies: • minimizing the scope of each agent (less instructions, less tools) • adding explicit instructions to penalize the agent if it goes off script • being very specific about the goal of the agent, though instructions • Enforcing a state machine and flow with multiple agents I don’t know what’s your use case, this works really well for flows that don’t require too much branching.
LangGraph might help you here.
g
Hey @proud-lawyer-39815 we have a high branching factor. Our current structure is a router agent => many sub-agents depending on task. However at times, we realize we need to switch between sub-agents (maybe during the call the task changes): 1. We have a kickback process where if sub-agent cannot handle we give it back to router (we are in development and still experimenting) 2. I am trying to avoid having lots of transfer tools between sub-agents We were thinking that if there's an agent always listening in parallel or on the side and is responsible for quickly switching between sub-agents, that'd be optimal.