Skip to main content

Migration from v0.2 to v0.4

AutoGen v0.4 is a ground-up rewrite with an asynchronous, event-driven architecture. This guide helps you migrate from v0.2 to take advantage of improved observability, flexibility, and scale.
AutoGen v0.2 continues to receive bug fixes and security patches. However, we strongly recommend upgrading to v0.4 for new projects.

Why Upgrade to v0.4?

AutoGen v0.4 offers significant improvements:
  • Async/Await: Native async support for better concurrency
  • Event-Driven: Observable, controllable agent execution
  • Layered Architecture: Core API + AgentChat API for flexibility
  • Better Tool Integration: Simplified tool use without separate executors
  • State Management: Built-in save/load for agents and teams
  • Streaming: Real-time message streaming
  • Type Safety: Improved type hints and Pydantic models

Installation

The pyautogen package is no longer maintained by Microsoft after v0.2.34. Use autogen-agentchat instead.

Model Client Configuration

v0.2 Approach

v0.4 Approach

Azure OpenAI

Assistant Agent

v0.2 Approach

v0.4 Approach

User Proxy Agent

v0.2 Approach

v0.4 Approach

Tool Usage

v0.2 Approach (Two-Agent Pattern)

v0.4 Approach (Single Agent)

Code Execution

v0.2 Approach

v0.4 Approach

Group Chat

v0.2 Approach

v0.4 Approach

LLM-Based Selection (SelectorGroupChat)

State Management

v0.2 Approach

Manual state management:

v0.4 Approach

Built-in save/load:

Caching

v0.2 Approach

v0.4 Approach

Custom Agents

v0.2 Approach (Register Reply)

v0.4 Approach (Inherit BaseChatAgent)

Termination Conditions

v0.2 Approach

v0.4 Approach

Streaming

v0.2

No built-in streaming support.

v0.4

Key Differences Summary

Breaking Changes

These features from v0.2 are not yet available in v0.4:
  • Model client cost tracking
  • Teachable agents
  • Some RAG patterns (use Memory API instead)

Migration Checklist

Getting Help