Skip to main content
Multilingual agents can handle conversations in multiple languages. This page covers how to maintain language-specific content, voices, and configurations as your agent evolves.

Quick reference

I need to…ActionTime estimate
Add a new languageSettings → Multilingual → Add language10 min
Update language-specific knowledgeEdit topics with language variants5-10 min
Change voice for a languageSettings → Voice → Select per language5 min
Fix translation issuesEdit language-specific responses5 min
Test language switchingAgent Chat → Switch language mid-call3 min
Update language detectionSettings → Multilingual → Configure detection5 min
Add language-specific functionsFunctions → Add language parameter10 min

Understanding multilingual agents

How multilingual agents work

Multilingual agents can:
  • Detect the caller’s language automatically
  • Switch languages mid-conversation if the caller changes
  • Maintain language-specific knowledge for each language
  • Use appropriate voices per language
  • Handle mixed-language queries (code-switching)

Supported languages

PolyAI supports 30+ languages including:
  • English (en)
  • Spanish (es)
  • French (fr)
  • German (de)
  • Italian (it)
  • Portuguese (pt)
  • Dutch (nl)
  • Polish (pl)
  • Russian (ru)
  • Japanese (ja)
  • Korean (ko)
  • Chinese Mandarin (zh)
  • Arabic (ar)
  • Hindi (hi)
  • And many more
Check the multilingual settings documentation for the complete list.

Adding or removing languages

Adding a new language

  1. Go to SettingsMultilingual
  2. Click Add language
  3. Select the language from the dropdown
  4. Configure language-specific settings:
    • Voice selection
    • Language detection sensitivity
    • Fallback behavior
  5. Save your changes
  6. Add language-specific knowledge (see below)
  7. Test in Agent Chat
  8. Publish when ready
Use a multilingual_v2 voice model to ensure proper pronunciation across all languages.

Removing a language

  1. Go to SettingsMultilingual
  2. Find the language to remove
  3. Click Remove or Disable
  4. Confirm the action
  5. Publish the change
Removing a language will cause the agent to fall back to the default language for callers speaking that language.

Managing language-specific knowledge

Managed Topics with language variants

To provide different content per language:
  1. Go to Managed Topics
  2. Create or edit a topic
  3. Add language variants for each supported language
  4. Provide translations or culturally-appropriate content
  5. Save and test
Example: English (en):
  • Question: “What are your hours?”
  • Answer: “We’re open Monday through Friday, 9 AM to 5 PM.”
Spanish (es):
  • Question: “¿Cuál es su horario?”
  • Answer: “Estamos abiertos de lunes a viernes, de 9 AM a 5 PM.”
French (fr):
  • Question: “Quelles sont vos heures d’ouverture?”
  • Answer: “Nous sommes ouverts du lundi au vendredi, de 9h à 17h.”

Connected Knowledge per language

For Connected Knowledge sources:
  • URL sources - Add separate URLs for each language version of your website
  • File sources - Upload language-specific PDFs or documents
  • Integration sources - Configure APIs to return language-specific data
Example setup:
  • English: https://example.com/en/faq
  • Spanish: https://example.com/es/preguntas-frecuentes
  • French: https://example.com/fr/faq

When to use shared vs. language-specific knowledge

Use shared knowledge when…Use language-specific knowledge when…
Information is universal (phone numbers, addresses)Content needs translation
Data is language-agnostic (product IDs, prices)Cultural context matters (holidays, customs)
You want consistency across languagesLocal regulations differ by region
Maintaining multiple versions is impracticalUser expectations vary by language

Updating voices for each language

Selecting language-appropriate voices

  1. Go to SettingsVoice
  2. Configure voices per language:
    • English - Choose an English-native voice
    • Spanish - Choose a Spanish-native voice
    • French - Choose a French-native voice
  3. Preview each voice
  4. Save your selections

Voice quality considerations

  • Use native voices - Don’t use an English voice for Spanish
  • Match regional accents - Use Mexican Spanish for Mexico, Castilian for Spain
  • Test pronunciation - Ensure the voice handles language-specific characters
  • Consider gender and tone - Match your brand across languages

Multilingual voice models

Some TTS providers offer multilingual models that can speak multiple languages:
from poly import ElevenLabsVoice

voice = ElevenLabsVoice(
    provider_voice_id="multilingual_voice_id",
    model="eleven_multilingual_v2"  # Supports 30+ languages
)
Multilingual models are convenient but may have slightly lower quality than language-specific models.

Handling language detection

Automatic language detection

By default, agents detect the caller’s language automatically:
  1. The caller speaks
  2. ASR (Automatic Speech Recognition) identifies the language
  3. The agent responds in the detected language

Configuring detection sensitivity

Adjust how aggressively the agent switches languages:
  1. Go to SettingsMultilingual
  2. Adjust Language detection sensitivity:
    • High - Switches quickly, may over-switch
    • Medium - Balanced (recommended)
    • Low - Switches reluctantly, may miss switches
  3. Test with mixed-language scenarios

Explicit language selection

Allow callers to choose their language explicitly:
  1. Create a Managed Topic for language selection
  2. Add options like “Press 1 for English, 2 for Spanish”
  3. Use a function to set the language:
def set_language(language_code):
    conv.set_language(language_code)
    return {"utterance": f"Switching to {language_code}."}

Handling code-switching

Code-switching is when callers mix languages in a single conversation:
  • Example: “I need to hacer una reservación for mañana.”
To handle this:
  • Enable flexible language detection
  • Use multilingual voice models
  • Test with realistic mixed-language scenarios
  • Consider your target audience’s code-switching patterns

Fixing translation issues

Common translation problems

IssueLikely causeSolution
Awkward phrasingDirect translation, not localizationRewrite for natural language
Cultural mismatchesLiteral translation of idiomsUse culturally-appropriate equivalents
Incorrect terminologyGeneric translationUse domain-specific terms
Formatting issuesDate/time/number formats differLocalize formats per language
Missing contextTranslation without understandingProvide context to translators

Updating translations

To fix a translation issue:
  1. Identify the problematic response in Conversation Review
  2. Find the corresponding Managed Topic or function
  3. Edit the language-specific variant
  4. Test in Agent Chat with native speakers
  5. Publish when satisfied

Using professional translators

For high-quality translations:
  • Export knowledge - Download Managed Topics as CSV
  • Send to translators - Provide context and domain glossary
  • Import translations - Upload the translated CSV
  • Review and test - Verify quality before publishing

Language-specific functions

Adding language parameters to functions

Functions can behave differently per language:
def get_store_hours(location, language="en"):
    # Fetch hours from API
    hours = api.get_hours(location)
    
    # Format response based on language
    if language == "es":
        return {"utterance": f"Estamos abiertos de {hours['open']} a {hours['close']}."}
    elif language == "fr":
        return {"utterance": f"Nous sommes ouverts de {hours['open']} à {hours['close']}."}
    else:
        return {"utterance": f"We're open from {hours['open']} to {hours['close']}."}

Accessing the current language

Get the caller’s language in functions:
def dynamic_response():
    current_language = conv.language
    conv.log.info(f"Caller language: {current_language}")
    
    # Use language-specific logic
    if current_language == "es":
        return {"utterance": "Respuesta en español"}
    else:
        return {"utterance": "Response in English"}

Language-specific API calls

Some APIs require language parameters:
def search_products(query):
    language = conv.language
    
    # Call API with language parameter
    results = requests.get(
        "https://api.example.com/search",
        params={"q": query, "lang": language}
    )
    
    return {"utterance": format_results(results, language)}

Testing multilingual agents

Test in Agent Chat

  1. Open Agent Chat
  2. Select a language from the dropdown
  3. Speak or type in that language
  4. Verify the agent responds correctly
  5. Try switching languages mid-conversation

Test language detection

  1. Start a conversation in one language
  2. Switch to another language mid-call
  3. Verify the agent detects and switches
  4. Check for false positives (switching when it shouldn’t)

Test with native speakers

  • Recruit testers - Find native speakers of each language
  • Provide scenarios - Give realistic test cases
  • Gather feedback - Ask about naturalness, accuracy, and cultural appropriateness
  • Iterate - Refine based on feedback

Common test scenarios

  • Language switching - Start in English, switch to Spanish
  • Mixed queries - Ask questions with code-switching
  • Accents and dialects - Test regional variations
  • Background noise - Verify ASR works in noisy environments
  • Edge cases - Test with uncommon words or phrases

Troubleshooting multilingual issues

Common issues and solutions

IssueLikely causeSolution
Agent doesn’t detect languageASR not configured for languageVerify language is enabled in settings
Agent switches languages incorrectlyDetection sensitivity too highLower sensitivity in settings
Voice sounds unnaturalWrong voice model for languageUse language-native voice
Translations are awkwardDirect translationRewrite for natural language
Knowledge not available in languageMissing language variantsAdd language-specific content
Function responses in wrong languageFunction doesn’t check languageAdd language parameter to function
ASR accuracy is lowAccent or dialect not supportedTest with different voice models

Debugging language issues

  1. Check Conversation Review - See which language was detected
  2. Review Diagnosis logs - Look for language-related errors
  3. Test in Agent Chat - Reproduce the issue
  4. Verify settings - Ensure language is properly configured
  5. Check knowledge coverage - Confirm content exists for that language

Best practices

Content management

  • Maintain parity - Ensure all languages have equivalent content
  • Localize, don’t just translate - Adapt for cultural context
  • Use consistent terminology - Create a glossary for domain terms
  • Update all languages together - Don’t let translations lag behind

Voice and audio

  • Use native voices - Never use a non-native voice for a language
  • Match regional preferences - Consider accent and dialect
  • Test pronunciation - Verify proper handling of special characters
  • Adjust speech rate - Some languages sound better at different speeds

Testing and quality

  • Test with native speakers - Don’t rely on non-native testers
  • Monitor language distribution - Track which languages are used most
  • Review low-confidence calls - Identify language detection issues
  • A/B test translations - Try different phrasings to find what works best

Maintenance routine

  • Monthly language audit - Review content parity across languages
  • Quarterly voice review - Ensure voices still sound natural
  • Regular translation updates - Keep content current in all languages
  • Monitor language-specific metrics - Track performance per language

Common workflows

Adding a new language to an existing agent

  1. Enable the language in Settings → Multilingual
  2. Select an appropriate voice for the language
  3. Export existing Managed Topics
  4. Translate content (use professional translators)
  5. Import translated content
  6. Add language-specific Connected Knowledge sources
  7. Update functions to handle the new language
  8. Test thoroughly with native speakers
  9. Publish to Sandbox
  10. Run Test Sets for the new language
  11. Promote to Pre-release for UAT
  12. Promote to Live

Updating translations across all languages

  1. Identify the content to update (e.g., new business hours)
  2. Update the default language version
  3. Export Managed Topics
  4. Send to translators with context
  5. Import translated updates
  6. Test each language in Agent Chat
  7. Publish and promote

Fixing a language detection issue

  1. Review calls where language switching was incorrect
  2. Check Diagnosis logs for language detection events
  3. Adjust detection sensitivity in Settings
  4. Test with the problematic scenario
  5. If needed, add explicit language selection option
  6. Publish and monitor

Optimizing for a specific language

  1. Review analytics for that language
  2. Identify common queries and issues
  3. Add language-specific knowledge
  4. Adjust voice settings (rate, pitch)
  5. Test with native speakers
  6. Iterate based on feedback