AG2: Open-Source AgentOS
A programming framework for building AI agents and enabling multi-agent cooperation to solve tasks.
- Source repo
- ag2ai/ag2
- Stars
- ★ 5k
- Last updated
- today
- License
- Apache-2.0
- Primary language
- Python
- FA score
- 55/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformOpenAI API
- Cost
- Free software; you pay for model usage
- Setup effort
- Low · running in minutes
- You'll need
- Typical use
- Developers needing a flexible multi-agent framework to build applications where multiple AI agents collaborate.
- Not a fit if
- Projects still on the autogen.* namespace that cannot refactor
- Developers working outside the Python ecosystem
- Source review
- 55/100 · Major gaps
What does this agent do, and when should you use it?
AG2 (formerly AutoGen) is an open-source programming framework for building AI agents and facilitating cooperation among multiple agents to solve tasks. AG2 v1.0 introduces a protocol-driven architecture with a new top-level ag2 package, focusing on the Agent class, async operations, and a Network system with a Hub and typed channels for orchestration. It includes features like tool calling via @tool decorator, human-in-the-loop support via hitl_hook, and knowledge storage and compaction. The framework requires Python 3.10+ and supports multiple LLM providers (OpenAI, Anthropic, Gemini, etc.). The classic AutoGen framework (the autogen.* namespace) has moved to a separate repository, ag2ai/ag2-classic, and remains maintained.
AG2 enables developers to create Agent instances that interact via ask() methods, use decorated functions as tools, and incorporate human oversight through context.input. It orchestrates multiple agents via a Hub and various channel types (conversation, consulting, discussion, workflow), logging to a write-ahead log. The framework provides KnowledgeStore implementations (e.g., DiskKnowledgeStore) and strategies like SummarizeCompact for memory management. After installation, you can run a simple agent by importing Agent and OpenAIConfig, setting your API key, and calling ask().
- Developers needing a flexible multi-agent framework to build applications where multiple AI agents collaborate.
- AI assistants requiring tool calling and human approval workflows (human-in-the-loop).
- Systems that need memory persistence across sessions (e.g., remembering user preferences).
- Orchestrating AI agents into networks (using channels like
conversationorworkflow) to solve complex tasks. - Researchers who want to test different model providers (OpenAI, Anthropic, Gemini) while keeping code unified.
How do you install or deploy this agent?
On Windows/Linux run pip install ag2[openai], on Mac run pip install 'ag2[openai]'. Alternatively, install extras for your provider: ag2[anthropic], ag2[gemini], ag2[ollama]. Requires Python 3.10+.
How do you use this agent?
Set your API key: export OPENAI_API_KEY="<your-api-key>" (or ANTHROPIC_API_KEY, etc.). Import Agent and OpenAIConfig from ag2. Create an Agent instance, then await agent.ask("your question"). For tools, decorate an async function with @tool and pass it in the tools parameter. For multi-agent, use Hub.open() and hub.register() to create agents and channels. See documentation and examples for detailed workflows.
What are this agent's strengths and limitations?
- Protocol-driven network (Hub and channels) offers more flexible and scalable orchestration than classic GroupChat.
- Built-in tool calling, human-in-the-loop, and knowledge storage (KnowledgeStore).
- Supports multiple major LLM providers (OpenAI, Anthropic, Gemini, etc.) for easy switching.
- Active community and thorough documentation (docs.ag2.ai).
- Migration from AutoGen requires code refactoring: imports, class names, and orchestration patterns change (e.g.,
ConversableAgent→Agent). - Core uses async APIs, which can have a learning curve for developers unfamiliar with asyncio.
- Documentation is primarily for Python, potentially unsuitable for non-Python developers.
- Depends on external LLM APIs, requiring network connection and API keys, which may incur costs.
How does this agent compare with similar options?
Compared to AutoGen (classic), AG2 v1.0 introduces a new network-based orchestration model that emphasizes protocol-driven design.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| AG2: Open-Source AgentOS This agent | 55 · Major gaps | Library / SDKFree + model costs | ★ 5k | today | Python | OpenAI API |
| LangGraph Multi-Agent Swarm | 51 · Major gaps | Library / SDKFree + model costs | ★ 1.6k | 29d ago | Python | OpenAI API |
| PySpur — Visual Playground for Agentic Workflows | 0 · Major gaps | CLIFree + model costs | ★ 5.8k | 1y ago | TypeScript | — |
| CaveAgent | 62 · Some gaps | Library / SDKFree + model costs | ★ 204 | 1mo ago | Python | OpenAI API · Claude API |
How does FollowAgents rate this agent?
Why each dimension lost points
Evidence shows: README emphasizes API keys via environment variables to avoid hardcoding, reflecting partial least privilege practice, but no finer-grained permission control documentation, so score 1. User confirmation: README demonstrates human-in-the-loop via context.input to pause and request human approval, sufficient evidence, score 2. Data flow transparency: README mentions hub has write-ahead log and audit trail, but no detailed data flow or log content, insufficient, score 1. Sensitive data handling: only mentions keys via env vars, no other sensitive data policies, score 1. Dependency security: pyproject.toml lists dependencies and version ranges, but no security audit or vulnerability scanning, score 1. External effects: tools can call external APIs, but no side-effect control, score 1. Rollback: no rollback mechanism mentioned, score 1. Source attribution: README and LICENSE clarify copyright and contributors, but publisher unverified, score 2.
Self-consistency: README and pyproject.toml are mostly consistent in version, dependencies, and features, but some inconsistencies like README mentions 'AG2 Classic' while pyproject.toml does not, score 2. Dependency availability: dependency list complete, but no availability guarantee, score 2. Failure messages: error handling may exist in code, but not documented, score 1.
Audience and scenarios: README targets developers with multiple scenario examples, score 2. Capability boundaries: README distinguishes AG2 and AG2 Classic, but not all boundaries, score 2. Trigger precision: tool calls and event triggers clearly explained, score 2. Environment fit: supports multiple Python versions and OS, but no specific environment limitations, score 2.
Information architecture: README well-structured with TOC and links, score 2. Install notes: provides pip install commands and dependency instructions, score 2. Naming stability: version 1.0.1 indicates stability, but no naming conventions, score 2. Examples and FAQ: multiple code examples, but no FAQ, score 2. Known limitations: not explicitly listed, score 1. License: Apache-2.0 license complete, score 3. Versioning and changelog: version number in pyproject.toml, but no changelog, score 1. Maintenance responsibility: README mentions maintainers, but no clear division, score 2.
Output usability: code examples show how to get replies, but no output format variety, score 2. Marginal value: framework provides multi-agent collaboration, tool calling, etc., high value, score 2. Cost-benefit: open-source free, but no performance or cost analysis, score 2.
Claim traceability: claims in README lack specific evidence or links, score 1. Cross-source corroboration: only README and pyproject.toml, lack other sources, score 1. Fact-inference separation: facts and inferences mixed, not clearly separated, score 1.
- Publisher identity unverified, proceed with caution.
- Dependency security lacks audit or vulnerability scanning, check yourself.
- Sensitive data handling policies unclear, especially user data.
- Rollback mechanism absent, be aware.
- Known limitations not listed, potential hidden issues.
Recent releases
Latest entries from the project's GitHub Releases. Notes are quoted from upstream as written, not rewritten or tested by FollowAgents.
-
Release notes excerpt
Highlights - OpenAI Decisions API support with OpenAIDecisionsConfig and shared decision schemas using the Question marker. - A2A servers can run on multiple replicas, with cacheable agent cards, opt-in input media type validation, and configurable push notification URL validation. - Anthropic cache diagnostics and explicit API keys for OpenAI voice configs. - Ollama API keys, custom HTTP clients, tool names, and fixes for duplicate streaming tool-call IDs. - Fixes for MCP discovery, knowledge stores, evaluation suite loading, skills, A2UI, and network graph loading. …View on GitHub ↗ -
Release notes excerpt
What's Changed * fix(mcp): derive model output schemas from serialization by @asts-top in https://github.com/ag2ai/ag2/pull/3317 * fix(tenki): upgrade sdk and preserve timeout failures by @camcalaquian in https://github.com/ag2ai/ag2/pull/3329 * chore(deps): bump gitpython from 3.1.59 to 3.1.62 by @dependabot[bot] in https://github.com/ag2ai/ag2/pull/3332 * fix(skills): check local skill ownership before validating arguments by @carey-bk in https://github.com/ag2ai/ag2/pull/3328 * chore(deps): bump pyjwt from 2.14.0 to 2.15.0 by @dependabot[bot] in https://github.com/ag2ai/ag2/pull/3331 …View on GitHub ↗ -
Release notes excerpt
v1.1.1 Breaking: Bedrock runs on aiobotocore BedrockConfig now uses a native async client (aiobotocore) instead of wrapping synchronous boto3 in a thread per call and per streamed event. Every Converse request is also type-checked against the service's own stubs. - BedrockConfig(session=...) takes an aiobotocore.session.AioSession. A boto3.Session fails on the first call with AttributeError: 'Session' object has no attribute 'create_client'. …View on GitHub ↗
FAQ
What is the difference between AG2 and AutoGen?
autogen → ag2, ConversableAgent → Agent). The classic AutoGen has moved to a separate repository ag2-classic and remains installable.