---
title: "How to build multilingual AI agents for customer support"
description: "Building a multilingual AI agent for customer support requires coordinating speech-to-text, the LLM, and text-to-speech so all three switch languages together, since callers may change languages mid-conversation. Twilio ConversationRelay handles speech-to-text and text-to-speech, with each element mapping a language code to its own transcription provider, voice, and speech model. Setting speech-to-text to multi with Deepgram tags each utterance with a primary language code, so the agent detects a switch and sends a WebSocket language message that changes languages without restarting the call. Prompt design keeps the LLM consistent, and Twilio Conversation Memory stores the customer’s language trait so the next call starts in the right language. Agent Connect extends the same agent across SMS, WhatsApp, RCS, and Chat, and passes the detected language as a TaskRouter attribute so Flex can hand off to a human who speaks it."
---

# How to build multilingual AI agents for customer support

[Twilio](https://yomu.fyi/company/twilio) · Jesse Sumrak · Oct 29, 2026

**Type:** Tutorial

## Summary

Building a multilingual AI agent for customer support requires coordinating speech-to-text, the LLM, and text-to-speech so all three switch languages together, since callers may change languages mid-conversation. Twilio ConversationRelay handles speech-to-text and text-to-speech, with each element mapping a language code to its own transcription provider, voice, and speech model. Setting speech-to-text to multi with Deepgram tags each utterance with a primary language code, so the agent detects a switch and sends a WebSocket language message that changes languages without restarting the call. Prompt design keeps the LLM consistent, and Twilio Conversation Memory stores the customer’s language trait so the next call starts in the right language. Agent Connect extends the same agent across SMS, WhatsApp, RCS, and Chat, and passes the detected language as a TaskRouter attribute so Flex can hand off to a human who speaks it.

## Context

Callers often switch languages mid-conversation, and most voice agents keep answering in the original language, forcing callers to repeat themselves or ask for a human. Messaging is easier because modern LLMs read and write dozens of languages, but voice runs through speech-to-text, the LLM, and text-to-speech, and all three layers must switch together.

## Approach / What changed

Configure one element per supported language in Twilio ConversationRelay, mapping each language code to its own transcription provider, voice, and speech model. Set speech-to-text to multi with Deepgram so every utterance arrives tagged with a primary language code, and set text-to-speech to multi with ElevenLabs so the voice follows the reply. When the tag changes, send a WebSocket language message to switch speech-to-text and text-to-speech languages mid-call, keep the LLM consistent with prompt rules, store the language trait in Twilio Conversation Memory, and pass the detected language as a TaskRouter attribute for Flex handoff.

## Takeaways

- A voice agent’s speech-to-text, LLM, and text-to-speech layers must switch together: if speech-to-text keeps listening in English, the transcript it hands the LLM won’t work even when the LLM handles Spanish perfectly.
- ConversationRelay tags each transcribed utterance with a primary language code such as en or es, so the agent detects a mid-call switch on the next utterance and sends a WebSocket language message to change STT and TTS languages without restarting the call.
- Language preference persists across channels: Conversation Memory stores the language trait on the customer profile, and Agent Connect routes Voice, SMS, WhatsApp, RCS, and Chat through one handler, so a customer who texts in Portuguese on Monday is greeted in Portuguese on Thursday’s call.

## FAQ

### How does an AI voice agent detect which language a caller is speaking?

Twilio ConversationRelay uses the speech-to-text provider to identify the language of each utterance and tags every transcribed message with it. Your agent reads the tag and can switch languages as soon as the caller does.

### Can an AI agent switch languages in the middle of a phone call?

Yes. ConversationRelay lets your agent send a language message that changes the speech-to-text and text-to-speech languages mid-call without restarting the conversation, and the voice switches to the one configured for the new language.

### How do you route a multilingual customer to a human agent who speaks their language?

Agent Connect's handoff tool accepts routing attributes that surface as TaskRouter task attributes in Twilio Flex. Pass the detected language as an attribute, and Flex routes the conversation to an agent who speaks it, with the conversation history attached.

**Tags:** [Customer Support](https://yomu.fyi/topic/customer-support), [Multilingual](https://yomu.fyi/topic/multilingual), [Twilio](https://yomu.fyi/topic/twilio), [Voice AI](https://yomu.fyi/topic/voice-ai)

- Source: [Twilio](https://www.twilio.com/en-us/blog/insights/multilingual-ai-agents)
- Source URL: https://www.twilio.com/en-us/blog/insights/multilingual-ai-agents
- Ingested by Yomu: 2026-10-30T00:00:18.673Z

[Read original post](https://www.twilio.com/en-us/blog/insights/multilingual-ai-agents)
