Agent Version Management
Learn how to update your agent's prompt version without recreating the agent or changing API keys.
Overview
Version management is a critical feature that allows you to continuously improve your agents while maintaining stability and backward compatibility.
Key Benefits
- ✅ API Stability - Keep same agent ID and API keys
- ✅ Zero Downtime - Update prompts without service interruption
- ✅ Easy Rollback - Revert to previous versions instantly
- ✅ Testing Flexibility - Test new prompts without creating duplicates
- ✅ Continuous Improvement - Iterate based on real usage data
How It Works
graph LR
A[Prompt V1] -->|Agent Created| B[Agent]
C[Prompt V2] -->|Version Update| B
D[Prompt V3] -->|Version Update| B
B -->|Always Uses| E[Current Version]
B -->|API Key Stays Same| F[External Integration]
Version Pinning
Each agent is pinned to a specific version of a prompt:
- Immutable Executions - Past executions always reference their original version
- Controlled Updates - Only update when you explicitly choose to
- Independent Agents - Multiple agents can use different versions of the same prompt
Updating Agent Versions
Using the Dashboard
Step 1: Navigate to Agent
- Go to Agents page (
/agents) - Click on your agent to open the detail page
- Go to the Overview tab
Step 2: Open Version Selector
- Find the Prompt Version section
- Click the Version Selector dropdown
- You'll see all available versions for this prompt
Step 3: Review Available Versions
Each version shows:
- Version Label (e.g., "V3", "Production", "Experiment-A")
- Created Date - When this version was created
- Status Indicator - Shows if this is the current version
Current version is marked with a badge.
Step 4: Select New Version
- Click on the version you want to switch to
- Review the change summary (if provided)
- Click "Update Version" button
- Confirm the update in the dialog
Step 5: Verify Update
After updating:
- ✅ Check the Prompt Version section shows new version
- ✅ Go to Executions tab
- ✅ Run a test execution
- ✅ Verify output matches expectations
Using the API
Update an agent's version programmatically:
curl -X PATCH https://api.promptick.ai/api/agents/agent_abc123/version \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_SESSION_TOKEN" \
-d '{
"newPromptVersionId": "version_xyz456",
"newPromptVersionLabel": "V4"
}'
Response:
{
"agent": {
"id": "agent_abc123",
"promptVersionId": "version_xyz456",
"promptVersionLabel": "V4",
"updatedAt": "2025-11-18T10:20:00Z"
}
}
Testing New Versions
Strategy 1: Parallel Testing
Create a test agent to validate new versions:
-
Create Test Agent
- Duplicate your production agent
- Set status to "Testing"
- Use a test API key
-
Update Test Agent
- Update test agent to new version
- Keep production agent on current version
-
Run Test Cases
- Execute with same inputs as production
- Compare outputs side-by-side
- Monitor metrics (latency, cost, quality)
-
Promote to Production
- Once validated, update production agent
- Monitor closely for first few hours
- Delete test agent or keep for future testing
Strategy 2: Gradual Rollout
Update production agent and monitor closely:
-
Before Update
- Note current metrics (success rate, latency, cost)
- Ensure you can quickly rollback if needed
-
Update Version
- Update during low-traffic period
- Monitor execution history in real-time
-
Watch Metrics
- Success/failure rates
- Average latency
- Token usage changes
- Cost per execution
- Error patterns
-
Rollback if Needed
- If metrics degrade, rollback immediately
- Investigate issues before trying again
Strategy 3: A/B Testing
Use multiple agents for controlled comparison:
-
Create two agents:
- Agent A: Current version
- Agent B: New version
-
Split traffic between them (in your application code)
-
Track metrics for both agents separately
-
After sufficient data, choose the better performer
-
Update losing agent or retire it
Monitoring Version Changes
Execution History Filtering
After updating a version, use execution history to compare:
- Go to Executions tab
- Filter by date range:
- Before update: Last 7 days before version change
- After update: Last 7 days after version change
- Compare metrics:
- Success rates
- Average latency
- Token usage
- Cost per execution
Analytics Dashboard
The Analytics tab shows:
- Version Performance - Metrics broken down by prompt version
- Trend Analysis - How metrics changed over time
- Cost Comparison - Cost differences between versions
Rollback Procedures
Quick Rollback (Emergency)
If you detect issues immediately:
- Open agent detail page
- Click Version Selector
- Select previous version
- Click "Update Version"
- Rollback is instant - new executions use old version immediately
Planned Rollback
If you're proactively reverting:
- Review execution history to identify last good version
- Note the version label (e.g., "V2")
- Use Version Selector to switch back
- Document why you rolled back (for future reference)
- Monitor to ensure issues are resolved
Rollback Checklist
Before rolling back:
- Identify the issue (error rate, quality, cost, latency)
- Confirm which version was working correctly
- Note current version label for documentation
- Verify previous version is still available
- Perform rollback
- Test immediately after rollback
- Monitor metrics for 1-2 hours
- Document the incident
Best Practices
1. Version Labels Matter
Use clear, descriptive version labels:
Good Labels:
Production-Stable- Currently deployed versionV3-Shorter-Responses- Describes what changedExperiment-Formal-Tone- Indicates testing purpose2025-11-18-Update- Date-based versioning
Bad Labels:
Version 1,Version 2(not descriptive)Test(what kind of test?)New(new becomes old quickly)
2. Document Changes
Keep notes about each version:
- What changed compared to previous version
- Why the change was made
- Expected impact on outputs
- Any known issues or limitations
Add version notes in the prompt description field so they're visible when selecting versions.
3. Test Before Production
Never update a production agent without testing:
- Create test agent
- Update test agent first
- Run comprehensive tests
- Verify quality and metrics
- Only then update production
4. Monitor After Updates
After updating any agent:
- Watch execution history for first hour
- Check error rates
- Review sample outputs
- Monitor cost changes
- Be ready to rollback
5. Gradual Updates
For critical agents:
- Update during low-traffic periods
- Start with less critical agents first
- Give each update time to prove itself
- Don't update multiple agents simultaneously
6. Keep Version History
Don't delete old prompt versions:
- You might need to rollback weeks later
- Old versions serve as documentation
- Useful for understanding evolution
- Required for compliance/auditing
Common Scenarios
Scenario 1: Fixing a Bug
Problem: Agent outputs contain a consistent error
Solution:
- Create new prompt version fixing the bug
- Create test agent with new version
- Verify bug is fixed
- Update production agent
- Monitor to ensure fix works
Scenario 2: Improving Quality
Problem: Outputs are correct but could be better
Solution:
- Create new version with improvements
- Run A/B test with both versions
- Compare quality metrics
- Update to better version
- Keep old version for potential rollback
Scenario 3: Reducing Costs
Problem: Agent costs are too high
Solution:
- Create new version with shorter prompts
- Test that quality remains acceptable
- Compare token usage and costs
- If cost reduction is significant without quality loss, update
- Monitor to ensure cost savings are real
Scenario 4: Emergency Rollback
Problem: New version is causing failures
Solution:
- Immediately rollback to previous version
- Investigate root cause
- Fix the issue in a new version
- Test thoroughly before trying again
Version Management API
For automated version management:
Check Current Version
GET /api/agents/{agentId}
Returns agent details including promptVersionId and promptVersionLabel.
List Available Versions
GET /api/prompts/{promptId}/versions
Returns all versions for the prompt.
Update Version
PATCH /api/agents/{agentId}/version
Updates the agent's prompt version.
Automation Example
// Automated version update script
async function updateAgentVersion(agentId, newVersionId, newVersionLabel) {
// 1. Get current version
const agent = await getAgent(agentId);
const currentVersion = agent.promptVersionId;
// 2. Update to new version
await updateVersion(agentId, newVersionId, newVersionLabel);
// 3. Run validation tests
const testPassed = await runValidationTests(agentId);
// 4. Rollback if tests fail
if (!testPassed) {
console.error('Tests failed, rolling back...');
await updateVersion(agentId, currentVersion, agent.promptVersionLabel);
throw new Error('Version update failed validation');
}
console.log('Version updated successfully');
}
Troubleshooting
"Cannot update to same version"
Error: Trying to update to the currently active version
Solution: Select a different version or verify which version is currently active
"Version not found"
Error: Specified version doesn't exist
Solution:
- Verify version ID is correct
- Ensure version belongs to the same prompt
- Check that version hasn't been deleted
"Agent not found"
Error: Agent ID is invalid
Solution:
- Verify agent ID
- Ensure you have access to this agent
- Check that agent hasn't been deleted
Updates Not Taking Effect
Problem: Agent still using old version after update
Solution:
- Refresh the page
- Verify update succeeded (check version in Overview tab)
- New executions should use new version (check execution detail)
- Old executions still show old version (this is expected)
Next Steps
- Creating Agents - Learn how to create agents
- Execution History - Monitor agent performance
- API Reference - API documentation
- Best Practices - Production tips
Need help? Check our FAQ or contact support.