---
title: "Different language, different AI agent"
description: "Collect the language of a web visitor before the chat starts and use rules to assign an English or a Greek AI agent."
---

# Different language, different AI agent

> Collect the language of a web visitor before the chat starts and use rules to assign an English or a Greek AI agent.

This example uses the [Web channel](https://docs.moveo.ai/docs/integrations/web/web-getting-started.md) to collect
the user's language preference and assign an [AI agent](https://docs.moveo.ai/docs/ai-agents/overview.md) based on their
selection. Other integrations can get the language from the user's configuration settings.

## Set up the form

First, collect the user's language preference. Set up a form that asks the user to choose their
language before the conversation starts. This example uses two AI agents: one for **English** and
another for **Greek**.

1. Go to **Deploy → Connections**.
2. Select the **Webchat** integration.
3. Go to the **Visitor information** section.
4. Turn on **Collect data before the chat starts**.
5. Select **Add field** and select **Language** from the dropdown.
6. Add **English** and **Greek** as available language options.
7. Save your changes.

## Assign the AI agents

[Rules](https://docs.moveo.ai/docs/environments/environments-rules.md) automate actions in conversations based on predefined conditions.
This section creates a rule that assigns the correct AI agent based on the user's selected
language.

### Greek language rule

1. Go to **Deploy → Rules**.
2. Select **Create**. The **Create rule** panel opens next to the rule list.
3. Enter a **Name** and select **Continue**.
4. Set the **Trigger** field to **Customer starts conversation**.
5. Set the **Conditions (optional)** field to **Language** is **Greek**.
6. Set the **Actions** field to **Assign AI agent**, then select the **Greek** AI agent.
7. Select **Done**. Moveo creates the rule as active.

### English language rule

Follow the same steps as the Greek rule, but:

- Set the **Conditions (optional)** field to **Language** is **English**.
- Set the **Actions** field to **Assign AI agent**, then select the **English** AI agent.

:::note
For the English rule, you can add another condition: the language is not Greek. Then
conversations from users with other language settings, such as Spanish on Viber, go to the English
AI agent by default.
:::

## Next steps

- [Rules](https://docs.moveo.ai/docs/environments/environments-rules.md)
- [AI agent routing](https://docs.moveo.ai/docs/environments/environments-rules-route-agent.md)
- [Context and variables](https://docs.moveo.ai/docs/ai-agents/context.md)
