Core Concepts
Reasoning
Memory & Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools
Safety & Security
Evaluation
Meta
Core Concepts
Reasoning
Memory & Retrieval
Agent Types
Design Patterns
Training & Alignment
Frameworks
Tools
Safety & Security
Evaluation
Meta
AG2 (formerly AutoGen) is an open-source multi-agent AI framework maintained by the original creators of Microsoft AutoGen. Licensed under Apache 2.0 with 4.3K+ GitHub stars, AG2 brands itself as “The Open-Source AgentOS” – providing a stable, community-driven platform for building conversational AI agent systems without the breaking changes introduced by Microsofts AutoGen 0.4 rewrite.
AG2 forked from Microsoft AutoGen v0.2.34 when Microsoft began a complete architectural rewrite (AutoGen 0.4) that shifted toward async messaging, TypeScript support, and Semantic Kernel integration. The original creators – Chi Wang and Qingyun Wu – established AG2 to preserve the familiar, battle-tested agent patterns while evolving the framework through community-driven development with an open RFC process.
Key features:
Two-agent conversation:
from autogen import ConversableAgent, config_list_from_json # Load LLM config (supports OpenAI, Azure, local models) config_list = config_list_from_json("OAI_CONFIG_LIST") llm_config = {"config_list": config_list, "temperature": 0} # Create a user proxy that can execute code user_proxy = ConversableAgent( name="User", human_input_mode="NEVER", code_execution_config={"work_dir": "coding", "use_docker": True} ) # Create an AI assistant assistant = ConversableAgent( name="Assistant", llm_config=llm_config, system_message="You are a helpful data analyst. Write Python code to solve tasks." ) # Start conversation -- agents chat until task is complete user_proxy.initiate_chat( assistant, message="Analyze the top 10 Python packages by downloads and create a bar chart." )
GroupChat with multiple specialized agents:
from autogen import ConversableAgent, GroupChat, GroupChatManager llm_config = {"config_list": config_list, "temperature": 0} # Define specialized agents planner = ConversableAgent( name="Planner", llm_config=llm_config, system_message="You break down tasks into steps. Do not write code." ) engineer = ConversableAgent( name="Engineer", llm_config=llm_config, system_message="You write Python code to implement plans. Always include error handling." ) critic = ConversableAgent( name="Critic", llm_config=llm_config, system_message="You review code for bugs, security issues, and improvements." ) user_proxy = ConversableAgent( name="User_proxy", human_input_mode="NEVER", code_execution_config={"work_dir": "output"} ) # Create group chat -- LLM selects next speaker groupchat = GroupChat( agents=[user_proxy, planner, engineer, critic], messages=[], max_round=12 ) manager = GroupChatManager(groupchat=groupchat, llm_config=llm_config) user_proxy.initiate_chat( manager, message="Build a REST API that serves stock price predictions." )
AG2 is installable under multiple package names (all point to the same codebase):
pip install ag2 # or pip install pyautogen # or pip install autogen
| AG2 (Community Fork) | Microsoft AutoGen 0.4+ | |
|---|---|---|
| Architecture | Familiar synchronous chat patterns | Async messaging, event-driven |
| Governance | Community-driven, open RFC | Microsoft-led |
| Migration | None needed for 0.2 code | Significant rewrites required |
| License | Apache 2.0 | Apache 2.0 |
| Focus | Stability, backward compat | Enterprise scale, new features |
| Ecosystem | AG2 Studio, Marketplace (roadmap) | AutoGen Studio, Semantic Kernel |
| Community | 20K+ active builders | Microsoft ecosystem |