Use Cases + Implementation

How do you build multilingual AI with AI agents?

Multilingual AI agents add three capabilities to the standard loop: detect the user's language, route to models that handle it well, and retrieve locale-specific content through tools. On Plugsky the loop runs on live function calling with 30+ models behind one endpoint, and plugsky-embed-multilingual keeps one vector space across languages so retrieval works even when questions and documents differ.

Key facts

Agent runtimeFunction calling loop on /v1/chat/completions (live)
Embeddingsplugsky-embed-multilingual via /v1/embeddings (live)
Language handlingDetect locale in code, pass it to tools as a filter
Models30+ models behind one endpoint, choose per language and task
ToolsLocale-aware search, translation and formatting tools
Structured outputJSON mode for responses with locale and source metadata
DeploymentRegion-locked planes, VPC, on-prem and air-gapped options
Free tierplugsky-micro and plugsky-lite on the free plan, no card required

TL;DR

  • Detect language deterministically in code; do not ask the model to guess.
  • Route by language and task — some models handle Arabic and other languages better.
  • Filter retrieval by locale so answers use the right regional content.
  • Keep one multilingual vector space instead of separate indexes per language.
  • Evaluate quality per language, not just on the aggregate.

How it works, step by step

  1. List the languages and locales you must support, and label real samples for each to use as evaluation data.
  2. Add deterministic language and locale detection before the agent loop, and pass results into tools as filters.
  3. Expose locale-aware tools: content search per locale, unit and date formatting, and translation when required.
  4. Implement the agent loop with output requirements that include the response language and source locale.
  5. Embed corpora with plugsky-embed-multilingual so documents in one language can be retrieved by questions in another.
  6. Score quality per language on a fixed question set, including code-switching and mixed-script inputs.
  7. Route each language and task to the model that scores best, and keep the routing table in configuration.
1List the languagesand locales youmust support, and2Add deterministiclanguage and localedetection before3Expose locale-awaretools: contentsearch per locale,4Implement the agentloop with outputrequirements that5Embed corpora withplugsky-embed-multilingualso documents in one6Score quality perlanguage on a fixedquestion set,

Original data

Function calliAgent runtimeplugsky-embed-Embeddings30+ models behModelsSource: Plugsky facts table · updated 2026-09-26

Try it yourself

Open the embedding model comparison →

Language detection and routing

Language handling starts outside the model. Deterministic detection is cheaper, faster and more predictable than asking a model to identify a language, and it gives your tools a reliable filter. Once the locale is known, the agent can retrieve locale-specific content, format dates and numbers correctly, and answer in the user's language.

Routing comes next. With 30+ models behind one OpenAI-compatible endpoint, you can assign models per language and task based on measured quality rather than assumption. The agent loop itself is unchanged: live function calling on /v1/chat/completions, tools for retrieval and formatting, structured output for the final response.

Tools and locale-aware retrieval

Multilingual retrieval works best with one shared vector space. plugsky-embed-multilingual embeds several languages so a question in one language can match documents in another — a natural fit for GCC deployments where policies, manuals and support content mix Arabic and English.

  • Locale filters: prefer content in the user's locale and fall back explicitly when it is missing.
  • Script handling: normalise Arabic diacritics and mixed Latin/Arabic input before embedding.
  • Formatting tools: dates, currency and numerals belong in code, not in prompts.
  • Glossaries: keep approved terminology per language and pass it into the prompt for consistency.

Quality assurance across languages

Aggregate scores hide language-specific problems. Evaluate each language separately with native reviewers, covering intent recognition, retrieval accuracy, terminology and tone. Include code-switching inputs, since real users mix languages mid-sentence more often than test suites assume.

Track per-language metrics and route accordingly: if one model leads on Arabic and another on English, let the routing table reflect that. Keep prompts and glossaries versioned per language so improvements in one do not regress another. For regulated deployments, the same agent runs in a region-locked plane or on-prem with Plugsky deployments, keeping content within the market it serves.

Honest comparison

ConcernPlugsky multilingual agentEnglish-only agentSeparate bots per language
RetrievalOne multilingual vector spaceEnglish corpus onlyDuplicated indexes
Model choice30+ models, route per languageOne modelOften inconsistent
Locale handlingFilters and formatting toolsManualPer-bot logic
EvaluationPer-language scoringAggregate onlyFragmented
DeploymentRegion-locked planes, VPC, on-prem, air-gappedSingle regionMultiple deployments

Frequently asked questions

Can one agent handle both Arabic and English?

Yes. Detect the language in code, filter retrieval by locale, and use plugsky-embed-multilingual so a question in either language can retrieve content from both.

How do we choose a model per language?

Measure. Run the same evaluation set per language across candidate models and record scores, then encode the winners in a routing table. 30+ models share one endpoint, so switching is configuration.

Should we translate queries into English first?

Sometimes, as a fallback for thin locales. But with multilingual embeddings, direct cross-language retrieval is usually better and preserves nuance.

How do we handle mixed-language input?

Detect the dominant language, keep the original text for retrieval, and instruct the agent to answer in the dominant language. Normalise scripts before embedding.

What about right-to-left formatting?

Formatting belongs in your UI and tools, not the model. Return structured content and let the interface apply direction and typography rules per locale.

How should we evaluate quality?

Score each language separately with native reviewers, covering intent, retrieval, terminology and tone, and include code-switched inputs in the test set.

Can agents run in-region?

Yes. Plugsky supports region-locked cloud planes plus VPC, on-prem and air-gapped deployment, so content can stay in the market it serves.