Skip to main content

Hi everyone,

I’m setting up an Instagram FAQ with AI, and I need it to respond in two languages: Czech and English.

I’m currently saving the user’s language preference in a custom field called user_language, which I determine through a language selection flow via the Instagram Menu and Default Reply.

Right after the trigger, I’ve added a Condition that splits the flow into a CZ or EN version based on the user_language field.

However, my question is:
How does the FAQ with AI know which language to respond in?
Should I add an AI Step at the beginning to detect the user’s language, before entering the FAQ flow?

 

 

I’d really appreciate any tips or best practices on how to handle this properly.

Thanks in advance!
Štefan

Hi ​@U Prince ,

There are a few different approaches you can take. I’ll describe some of them so you can decide which one works best for your case.

Since it's not possible to automatically detect the user's language, here are two main solutions you can try:

1. Use the prompt to instruct the AI to reply in the user's language  
This is the simplest approach. You can add a note in the AI prompt asking it to respond in the same language the user writes in.  
This way, you don’t need to store the user's language — just guide the AI properly.  
However, make sure to test this thoroughly. AI usually performs better when the conversation happens in the same language the prompt was written in. But it's worth testing, as it might work well in your scenario.

2. Detect and store the user's language  
If the first method doesn’t work reliably, you’ll need to detect the user’s language and store it in a variable (for example, user_language). Then, based on that variable, you can direct the user to the correct language-specific flow.

Here are two ways to detect the language:

Option 1: Ask the user directly  
Send a message asking the user which language they prefer, and provide two buttons: one labeled in Czech (CZ) and the other in English (EN).  
You can store the selected option in the user_language variable.

Option 2: Use AI to detect the language  
Add a step with OpenAI integration using a prompt like:  
"Your only task is to identify the user's language. Reply only with CZ or EN."  
The input can be the user’s latest message. Store the AI's output (CZ or EN) in the user_language variable.

Once the variable is filled, create a condition block like this:

- If user_language = CZ → go to the Czech AI step  
- If user_language = EN → go to the English AI step


Reply