Favicon of AG2

AG2

An open-source Python AI agent framework under Apache 2.0 that connects agents across frameworks and supports tool use and human approval.

Screenshot of AG2 website

AG2 is an open-source Python framework for developers and researchers building systems where AI agents share work. The code uses the Apache 2.0 license.

Agents can call Python tools to work with external data, APIs and functions. Workflows can run autonomously or pause for a person to approve an action or supply missing information. A2A and MCP support provide connections to other agents and tools, while shared state carries context across a task's lifecycle.

Multi-agent coordination uses a Network with a central hub and channels for conversations, consultations, group discussions and conditional handoffs. The hub keeps an audit trail. This gives developers a choice between open-ended agent exchanges and workflows with defined transitions.

For longer-running work, agents can retain knowledge between runs and summarize conversation history as it grows. Structured outputs, telemetry, evaluation and testing support help developers check what their agents produce and how they behave.

AG2 is distinct from AG2 Classic, the maintained AutoGen-derived framework. Classic retains the older agent classes and group-chat patterns; the current framework uses a different agent model and isn't a drop-in replacement.

Similar to AG2