Skip to main content
Versioning enables you to track, manage, and control different versions of your agent configurations, allowing safe experimentation, rollback, and deployment strategies.

Overview

The Versioning primitive provides version control for your agent configurations, including system prompts, tools, rules, and parameters. Like Git for code, versioning for agents lets you experiment safely, maintain production stability, and rollback when needed. Versioning is essential for:
  • Safe Experimentation: Test new prompts and configurations without affecting production
  • Rollback Capability: Quickly revert to previous working versions if issues arise
  • A/B Testing: Compare different agent configurations to find optimal setup
  • Environment Management: Maintain different configurations for dev, staging, and production
  • Audit Trail: Track changes to agent behavior over time

Configuration Snapshots

Capture complete agent configuration at any point in time

Instant Rollback

Revert to any previous version instantly if problems occur

Parallel Testing

Run multiple versions simultaneously for comparison

Change Tracking

Complete audit trail of all configuration changes

How Versioning Works

Version Structure

Each version is a complete snapshot of agent configuration:
  1. System Prompt: The exact system prompt used
  2. Tools: MCP server configurations and custom tools
  3. Rules: All rules and constraints
  4. Parameters: Model selection, temperature, mode settings
  5. Metadata: Version number, timestamp, description, author

Version Lifecycle

Versions follow a controlled lifecycle:
  1. Creation: Capture current configuration as new version
  2. Testing: Validate version in non-production environment
  3. Deployment: Promote version to production
  4. Monitoring: Track performance and issues
  5. Rollback: Revert to previous version if needed
  6. Archival: Archive old versions for historical reference
Semantic Versioning: Use semantic versioning (major.minor.patch) to communicate the nature of changes clearly.

Code Examples

Creating Versions

Updating Versions

Version Comparison

Rollback

Environment-Based Versions

Version Management Patterns

Semantic Versioning

Follow semantic versioning conventions:
Breaking Changes: Fundamental changes to agent behavior or interface
New Features: Backwards-compatible improvements
Bug Fixes: Backwards-compatible bug fixes

Branching Strategies

Manage parallel development:

Use Cases

1. Safe Production Deployment

Deploy new versions without risk:

2. A/B Testing for Optimization

Test different approaches to find what works best:

3. Emergency Rollback

Quickly revert problematic versions:

4. Multi-Tenant Versioning

Different versions for different customers:

5. Feature Flags via Versioning

Enable features selectively:

Best Practices

Version Naming

Testing Strategy

Test versions thoroughly before production:

Deployment Pipeline

Implement structured deployment process:

Integration with Other Primitives

With Evals

Validate versions with automated testing:
Learn more: Evals Primitive

With Traces

Monitor version performance through traces:
Learn more: Traces Primitive

With Persistence

Maintain session state across version changes:
Learn more: Persistence Primitive

Performance Considerations

Version Overhead

  • Version Lookup: < 10ms to resolve version
  • Configuration Load: < 50ms to load version config
  • No Runtime Impact: Version selection happens before execution

Storage and Retention

  • Version Storage: Unlimited versions per account
  • Retention: Versions retained indefinitely unless manually deleted
  • Archive: Old versions can be archived for historical reference

Troubleshooting

Problem: Specified version doesn’t existSolution: Verify version name and check available versions
Problem: Version configuration has conflicting settingsSolution: Validate configuration before creating version

Evals

Test and validate versions

Traces

Monitor version performance

Persistence

Session state across versions

Hooks

Version lifecycle callbacks

Additional Resources

API Reference

Version parameters

Deployment Guide

Production deployment strategies

Best Practices

Version management patterns
Remember: Use semantic versioning, test thoroughly, deploy gradually, and always maintain the ability to rollback quickly if issues arise.