# Agent versions
Source: https://sovaria.in/docs/agent-versions

Publish an agent, keep editing safely, compare what changed, and roll back in one click.

Editing an [agent](https://sovaria.in/docs/agents) changes its **draft** — what you test in the console. **Publishing** freezes the draft as the next version number; from then on your app's users (and API callers) run the published version, so a half-finished edit never reaches them. Ongoing conversations switch to the newly published version on their next message.

- **Compare** a version with the draft (or two versions): changed settings, tools and knowledge bases added or removed, the model or route, and a line-by-line diff of the instructions.
- **Roll back** publishes an older version again as a new version number (history only grows) and makes it the draft too.
- Agents never published run their draft, as before.
- Your plan keeps the newest versions (oldest go first); the published version is always kept.

CLI:
```bash
sov agents publish $AGENT -m "shorter answers, cites sources"
sov agents compare $AGENT 3          # v3 vs the draft
sov agents rollback $AGENT 2
```

HTTP:
```bash
curl -s -X POST $URL/api/v1/sovariq/agents/$AGENT/versions -d '{"note":"shorter answers"}' …
curl -s "$URL/api/v1/sovariq/agents/$AGENT/versions/compare?a=3&b=draft" …
curl -s -X POST $URL/api/v1/sovariq/agents/$AGENT/versions/2/rollback -d '{}' …
```

|  | Free | Pro | Ultra | Team | Enterprise |
|---|---|---|---|---|---|
| Project agents | 1 | 1 | 5 | 20 | 100 |
| Published versions kept per project agent | 3 | 20 | 50 | 100 | 500 |
