AG2
Published
At a glance
- What it is
- AG2 is an open-source Python framework for building AI agents and getting several agents to cooperate on a task.
- Price from
- Open source Details
- Best for
- Python teams building multi-agent systems; Projects that already use AutoGen-style code
- Official site
- ag2.ai
- Last checked
- November 2026
- Watch out for
- AG2 v1.0 is not a drop-in upgrade from Classic, and the README points users to a migration guide for moving off group chats.
AG2 is an open-source Python framework for building AI agents and getting several agents to cooperate on a task. Its website describes it as coming from the creators of AutoGen, and its README says the project is maintained by volunteers from several organisations, with Chi Wang and Qingyun Wu as project administrators. The repository's licence notes describe it as a fork, with its own modifications licensed under Apache 2.0.
Version 1.0 changed the framework a lot. The new package is imported as `ag2`, it is async throughout, and its core building block is an `Agent` class that talks to a model provider, calls tools and returns a reply. Tools are plain Python functions marked with a `@tool` decorator, and AG2 runs the calling loop for you. Multiple agents are coordinated through a Network of a hub and typed channels. The older AutoGen-style API (`import autogen`, `ConversableAgent`, `GroupChat`, swarms) now lives in a separate AG2 Classic repository that the team says is still maintained.
AG2 needs Python 3.11 or newer. You install an extra for your model provider, such as OpenAI, Anthropic, Gemini or Ollama, and each provider config reads its usual API key environment variable. The README lists human-in-the-loop pauses, persistent knowledge, history compaction, structured outputs, middleware, telemetry and evaluation. The main caveat is that v1.0 is not a drop-in upgrade from Classic, so older tutorials and code may not match the current package.
Key features
- Agent class
- One `Agent` object handles model calls, tool use and replies, and `reply.ask()` continues the same conversation.
- Decorator tools
- Python functions marked with `@tool` become callable tools, and AG2 runs the full tool-calling loop.
- Network orchestration
- Several agents coordinate over a hub and typed channels instead of the older group chat pattern.
- Human in the loop
- A tool can call `context.input()` to pause a run and ask a person for confirmation or missing details.
- Agent harness
- Opt-in pieces add persistent knowledge, context assembly and history compaction to an agent.
- Multiple providers
- Install extras for OpenAI, Anthropic, Gemini, Ollama and others.
- AG2 Classic
- The AutoGen-style `autogen` namespace stays available as the separate `ag2-classic` package.
Pricing
As of November 2026, the AG2 framework is free and open source under the Apache 2.0 licence. Model API costs from providers such as OpenAI or Anthropic are separate, as is the hardware if you run local models. The ag2.ai site says enterprise features and managed hosting are available, and its AG2 Space product is behind a Request Access form, but no prices are published.
Best for
- Python teams building multi-agent systems
- Projects that already use AutoGen-style code
- Agents that need human approval steps
- Mixing models from several providers
Limitations
- AG2 v1.0 is not a drop-in upgrade from Classic, and the README points users to a migration guide for moving off group chats.
- It requires Python 3.11 or newer, so older environments need an upgrade first.
- The split into two packages and two docs sites means you need to check which one a tutorial or answer was written for.
- Enterprise and hosted offerings have no public pricing, so teams have to contact AG2 to learn the costs.
Verdict
AG2 is a reasonable pick for Python developers who want a multi-agent framework with tools, human checkpoints and many model providers. The v1.0 redesign is cleaner but breaks compatibility, so existing AutoGen-style projects should weigh a rewrite against staying on AG2 Classic.
Sources
Written from the vendor's own site and documentation, checked November 2026. We have no paid relationship that affects what this page says.
How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.