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_guardrails
andinput_guardrails
system
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_flows
for 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_tool
decorator replacesBaseTool
classes for cleaner tool definitions - Better Validation:
output_guardrails
andinput_guardrails
replace the oldresponse_validator
system - 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.Runner
from OpenAI Agents SDK for more control
State Management
- v0.x: Relied on Assistant/Thread objects managed by OpenAI
- v1.x: Uses
ThreadManager
andMessageStore
managed viaRunHooks
and sharedMasterContext
Agent Definition
- v0.x: Custom
Agent
class with Assistants API integration - v1.x:
agency_swarm.Agent
extendsagents.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_callbacks
dict β separateload_threads_callback
andsave_threads_callback
parameters - Data Format: Thread IDs only β Complete conversation histories
- Callback Signatures: Unchanged (both use no-parameter callbacks with closure)
Step-by-Step Migration
π§ Agency & Agent Updates
π§ Agency & Agent Updates
Agency Constructor
Data Format Change: Your callbacks now need to store complete conversation histories instead of just thread IDs. Refer to examples/custom_persistence.py to see the example implementation.
Agent Configuration
π οΈ 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 |