Install
pip install "ag2[openai]"AG2 1.x, the async agent framework from the community fork of AutoGen 0.2: Agent, tools, structured output, the Network hub, MCP and A2A. Plus the AG2 Classic (import autogen) API in maintenance mode.
AG2 is a community fork of AutoGen 0.2, started in November 2024 by AutoGen’s original authors and developed independently of Microsoft’s AutoGen. With AG2 1.0 (July 2026) the project replaced its AutoGen-era API: pip install ag2 now gives you an async, protocol-driven framework imported as ag2, built around Agent, @tool, typed events and a multi-agent Network. The old autogen.* API lives on as AG2 Classic.
Install
pip install "ag2[openai]"Version
ag2 v1.3.2 · checked 2026-11-19 · Python 3.10+
Best for
Async agents with typed events, hub-and-channel multi-agent systems, MCP and A2A interop.
import autogen)reasoning option on OpenAIResponsesConfig, Firecrawl and Keenable search toolkits, Mistral live/speech configs, plus provider and knowledge-store fixes. No changes needed to 1.1 code on this site.autogen.beta from 0.11.4 to 0.14) becomes the top-level ag2 package. Classic agent classes, GroupChat, swarms and the autogen import name are removed from ag2; Classic continues in the ag2ai/ag2-classic repository.ag2 release with the Classic autogen.* API; the swarm API (autogen.agentchat.contrib.swarm_agent) was removed.autogen.beta event-driven preview alongside the Classic API, which still included swarms (autogen.agentchat.contrib.swarm_agent).import asyncio
from ag2 import Agentfrom ag2.config import OpenAIConfig
agent = Agent( "assistant", prompt="You are a helpful assistant.", config=OpenAIConfig(model="gpt-6-luna"), # reads OPENAI_API_KEY)
async def main() -> None: reply = await agent.ask("Hello!") print(reply.body)
asyncio.run(main())Ready? Start with what changed in 1.0 →
| Date | Version | Changes | Reviewer |
|---|---|---|---|
| 2026-10-25 | 1.2.1 | Audit against the installed package. Fixed the Network pipeline example (the initiator’s send is its own turn, so the first agent never ran), the claim that ToolMiddleware is a base class, and the claim that tool exceptions propagate out of ask(). Corrected the swarm and autogen.beta history. Added streaming and Agent.run, custom middleware and observers, approval-gated tools, sub-task, consulting and tool-call routing examples, serving an agent as an MCP server, and two recipes. | Claude |
| 2026-10-21 | 1.2.1 | Retitled “AG2” (it is a fork, not a rename). AG2 Classic pages moved here from the AutoGen guide into /ag2-guide/classic/, with a single migration page. Added sections on dependency injection, code execution (local sandbox vs provider-hosted tools), multimodal input, middleware and observers, knowledge and compaction, sub-tasks and eval, and an OpenTelemetry/usage example in production. | |
| 2026-10-21 | 1.2.1 | Guide rewritten for the ag2 1.x API (import ag2); every example run offline with ag2.testing.TestConfig against 1.1.2 and re-run against 1.2.1 (1.1.2 → 1.2.1 changelog reviewed: additive only). Removed examples that never matched a released API (ag2 init/ag2 ui CLI, QuickResearchTool, autogen.interop.A2AServer, Agent(system_message=...) from autogen). Classic material condensed into a Classic/migration section verified against autogen 0.14.1. | Claude |
| 2026-06-07 | 0.13.3 | Patch release; core Classic symbols verified. | Claude routine |
| 2026-05-20 | 0.13.0 | Swarm API listed under autogen.agentchat.contrib.swarm_agent (correction: it was already there from 0.11). | Claude routine |
| 2026-04-21 | 0.11.5 | Index redesigned with Zero → Hero grid. | — |
| November 2025 | 0.3.2 | Initial AG2 guide. | — |