we are using livekit cloud and inference, the agen...
# ask-ai
o
we are using livekit cloud and inference, the agent changes language in the middle of the conversation
✅ 1
t
Thanks for reaching out, fernando. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m sorry you’re seeing the agent switch languages mid-conversation. I can help troubleshoot and fix this. Quick context check: are you expecting the agent to stick to a single language, or do you want it to auto-detect and follow the caller? That determines the next steps. If you want the agent to auto-detect (current default behavior): • The agent uses STT with
language="multi"
to detect spoken language and will switch TTS accordingly. • Unexpected switches often come from STT mis-detection due to background noise, brief phrases in another language, or accent issues. • To debug, run the agent in dev mode and watch language detection events in the Agent Console to see which transcripts/language codes triggered the switch. If you want the agent to stay in one language: • Set the STT to a single language instead of
multi
so detection won’t switch. • Ensure agent instructions (LLM prompt) explicitly tell the model to respond only in the chosen language. • Make sure any frontend / participant attributes that carry language aren’t updating mid-call via
set_attributes()
. To proceed I need one of the following: • Tell me whether you want auto-detection or a fixed language. • Share the agent name or project ID and a timestamp/example (transcript snippet) of when the switch happened so I can point to the exact event in logs. Which option do you want me to help with? Sources: Build a multilingual voice agent that automatically switches languages | Li... | Turns overview | LiveKit Documentation, with interactive elements