Installation
- v0.x (Previous)
- v1.x (New)
v0.x documentation remains available at the current site until v1.0 reaches general availability.
What’s New in v1.x
Latest AI Models
Full support for reasoning modelsWeb Search and Computer Use capabilities
Better Performance
Async-first architecture with direct conversation control
Enhanced Tools
Simple
@function_tool decorator replaces complex BaseTool classesDirect Control
No more black-box Assistants API - full control over threads and runs
📋 Complete Feature Comparison
📋 Complete Feature Comparison
New Capabilities
- Web Search & Computer Use: Native OpenAI Responses API integration
- Latest Models: Full support for o3, o4-mini, and future OpenAI models via Responses API
- Third-Party Models: Use any Chat Completions API-compatible provider
- Direct Thread Control: No more black-box Assistants API limitations
- Full Conversation Persistence: Complete history management (not just thread IDs)
- Enhanced Validation:
output_guardrailsandinput_guardrailssystem
Architectural Improvements
- Orchestrator Pattern on New Foundation: Agency Swarm’s proven orchestrator-workers pattern now runs on the OpenAI Agents SDK foundation
- Async-first: Native async execution for better performance
- Enhanced Communication: Defined
communication_flowsfor coordinated multi-agent execution - Better State Management: Complete conversation history persistence
Enhanced Developer Experience
- Structured Outputs: Native Pydantic model support for agent outputs via
output_type - Modern Tool System:
@function_tooldecorator replacesBaseToolclasses for cleaner tool definitions - Better Validation:
output_guardrailsandinput_guardrailsreplace the oldresponse_validatorsystem - Real-time Streaming: Improved streaming capabilities with async response handling
🏗️ Understanding the Migration
🏗️ Understanding the Migration
The migration from v0.x to v1.x represents a fundamental shift in how Agency Swarm operates:
Execution Core
- v0.x: Used OpenAI Assistants API runs directly
- v1.x: Uses
agents.Runnerfrom OpenAI Agents SDK for more control
State Management
- v0.x: Relied on Assistant/Thread objects managed by OpenAI
- v1.x: Uses
ThreadManagerandMessageStoremanaged viaRunHooksand sharedMasterContext
Agent Definition
- v0.x: Custom
Agentclass with Assistants API integration - v1.x:
agency_swarm.Agentextendsagents.Agent, incorporating tools, subagent registration, and file handling
Conversation History Persistence
This is an important architectural difference between versions:- v0.x (Assistants API): Required thread callbacks for production to persist OpenAI Assistant/Thread IDs. OpenAI managed conversation history server-side.
- v1.x (Agents SDK): Required thread callbacks for production to persist complete conversation histories locally. You manage the full conversation state.
- Callback Structure:
threads_callbacksdict → separateload_threads_callbackandsave_threads_callbackparameters - Data Format: Thread IDs only → Complete conversation histories
- Callback Signatures: Unchanged (both use no-parameter callbacks with closure)
Step-by-Step Migration
🛠️ Tool Migration
🛠️ Tool Migration
🔄 Interaction Updates
🔄 Interaction Updates
Getting Agency Response
Complete Migration Example
- Before (v0.x)
- After (v1.x)
Reference Tables
📚 API changes overview
📚 API changes overview
Agency Methods
| v0.x | Status | v1.x alternative |
|---|---|---|
get_completion() | ✅ Backward compatible | get_response() (async) |
get_completion_stream() | ❌ Removed | get_response_stream() (async) |
agency_chart | ⚠️ Deprecated | Positional args + communication_flows |
model (global default) | ❌ Removed | Configure each Agent via model_settings |
threads_callbacks | ❌ Breaking change | load_threads_callback + save_threads_callback |
Agent Parameters
| v0.x | Status | v1.x alternative |
|---|---|---|
temperature, top_p, etc. | ⚠️ Individual params deprecated | model_settings=ModelSettings(...) |
response_validator | ❌ Removed | output_guardrails, input_guardrails |
response_format | ❌ Removed | output_type |
examples | ⚠️ Deprecated | Auto-prepended to instructions |
Tools
| v0.x | Status | v1.x alternative |
|---|---|---|
BaseTool classes | ⚠️ BaseTool still works | @function_tool decorator (recommended) |
run() method | ✅ Simplified | Direct function body implementation |
_shared_state | ✅ Enhanced | ctx.context |