<@U08CKJH7C12> In a multi-agent set up, when we sw...
# agents
p
@refined-appointment-81829 In a multi-agent set up, when we switch from one agent to another, it seems to take 3-4 seconds on average. Is there a way to cut it down?
👀 1
p
Also interested on this one...
r
I've run multi-agent a fair amount and have not noticed. Can you tell me more about you setup like what LLM, TTS, STT or RT that you are running so I can try and reproduce the issue.
p
In this test scenario, we are using Deepgram for STT; OpenAI 4.1 for LLM, and eleven labs for TTS. Within the agent, the latency is pretty good. It is always during agent hand off that we experience 3-4 second delay. We are not sharing resources amongst agents. Could that be the reason? I feel it’s taking time to initialise the hand off agent
b
I noticed improvement when all the agents were initialized in the entrypoint of the call instead of only one at a time. There was an example at some point in agents repo but I couldn't find it 🤔. It is more cumbersome though, you have to update all the relevant data during the transition.
l
We have a simple demo that shows agent switching: https://github.com/livekit-examples/python-agents-examples/blob/main/multi-agent/long_or_short_agent.py, can you take a look at that and see if you're seeing the same delay. I tested with our inference config and the delay feels a lot shorter than 3-4 seconds:
Copy code
stt="deepgram/nova-3:en",
 llm="openai/gpt-4.1-mini",
 tts="elevenlabs/eleven_turbo_v2_5:cgSgspJ2msm6clMCkdW9",