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

# How to manage agent versions

Every change to your agent's prompt should be tracked as a version. Versions let you test new prompts safely and roll back instantly if something breaks.

In the sidebar, go to Agent > General and click the Versions tab.

## How versions work

Your agent always has one Current version: the one running in production. When you want to make changes, you create a Draft. The Draft lets you edit, test in the Playground, and activate only when you're confident it works.

| Status            | What it means                                         |
| ----------------- | ----------------------------------------------------- |
| Current           | Live in production, leads are talking to this version |
| Draft             | Work in progress, not yet live                        |
| Previous versions | Historical snapshots in the version list              |

## How to create a new version

1. In the Versions tab, click Create Draft.
2. Go to the Goals & Tone tab and make your changes.
3. Click Save.
4. Test in Agent > Playground: send messages to confirm the new behavior works as expected.
5. When ready, click Activate version on the Draft to make it the Current version.

{% hint style="warning" %}
A Draft is not live until you activate it. Your agent continues running on the Current version while you work on the Draft. Don't skip testing before activating. Once a Draft is activated, it immediately replaces the Current version in production.
{% endhint %}

## How to roll back to a previous version

If a new version causes problems such as lower qualification rate, unexpected responses, or leads dropping off, you can reactivate any previous version instantly.

1. Go to Agent > General > Versions.
2. Find the version you want to restore in the Version History list.
3. Hover over the version card: the Activate version button appears.
4. Click Activate version.

The selected version immediately becomes Current and your agent starts running it in production.

## How to add a description to a version

Every version has a + Add description button. Use it to note what changed. For example: 'Tightened budget threshold to $10K minimum' or 'Added disqualification path for out-of-scope questions'. Descriptions make it much easier to find the right version when you need to roll back.

## Best practices

* Always create a Draft before making major prompt changes. Never edit without a safety net.
* Add a description to every version before activating it. You'll thank yourself when you need to roll back weeks later.
* Test in Playground before activating: a Draft in Playground uses the Draft configuration, not the Current one.
* Change one thing per version: if you change multiple things in the same Draft, you won't know which change caused a drop in performance.


---

# 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.patagon.ai/en/agent-optimization/agent-versions.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.
