> For the complete documentation index, see [llms.txt](https://docs.athenachat.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.athenachat.ai/documentation/documentation-en/features/multi-agent.md).

# Multi-agent

Multiple AI agents in one channel — switching by triggers

Multi-agent architecture is a technology that makes it possible to combine several highly specialized AI agents within a single communication channel. The system automatically transfers the conversation from one agent to another depending on the client's request, whether it is sales, technical support, or booking a service.

## How it works:

Switching between agents is based on triggers (task completion, event triggers, stop words). Athena analyzes the context of the conversation or the presence of keywords and instantly changes the behavior scenario.

### For example:

* If a client expresses dissatisfaction, an objection-handling agent is brought in.
* If the client names a specific city, the conversation is transferred to the agent responsible for local sales in that region.

By default, communication always starts with the Main bot (Main agent), which acts as a dispatcher and routes requests further.

## Setup instructions:

To implement a multi-agent scheme, follow these steps:

### 1. Preparing agents

Create and configure several AI agents. Each of them should have its own unique scenario (prompt) and knowledge base. For example: “Sales bot,” “Support bot,” “Complaint-handling bot.”

![](https://4126380821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwirYrs8odJMFan3KqfzY%2Fuploads%2FriRJ9gkv1tcLsSEAUlJo%2Fmultiagents-01.webp?alt=media)

### 2. Configuring switching triggers

Go to the trigger management section (as shown in the screenshot):

![](https://4126380821-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwirYrs8odJMFan3KqfzY%2Fuploads%2Fc6WNmSa85Y7y3SbquEaV%2Fmultiagents-02.webp?alt=media)

* Set events, keywords, or a task: In the “Stop words/keywords list” field, enter phrases that should activate an agent switch (for example, the city name “Ozerki” or the word “Complaint”); in the event list, specify the conditions under which the trigger will fire and the conversation will be passed to another agent (for example, obtaining the client’s phone number).
* Enable switching: Check the box next to the “Change AI agent” function.
* Select the target agent: In the drop-down list, specify which agent Athena should pass control of the conversation to after the trigger fires.

### 3. Testing the logic

After saving the settings, Athena will begin to automatically “jump” between scenarios. As soon as a trigger fires, the current agent will instantly уступает place to the new one, which already has instructions for continuing the conversation.

## Benefits for your business

* Seamless customer experience: The user does not notice the switch, receiving the most expert answer possible.
* Automation of complex processes: You do not need to create one huge and complex scenario — it is easier to set up several effective micro-agents.
* Processing accuracy: Each agent is focused on its own task, which eliminates errors in consultations.

If you have any questions about setting up complex trigger chains, please contact our support team.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.athenachat.ai/documentation/documentation-en/features/multi-agent.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
