Skip to content

AG2

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.

GroupMulti-Agent
Current versionv1.3.2
Bonds withPy

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

Terminal window
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.

  • 1.2.x (October 2026) — current line. Additive: A2A servers on several replicas, push-notification URL validation and input media-type checks, 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.
  • 1.1.x (September–October 2026) — patch releases on top of 1.0.
  • 1.0.0 (27 July 2026) — the protocol-driven framework (previously previewed as 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.
  • 0.14.0 (June 2026) — last ag2 release with the Classic autogen.* API; the swarm API (autogen.agentchat.contrib.swarm_agent) was removed.
  • 0.11–0.13 (February–June 2026) — from 0.11.4 (March), an autogen.beta event-driven preview alongside the Classic API, which still included swarms (autogen.agentchat.contrib.swarm_agent).
import asyncio
from ag2 import Agent
from 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 →


DateVersionChangesReviewer
2026-10-251.2.1Audit 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-211.2.1Retitled “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-211.2.1Guide 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-070.13.3Patch release; core Classic symbols verified.Claude routine
2026-05-200.13.0Swarm API listed under autogen.agentchat.contrib.swarm_agent (correction: it was already there from 0.11).Claude routine
2026-04-210.11.5Index redesigned with Zero → Hero grid.—
November 20250.3.2Initial AG2 guide.—