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:- System Prompt: The exact system prompt used
- Tools: MCP server configurations and custom tools
- Rules: All rules and constraints
- Parameters: Model selection, temperature, mode settings
- Metadata: Version number, timestamp, description, author
Version Lifecycle
Versions follow a controlled lifecycle:- Creation: Capture current configuration as new version
- Testing: Validate version in non-production environment
- Deployment: Promote version to production
- Monitoring: Track performance and issues
- Rollback: Revert to previous version if needed
- 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:Major Version (X.0.0)
Major Version (X.0.0)
Breaking Changes: Fundamental changes to agent behavior or interface
Minor Version (x.Y.0)
Minor Version (x.Y.0)
New Features: Backwards-compatible improvements
Patch Version (x.y.Z)
Patch Version (x.y.Z)
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
Use Semantic Versioning
Use Semantic Versioning
Include Descriptive Names
Include Descriptive Names
Maintain Changelog
Maintain Changelog
Testing Strategy
Test versions thoroughly before production:Deployment Pipeline
Implement structured deployment process:Integration with Other Primitives
With Evals
Validate versions with automated testing:With Traces
Monitor version performance through traces:With Persistence
Maintain session state across version changes: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
Version Not Found
Version Not Found
Problem: Specified version doesn’t existSolution: Verify version name and check available versions
Configuration Conflict
Configuration Conflict
Problem: Version configuration has conflicting settingsSolution: Validate configuration before creating version
Related Primitives
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