AI agent routing
Rules can perform actions after the conversation starts. This guide reassigns the conversation to a different AI agent with rules and tags in a dialog.
The plan
This example continues with the agent created in Build your first AI agent. In this example, a gym's Upsell Agent handles membership payments. When the user wants to change their membership plan, a rule assigns the conversation to a different AI agent, the Change plan Agent. This AI agent is of the Customer Support type.
To do this, create a dialog in Agent 1 that triggers when the user asks to change their membership plan. This dialog uses a tag that the rule evaluates. The rule then assigns the conversation to the Change plan Agent.
To create an AI agent from scratch, see Build your first AI agent.
Create the dialog
A dialog is a set of messages that the AI agent sends to the user. In this case, create a dialog in the Upsell Agent that triggers from an intent matching when the user asks to change their membership plan.
Intent
- Go to AI Agents.
- Select the Upsell Agent.
- Go to Workflows > Intents.
- Select Create intent.
- Name the intent Change plan.
- Add examples of what the user says when they want to change their membership plan. For
example:
- I want to change my membership plan.
- Can I change my membership plan?
- How can I change my membership plan?
- Select Save.
Dialog
The key point of this dialog is the replay action. This action triggers a message on the user's behalf. The user does not see this message, but the rule evaluates it and the logs show it.
- Go to Workflows > Dialogs.
- Select Create dialog.
- Name the dialog Change plan.
- Drag the Intent action from the right sidebar to the canvas.
- Select the Change plan intent in the dropdown list.
- Add a text response message to the dialog. For example:
- Sure, I can help you with that. Let me assign you to our Customer Support Agent.
- Add a tag to the dialog. The rule evaluates this tag. For example:
change_plan. - Finally, add a replay action to the dialog.
Create the rules
With the dialog ready, you need a way to connect the AI agent to the user. First, create a rule that assigns the conversation to the Upsell Agent. This rule triggers
when the user starts a conversation. Then, create a second rule that assigns the
conversation to the Change plan Agent when it evaluates the tag change_plan.
You cannot test this routing with the AI agent test feature, because that feature tests the AI agent only, not rules. Test the routing in a real conversation.
Assign to Upsell Agent
- Go to Deploy > Rules.
- Select Create. The Create rule panel opens next to the rule list.
- Enter a Name and select Continue.
- Set the Trigger field to Customer starts conversation.
- Set the Actions field to Assign AI agent and select the Upsell Agent.
- Select Done. Moveo creates the rule as active.

Assign to Change plan Agent
Follow the same steps as the previous rule, with these changes:
- Set the Trigger field to AI agent has replied. The AI agent adds the tag while it replies, so a rule that runs before the reply cannot see the tag.
- Set the Conditions (optional) field to Tag is change_plan.
- Set the Actions field to Assign AI agent and select the Change plan Agent.
