GuidesRAG

A multilingual RAG chatbot: one knowledge base, every language

By the Banzai Labs teamUpdated on 2 min read

FRDélai de retour ?ENReturn window?ES¿Plazo de devolución?EmbeddingsmultilingualFRAnswers inthe user’s languageOne document base, every language your customers speak
Questions in three languages find the same document and get an answer in their own language.

The principle

  1. 1QuestionIn any language.
  2. 2Multilingual vectorThe same idea lands in the same place, whatever the language.
  3. 3Passages foundIn the language of the documents.
  4. 4AnswerWritten in the language of the question.

Choices to make

Choice Recommendation
Embedding model Multilingual, tested on your languages
Documents One source language, translated only when needed
language metadata On each chunk, to filter when needed
Answer language That of the user’s last message

The instruction

Answer in the language of the user's last message.
Rely only on the excerpts provided, even if they are in another language.
If the information isn't there, say so and offer the support contact.

The traps

  • Proper names and product references: keep them as they are, don’t translate them.
  • Units and formats (dates, prices): adapt them to the customer’s country.
  • Testing: a set of questions per language, not only in the source language.

Chunking: chunking documents for RAG. Vectors: embeddings explained. Multilingual search: multilingual SEO.

Frequently asked questions

Do I need to translate all the documents?
Not for search if the embedding model is multilingual. Translation is still useful for legal documents or when you want to quote exact text in the customer's language.
How does the model know which language to answer in?
A simple instruction in the system prompt: answer in the language of the user's last message. You can also detect the language and pass it explicitly.
Do all languages work equally well?
No. The most widely spoken languages are better served. Test each target language with real questions.

Read next

All guides