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

# Interactive Agents

An **Interactive Agent** is an AI agent that runs inside the platform, built from the project's context, tools, and chosen models. It works in one of two modes:

* **Conversational**: it holds a conversation with a customer and replies to each message.
* **Autonomous**: an event or webhook triggers it with structured input, and it returns a structured result, with no conversation involved.

The best way to create one is to ask the **Copilot**. Describe what the agent should do, and the Copilot works out the requirements with you, drafts the configuration and any context it needs, and deploys it once you approve.

Every agent in the project is listed in **All Agents**. Select one to open its [Agent View](https://docs.interactive.ai/interactive-agents/agent-view-1.md), where you can monitor, edit, and test it.

{% hint style="info" %}
For the complete reference on agents, see the [Agents documentation](https://docs.interactive.ai/interactive-agents/interactive-agents.md).
{% endhint %}

### How an Interactive Agent works

A **turn** starts when the agent receives a message or a trigger, and ends when it replies or returns its result. On every turn, the agent:

1. **Checks what's available.** Some policies and routines stay locked until a prerequisite is met, such as a successful identity check.
2. **Matches policies** against the conversation. The actions of every matched policy become binding for that turn.
3. **Advances routines** whose conditions match. More than one routine can be active at the same time.
4. **Resolves conflicts.** Priorities decide between competing policies, and entailments bring in policies that must apply together.
5. **Calls tools**, but only those a matched policy lists or the current routine step asks for. A failed tool call is recorded and handled; it doesn't fail the turn.
6. **Writes the reply** once, combining the system prompt, the matched policies, the active routine steps, glossary terms, retrieved knowledge, and the conversation history.

Knowledge retrieval runs automatically on every turn. The agent doesn't decide whether to search.

### Versions and revisions

**Versions** and **revisions** both track change, but they answer different questions:

|                  | Version                                                  | Revision                                        |
| ---------------- | -------------------------------------------------------- | ----------------------------------------------- |
| **What it is**   | A label you choose for something you publish             | A record of a deployed agent configuration      |
| **Applies to**   | Content, such as a policy or routine, and agent releases | Agents only                                     |
| **Created when** | You publish new content or a new release                 | The agent is updated and redeployed             |
| **Answers**      | *What* is being used?                                    | *What changed* in the deployed agent, and when? |

In short: versions identify what you publish or pin, and revisions track changes to the deployed agent.

An agent **pins** the exact version of each piece of content it uses. Publishing a new version on its own doesn't change the agent. The agent has to pin the new version and be redeployed, which creates a new revision.

This makes three things possible:

* **Rolling back.** If a change goes wrong, return the agent to an earlier revision.
* **Comparing.** See exactly what changed between two revisions, down to which version of each piece of content they pin.
* **Testing before release.** Pin the new versions on a test copy of the agent, such as `agent-chat-dev`, first. Pin them on the live agent and redeploy once they've been validated.

Change agents and their content through new versions and redeploys, not by deleting and recreating them. The agent holds the live endpoint, credentials, and conversation history that customers depend on, and its content holds business logic that took time to write and test.

***

### Ask the Copilot

| Example request                                             | What the Copilot does                                                                       |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| "Help me build an agent that handles refund requests."      | Gathers requirements, drafts the agent and its context, and deploys it after your approval. |
| "Why did agent-chat hand this conversation off?"            | Reads the trace and explains which policy or routine step led to it.                        |
| "What changed between the last two revisions of agent-kyc?" | Compares the revisions and lists the differences.                                           |
| "Roll back agent-email to the previous revision."           | Prepares the rollback and waits for your approval.                                          |
| "Which agents still use version 1 of the handoff policy?"   | Lists the agents and the versions they use.                                                 |


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.interactive.ai/interactive-agents/interactive-agents.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
