I'm looking at the multi agent example here and I ...
# ask-ai
p
I'm looking at the multi agent example here and I was wondering if it's possible to use the same voice (tone, speed, etc.) between agents? I noticed when I transfer from one agent to another, the voice changes slightly (even if I set it at the AgentSession level).
t
Thanks for reaching out, Mario. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To keep the voice settings (like tone and speed) consistent across all agents in the multi-agent setup, here are a few friendly tips: • Share the same TTS instance in the
AgentSession
for all agents. • Make sure each agent is initialized with the same TTS parameters (such as voice and speed). • If you want, you can also use LLM-generated directives to help keep the vocal style steady when agents pass the conversation along. Here’s a quick example of how you might set up the TTS settings:
Copy code
tts=elevenlabs.TTS(
    voice_id="your_voice_id",
    voice_settings=elevenlabs.VoiceSettings(
        stability=0.7,
        similarity_boost=0.8,
        speed=1.1
    )
)
Just make sure all your agents use this same setup, and you’ll get a nice, consistent voice experience. If you want to chat more about this or need a hand, I’m here to help! Sources: livekit-agents/livekit/agents/voice/agent.py | complex-agents/medical_office_triage/README.md
p
I'm using cartesia and vad
t
Hey there! To keep your voice settings nice and consistent when using Cartesia and VAD in your multi-agent setup, here’s a friendly step-by-step guide: • Preload VAD and Cartesia voices: Start by using the
prewarm
function to load the VAD model and grab Cartesia voices right at startup. Pop these into
proc.userdata
so all your agents can easily share them. • Centralize voice configuration: It helps to set default or role-specific voices in a shared dictionary. Then, just reuse those voice IDs when you initialize
cartesia.TTS
for each agent. • Use a shared VAD instance: Make sure every agent taps into the same preloaded VAD instance. This keeps voice detection smooth and consistent across the board. • Apply consistent AgentSession configuration: Pass along the same
vad
and
tts
instances to all your agents. That way, everything stays uniform during multi-agent handoffs. • Dynamic updates: If you want to switch voices on the fly, just check that the voice IDs are valid against your pre-fetched Cartesia voices list. Here’s a quick example of how a consistent TTS setup could look:
Copy code
tts = cartesia.TTS(
    model="sonic-2",
    voice="shared_voice_id",
    speed="normal",
    emotion=["curiosity:highest", "positivity:high"]
)
If you want me to walk you through any part of this or need a hand setting it up, just give me a shout! Sources: agent/main.py | examples/voice_agents/restaurant_agent.py | Cartesia integration guide | LiveKit Docs | pipeline-tts/cartesia_tts.py
p
I'm not passing the tts or vad to agents. I simply set them on the AgentSession. Is that enough or do I have to explicitly pass those values along?
t
Just a heads-up: setting TTS and VAD on the
AgentSession
is all you need to keep voice settings consistent across your multi-agent setup. The agents will automatically pick up these components from the session, unless you decide to override them for specific agents. This way, you get a smooth, uniform voice experience across all agents without the hassle of passing TTS or VAD to each one individually. If you have any questions or want me to walk you through it, just give me a shout! Sources: translators/pipeline_translator.py | Building voice agents | LiveKit Docs | examples/src/drive-thru/drivethru_agent.ts | livekit-agents/livekit/agents/voice/agent.py
p
Um.. if I'm already doing that and getting different results, is there a way to enforce with agent instructions? But even so, it isn't guaranteed, right?
t
Just a heads-up: agent instructions alone can’t guarantee consistent TTS and VAD settings since these are set right at initialization. To keep things consistent, here’s what you can do: • Make sure to use the same
tts
and
vad
instances when you’re initializing all your agents. • Stick with the
AgentSession
defaults and avoid changing them at the agent level. This way, you’ll reduce inconsistencies, though it’s good to know that if agents override these settings, uniformity might still be affected. If you want, I’m here to help you set this up! Sources: livekit-agents/livekit/agents/voice/agent_session.py
p
Hey AI, I just tried with the code below. Do you see any problems with it?
cc @tall-belgium-91876 🆘
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!