AG2

An open-source AgentOS framework for building multi-agent AI systems

Framework
PyPI
v1.0.2
4,873stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
91/100Excellent
Development Activity100
Maintenance100
Community80
Maturity44
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
75/100Good
Architecture76
Code Quality78
Innovation80
Learning Curve65

AG2 (formerly AutoGen) is an open-source Python framework for building AI agents that can converse with each other, call tools, and collaborate on tasks. It provides the conversation, orchestration, and human-in-the-loop primitives needed to run multi-agent systems, rather than a single-agent wrapper around one LLM call.

The project is on the path to a protocol-driven v1.0 (imported as ag2), with the classic ConversableAgent/GroupChat API removed in favor of a newer architecture. It ships built-in support for tool use, MCP (Model Context Protocol) integration, agent-to-agent (A2A) communication, and evaluation tooling, and is maintained by a volunteer group spanning multiple organizations that grew out of Microsoft’s original AutoGen project.

What You Get

  • Conversable agent primitives for defining LLM-backed agents that exchange messages and call tools
  • Multi-agent orchestration patterns (group chats, sequential and nested conversations) for coordinating several agents on one task
  • Built-in MCP (Model Context Protocol) and A2A (agent-to-agent) protocol support for interoperating with external tools and other agent runtimes
  • Human-in-the-loop (HITL) workflow support for pausing agent execution for human approval or input
  • An eval module for scoring and evaluating agent behavior, plus knowledge/context modules for grounding agents in external data

Common Use Cases

  • Building a multi-agent research or coding assistant where specialized agents (planner, coder, reviewer) collaborate on a task
  • Adding MCP-based tool access to an agent system so agents can call external services through a standard protocol
  • Prototyping human-in-the-loop agent workflows that require approval gates before an agent takes a consequential action
  • Academic or applied research into multi-agent conversation patterns, building on AG2’s lineage from the original AutoGen research project

Under The Hood

Architecture - The ag2/ package is organized by concern rather than by a single monolithic agent class: agent.py defines the core agent abstraction, mcp/ and a2a//acp/ag_ui implement protocol adapters for tool and agent interoperability, hitl.py handles human-in-the-loop interrupts, events/ and observers/ provide an event-driven hook system for tracing agent behavior, middleware/ and policies/ let callers intercept and constrain agent actions, and eval/ and knowledge/ add evaluation and retrieval-grounding support. This module split reflects the project’s stated move away from the classic ConversableAgent/GroupChat design toward a protocol-driven architecture ahead of v1.0.

Tech Stack - Python 3.10+, packaged with a pyproject.toml/uv.lock (using uv for dependency resolution) and organized as optional extras (e.g. ag2[openai]) so LLM-provider-specific dependencies aren’t forced on every install. The repo also maintains a documentation site (website/, docs/) built separately from the package, and a justfile/jog.yaml for task automation.

Code Quality - test/ contains 444 Python test files mirroring the package’s module structure, indicating substantial test investment relative to the framework’s size and the pace of its ongoing architectural changes. A _typos.toml config and CI-run linting (referenced in the README’s “Code style and linting” section) suggest active enforcement of code hygiene, and _import_utils.py centralizes import-compatibility handling for the in-progress autogenag2 rename.

API Design - Getting started is a single pip install ag2[openai] plus a short config-list setup for API keys, and the README walks through conversable agents, group orchestration, and human-in-the-loop step by step. The tradeoff is that the framework is mid-migration: the classic top-level API (ConversableAgent, GroupChat importable as autogen) was recently removed in favor of the new ag2-only protocol-driven design, so existing AutoGen-era code and tutorials require adaptation to the current API.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search