Agent versioning

Safely experiment with agent configurations using branches, versions, and traffic deployment

Agent versioning allows you to experiment with different configurations of your agent without risking your production setup. Create isolated branches, test changes, and gradually roll out updates using traffic percentage deployment.

Overview

The versioning system provides:

  • Immutable snapshots of your agent configuration at any point in time
  • Isolated branches for testing changes before going live
  • Traffic splitting to gradually roll out changes to a percentage of users
  • Merging to bring successful experiments back to main

Once versioning is enabled on an agent, it cannot be disabled. Consider this before enabling versioning on existing agents.

Core concepts

Versions

A version is an immutable snapshot of an agent’s configuration at a specific point in time. Each version has a unique ID (format: agtvrsn_xxxx) and contains:

  • conversation_config - System prompt, LLM settings, voice configuration, tools, knowledge base
  • platform_settings - Versioned subset including evaluation, widget, data collection, and safety settings
  • workflow - Complete workflow definition with nodes and edges

Versions are created automatically when you save changes to a versioned agent. Once created, a version cannot be modified.

Branches

Branches are named lines of development, similar to git branches. They allow you to work on changes in isolation before merging back to the main branch.

  • Every versioned agent has a Main branch that cannot be deleted or archived
  • Additional branches can be created from any version on the main branch
  • Each branch has: id (agtbrch_xxxx), name, description, and a list of versions
  • Branch names can contain: letters, numbers, and () [] {} - / . (max 140 characters)

Traffic deployment

Traffic can be split across multiple branches by percentage, enabling gradual rollouts and A/B testing.

  • Percentages must always total exactly 100%
  • Traffic routing is deterministic based on conversation ID (the same user consistently routes to the same branch)
  • Only non-archived branches with 0% traffic can be archived

Drafts

Unsaved changes are stored as drafts, allowing you to work on changes without immediately creating a new version.

  • Drafts are per-user, per-branch (each team member has their own draft)
  • Drafts are automatically discarded when a new version is committed
  • Drafts are also discarded when merging into a branch

Enabling versioning

Versioning is opt-in and must be explicitly enabled. You can enable it when creating a new agent or on an existing agent.

Once enabled, versioning cannot be disabled. This is a permanent change to your agent.

Enable when creating an agent

1from elevenlabs.client import ElevenLabs
2from elevenlabs.types import *
3
4client = ElevenLabs(api_key="your-api-key")
5
6agent = client.conversational_ai.agents.create(
7conversation_config=ConversationalConfig(
8agent=AgentConfig(
9first_message="Hello! How can I help you today?",
10prompt=AgentPromptConfig(
11prompt="You are a helpful assistant."
12)
13)
14),
15enable_versioning=True
16)
17
18print(f"Agent created with versioning: {agent.agent_id}")

Enable on an existing agent

1agent = client.conversational_ai.agents.update(
2 agent_id="your-agent-id",
3 enable_versioning_if_not_enabled=True
4)

Enabling versioning creates the initial “Main” branch with the first version containing the current agent configuration.

Working with branches

Creating a branch

Branches can only be created from versions on the main branch. You can optionally include configuration changes that will be applied to the new branch’s initial version.

1branch = client.conversational_ai.agents.branches.create(
2 agent_id="your-agent-id",
3 parent_version_id="agtvrsn_xxxx",
4 name="experiment-v2",
5 description="Testing new prompt and voice settings"
6)
7
8print(f"Created branch: {branch.created_branch_id}")
9print(f"Initial version: {branch.created_version_id}")

Listing branches

1branches = client.conversational_ai.agents.branches.list(
2 agent_id="your-agent-id"
3)
4
5for branch in branches.branches:
6print(f"{branch.name}: {branch.id}")

Getting branch details

1branch = client.conversational_ai.agents.branches.get(
2 agent_id="your-agent-id",
3 branch_id="agtbrch_xxxx"
4)
5
6print(f"Branch: {branch.name}")
7print(f"Versions: {len(branch.versions)}")

Committing changes

When you update an agent with versioning enabled, specify the branch_id to create a new version on that branch.

1agent = client.conversational_ai.agents.update(
2 agent_id="your-agent-id",
3 branch_id="agtbrch_xxxx",
4 conversation_config=ConversationalConfig(
5 agent=AgentConfig(
6 prompt=AgentPromptConfig(
7 prompt="You are a friendly customer support agent."
8 )
9 )
10 )
11)

A new version is automatically created on the specified branch, and any existing draft for that user on that branch is discarded.

Deploying traffic

Use the deployments endpoint to distribute traffic across branches. This enables gradual rollouts and A/B testing.

1deployment = client.conversational_ai.agents.deployments.create(
2 agent_id="your-agent-id",
3 deployments=[
4 {"branch_id": "agtbrch_main", "percentage": 90},
5 {"branch_id": "agtbrch_xxxx", "percentage": 10}
6 ]
7)
All percentages must sum to exactly 100%. The deployment will fail if they don’t.

Traffic routing is deterministic based on the conversation ID, ensuring the same user consistently reaches the same branch across sessions.

Merging branches

When you’re satisfied with changes on a branch, merge them back to the main branch.

1merge = client.conversational_ai.agents.branches.merge(
2 agent_id="your-agent-id",
3 source_branch_id="agtbrch_xxxx",
4 target_branch_id="agtbrch_main",
5 archive_source_branch=True # Default: true
6)

Merging:

  • Creates a new version on the main branch with the source branch’s configuration
  • Optionally archives the source branch (default behavior)
  • Automatically transfers traffic from the source branch to main

You can only merge into the main branch. Merging between non-main branches is not supported.

Archiving branches

Archive branches you no longer need. This helps keep your branch list organized.

1client.conversational_ai.agents.branches.update(
2 agent_id="your-agent-id",
3 branch_id="agtbrch_xxxx",
4 archived=True
5)

You cannot archive a branch that has traffic allocated to it. Remove all traffic before archiving.

Archived branches can be unarchived by setting archived=False.

Retrieving specific versions

You can retrieve an agent at a specific version or branch tip.

Get agent at specific version

1agent = client.conversational_ai.agents.get(
2 agent_id="your-agent-id",
3 version_id="agtvrsn_xxxx"
4)

Get agent at branch tip

1agent = client.conversational_ai.agents.get(
2 agent_id="your-agent-id",
3 branch_id="agtbrch_xxxx"
4)

Include draft changes

1agent = client.conversational_ai.agents.get(
2 agent_id="your-agent-id",
3 branch_id="agtbrch_xxxx",
4 include_draft=True
5)

Settings reference

Versioned settings

These settings can differ between versions and branches:

CategorySettings
Conversation configSystem prompt, agent personality, LLM selection and parameters, voice settings (TTS model, voice ID), tools configuration, knowledge base, first message, language settings, turn detection, interruption settings
Versioned platform settingsevaluation - evaluation criteria, widget - widget appearance and behavior, data_collection - structured data extraction, overrides - conversation initiation overrides, workspace_overrides - webhooks configuration, testing - test configurations, safety - guardrails (IVC/non-IVC settings)
WorkflowComplete workflow definition (nodes and edges)

Per-agent settings

These settings are shared across all versions:

SettingDescription
name, tagsAgent name and tags (only updated when committing to main branch)
authAuthentication settings and allowlist
call_limitsConcurrency and daily limits
privacyRetention settings and zero-retention mode
banBan status (admin only)

Changes to name and tags on non-main branches don’t persist to the agent until merged to main.

Best practices

1

Create tests before branching

Set up automated tests that capture expected behavior before creating a new branch. This establishes a baseline and helps catch regressions early when iterating on your experiment.

2

Use descriptive branch names

Choose branch names that clearly communicate the purpose of the experiment. Include the feature name, hypothesis, or ticket number for easy reference (e.g., feature/new-greeting-flow or experiment/shorter-responses).

3

Document branch purposes

Use the branch description field to explain what hypothesis you’re testing, what metrics define success, and any dependencies or considerations. This helps team members understand active experiments.

4

Use drafts for work-in-progress

Save drafts frequently while iterating on changes. This preserves your work without creating unnecessary versions. Only commit when you’re ready to test or deploy.

5

Start with small traffic percentages

When deploying a new branch, begin with 5-10% of traffic. This limits exposure if issues arise while still providing meaningful data.

6

Monitor key metrics before increasing traffic

Use the analytics dashboard to compare branch performance. Look for call completion rates, average conversation duration, success evaluation scores, and tool execution rates. Only increase traffic when metrics meet or exceed your main branch baseline.

7

Increase traffic gradually

Scale up traffic in increments (10% → 25% → 50% → 100%) as confidence grows. This approach minimizes risk while validating performance at each stage.

8

Keep branches short-lived

Merge successful experiments promptly to avoid configuration drift. Long-running branches become harder to merge and may conflict with other changes made to main.

Next steps