---
title: "Versions"
description: "Publish versions of an AI agent in the console, API, or MCP, manage and restore them, and assign a version with a rule."
---

# Versions

> Publish versions of an AI agent in the console, API, or MCP, manage and restore them, and assign a version with a rule.

Moveo allows you to create multiple versions of the same AI agent.

Imagine you are operating an AI agent in production, with users asking questions throughout the day.
If you want to implement new changes without making them visible to your users immediately, you can
use versions.

## Draft state

All changes you make are saved to the **draft** state of the AI agent. In [Test](https://docs.moveo.ai/docs/ai-agents/test.md), you
always interact with the draft version of the AI agent. It works as one more version of the AI
agent, with the difference that already published versions are locked and not editable.
This means that you can also assign a conversation to a draft version if you set a
[rule](https://docs.moveo.ai/docs/environments/environments-rules.md) to do so.

## Create a new version

To create a new version:

1. Go to the AI agent you want to create a new version of.
2. Click the **Publish** button in the top right corner of the screen.
3. Write a short description of your changes.
4. Click the **Publish** button in the dialog.

**Console**

Select **Publish** in the header of the AI agent. The **Publish a new version** dialog opens. Enter a
**Description** and select the publish button. The button shows the number of the new version, for
example **Publish v3**. Moveo assigns the version number. You can also assign the new version to rules in the same dialog.

**API**

Send `POST /v1/brains/{brain_id}/publish` with a `manage` API key. See
[the API reference](/api/rest/publish-brain-version).

| Field              | Type    | Description                                                                 |
| ------------------ | ------- | --------------------------------------------------------------------------- |
| `description`      | string  | Required. A short description of the changes.                               |
| `replace_version`  | integer | The version to delete after the publish, when the account is at its version limit. |
| `replace_rule_ids` | array   | The rules that move to the new version. If you omit it, every rule that uses this AI agent moves to the new version. |
| `force`            | boolean | Delete the `replace_version` version even if it has active sessions. Moveo closes those sessions. Default `false`. |

**MCP**

`moveo_publish_agent` with `agent_id`, `description`, and the optional `replace_version` and
`force`. The tool does not send `replace_rule_ids`, so every rule that uses the AI agent moves to
the new version. To go back to an older version, use `moveo_rollback_agent_to_version`. The console calls
this action **Restore**.

:::warning

The number of versions you can keep depends on your plan. When you reach the limit, select an
older version to replace when you publish a new one.

:::

### Publish fails because the AI agent cannot answer messages

After Moveo trains the new version, it checks that the version can answer messages. These problems make
the check fail:

- No intent has example phrases.
- The AI agent has no dialog, no webhook and no MCP server.

If the check fails, Moveo removes the new version and does not change your rules. The console shows
this error message:

> The agent cannot answer messages. It needs at least one intent with example phrases, and at least
> one dialog, webhook or MCP server. Add them, then publish again.

The API returns the same message with status `400` and the code `brain_not_servable`. To fix the
problem, add the missing items to the draft and publish again. If you train again without changes,
the problem stays.

## Manage a version

For any version of the AI agent, you can perform the following operations in the **Versions** menu:

1. **Restore**: Revert the AI agent to the selected version.
2. **Export**: Download a JSON file of the selected version.
3. **Delete**: Permanently delete the selected version.

## Assign the new version

After you create a new version and are ready to share it with your users, navigate to the
[**rules**](https://docs.moveo.ai/docs/environments/environments-rules.md) and set in the **then** section the new version of the AI agent.

## Next steps

- [Environments](https://docs.moveo.ai/docs/environments/environments-overview.md)
- [Publish agents to production](https://docs.moveo.ai/docs/guides/guides-deploy-overview.md)
- [Rules](https://docs.moveo.ai/docs/environments/environments-rules.md)
