Creating multilingual ChatBot

Hey All,

I have tried to create a multilingual chatbot using N8n. Tried several models (OpenAI, Gemini 2.5 and Deepseek r1), but the output wasn’t perfect as expected. How can I create a multilingual chatbot? Should I use a specific model or a separate dictionary, or should I use something like translation api (Google,AWS or Azure)

Thanks,
Keshan

I think it does very much depend on the model and the system prompt. This is my test with gemma3

Hmm you could add a switch node to use as a system prompt expression depending on the language someone chooses and instruct the LLM to continue from that point onwards in said language?

Try the following: 1. Incoming Message Flow:

  1. Incoming Message Flow: Trigger Node: Start with a Webhook or Chat Trigger node to capture user input.
    Detect Language: Use a language detection API (e.g., Google Cloud Translation, LibreTranslate, or AWS Comprehend) to detect the user’s language.
  2. Translation Layer (If Needed):
    Translate to English: Use a translation API (Google, Azure, or AWS) to convert the message into English (if it’s not already).
    Route to LLM: Send the translated text to the LLM (OpenAI GPT -4 or Gemini 1.5 Flash) for a balance between quality and latency.
  3. AI Processing: Use n8n’s AI Agent node or HTTP Request node with the desired model.
    For context-aware responses, use memory tools such as vector search or a context buffer (MemoryBufferWindow node).
    Structure prompts carefully, e.g.:
    System: You are a multilingual assistant.
    User Input: ${translated_input}
    Task: Provide a helpful response.
  4. Translate Output (If Needed): If the original user language isn’t English, translate the LLM’s response back using the exact translation API.
  5. Send Response: Output the translated response to the user via Telegram, Discord, webchat, etc.

It is, but the issue is language is not casual at all

It will work but the number of requests is too high and the imaging scaling up this will be hard, Is’t it