Overview
AG2 is an open-source framework for building AI agents and getting several agents to cooperate on a task. It continued from AutoGen under a community of volunteer maintainers. Version 1.0 introduced a new protocol-driven framework, while the classic AutoGen-style API moved to a separate AG2 Classic project that is still maintained.
Key capabilities
- Multi-agent cooperation: agents that work together on tasks.
- Provider extras: OpenAI, Anthropic, Gemini, Ollama and more.
- Classic compatibility: existing AutoGen-style code keeps working on AG2 Classic.
- Research focus: aimed at both building and studying agentic systems.
Tradeoffs
- v1.0 breaks compatibility with Classic code; plan a migration.
- Two parallel projects (v1.0 and Classic) can confuse newcomers.
- Volunteer-maintained rather than backed by one company.
Ideal for
- Teams already on AutoGen-style agents
- Research on multi-agent systems
- Python developers building cooperative agents
Not ideal for
- Teams wanting a stable API with no migration
- Non-Python stacks
Getting started
- Make sure you have Python 3.11 or newer.
- Install with the extra for your model provider, for example
pip install 'ag2[openai]'orag2[anthropic]. - Set your provider's standard API key environment variable; AG2 reads it automatically.
- Follow the Quick Start in the AG2 docs. If you have existing
import autogencode, stay onpip install ag2-classicuntil you migrate.
Technical notes
- Install:
pip install ag2[openai](Python 3.11+) - Classic:
pip install ag2-classic - License: Apache-2.0
- Source: ag2ai/ag2
- GitHub stars: 5,060 (as of 2026-11-12)