Open-source multi-agent framework forked from Microsoft AutoGen, using conversation-driven coordination to orchestrate AI agents for code generation, research, and collaborative problem-solving.
Community-driven evolution of Microsoft's AutoGen — open-source framework for building AI agent teams that collaborate through conversations to solve complex problems.
AG2 is the community fork of Microsoft's AutoGen. When Microsoft shifted focus to its own Agent Framework in 2025, the AutoGen community took the code and kept building. The result: AG2, an open-source multi-agent framework where AI agents talk to each other in structured conversations to solve problems.
The core idea is simple. You define agents with different roles (coder, reviewer, planner) and let them converse. A coder agent writes Python. A reviewer agent critiques it. A human jumps in when needed. The framework manages message passing, turn-taking, and termination conditions. It's like a group chat, but the participants are LLMs.
Here's the awkward part. Microsoft still maintains AutoGen (now part of their Agent Framework). AG2 is the community fork. Microsoft has publicly described AG2 as "just one of thousands of forks." This creates ecosystem fragmentation. Libraries, tutorials, and StackOverflow answers may reference AutoGen, AG2, or both. Check import paths carefully.
AG2's GroupChat puts multiple agents in a shared conversation with a selector that determines who speaks next. You can run 5, 10, or 20 agents debating solutions. A "Captain Agent" can spawn sub-agents on the fly. This pattern works well for complex research tasks where you don't know the right approach upfront.
Your costs are LLM API calls. A multi-agent conversation with 5 turns between 3 agents using GPT-4 costs roughly $0.30-1.00 depending on context length. That adds up fast in production.
Source: ag2.ai
AG2 itself is free, but conversation-driven coordination is token-hungry. Each agent response costs API tokens. A 10-turn conversation between 3 agents generates 30 LLM calls. Compare that to single-agent approaches that solve the same problem in 1-3 calls. Budget for 3-10x the token cost of a single-agent solution.
Developers praise AG2 for being "simpler, cleaner, and more flexible" than alternatives for rapid iteration. The conversation-driven approach gets called "the right level of abstraction" that "gets out of the way and lets you hack." Complaints center on the fork confusion, lack of production tooling, and higher token consumption compared to LangGraph or CrewAI.
AG2 costs $0 in licensing. Your spend is API tokens. A typical multi-agent workflow costs $0.50-2.00 per run with GPT-4. Running 100 tasks/day = $50-200/month in API costs. CrewAI has a similar cost profile but adds a $200/month Enterprise tier for managed hosting. LangGraph Cloud starts at $0 for 1M nodes but charges for compute beyond that. AG2 keeps you in control of infrastructure and costs.
Was this helpful?
AG2 is the best open-source option for conversation-driven multi-agent workflows, especially code generation and iterative research. The fork situation with Microsoft AutoGen creates confusion, and production tooling is thin. Budget for higher token costs than single-agent alternatives.
Agents collaborate through structured conversations with automatic turn-taking, termination conditions, and message routing.
Use Case:
UserProxyAgent enables humans to participate in agent conversations naturally, providing guidance and approval when needed.
Use Case:
Agents can write, execute, and iterate on code in sandboxed environments (local or Docker), making them powerful for coding and data tasks.
Use Case:
Coordinate multi-agent conversations with customizable speaker selection policies, conversation flow control, and group dynamics.
Use Case:
Backward compatible with existing AutoGen codebases, making migration seamless for teams already using Microsoft's framework.
Use Case:
Improved architecture with better separation of concerns, making it easier to customize agent behaviors and integrate new capabilities.
Use Case:
Free
forever
Ready to get started with AG2?
View Pricing Options →Software development teams requiring collaborative AI agents for code generation, review, and testing workflows
Data science projects benefiting from multiple specialized agents for different aspects of analysis and interpretation
Educational environments where understanding multi-agent conversations provides insight into AI problem-solving approaches
Organizations migrating from Microsoft AutoGen seeking community-governed alternative with enhanced features
Complex reasoning tasks that benefit from diverse agent perspectives and collaborative problem-solving approaches
We believe in transparent reviews. Here's what AG2 doesn't handle well:
AG2 evolved from AutoGen when the project transitioned within Microsoft. AG2 is community-governed with enhanced features while maintaining backward compatibility with AutoGen code.
Yes. AG2 maintains backward compatibility with AutoGen, so most existing code works with minimal or no changes.
AG2 uses conversational agent patterns where agents talk to solve problems. CrewAI uses role-based task assignment. AG2 is more flexible; CrewAI is more structured and easier to start with.
AG2 supports Docker-based code execution for sandboxing. For production use, Docker execution is strongly recommended to prevent agents from running potentially harmful code on host systems.
Weekly insights on the latest AI tools, features, and trends delivered to your inbox.
Rebranded from AutoGen to AG2 with migration to ag2ai GitHub organization. Preparing v1.0 stable API release. Added Captain Agents for dynamic sub-agent spawning. Universal framework interoperability connecting agents from AG2, Google ADK, OpenAI, and LangChain.
People who use this tool also find these helpful
The next-generation AG2 platform with AgentOS runtime, framework interoperability, teachable agents, and enhanced planning for production multi-agent systems.
Open-source Python framework that organizes AI agents into company-like hierarchies with strict communication channels. Built on the OpenAI Agents SDK. Free to use; you pay only for API calls to the LLM providers.
Research-first multi-agent framework with #1 GAIA benchmark performance, designed for studying agent societies and role-playing simulations at scale
Zero-code multi-agent orchestration platform from Tsinghua University for developing everything — from software to data visualization and deep research — using LLM-powered agent collaboration.
Open-source agent framework built on Llama models with local deployment options and community-driven development.
Multi-agent software company simulation platform.
See how AG2 compares to AutoGen and other alternatives
View Full Comparison →Agent Frameworks
Open-source multi-agent framework from Microsoft Research with asynchronous architecture, AutoGen Studio GUI, and OpenTelemetry observability. Now part of the unified Microsoft Agent Framework alongside Semantic Kernel.
AI Agent Builders
CrewAI is an open-source Python framework for orchestrating autonomous AI agents that collaborate as a team to accomplish complex tasks. You define agents with specific roles, goals, and tools, then organize them into crews with defined workflows. Agents can delegate work to each other, share context, and execute multi-step processes like market research, content creation, or data analysis. CrewAI supports sequential and parallel task execution, integrates with popular LLMs, and provides memory systems for agent learning. It's one of the most popular multi-agent frameworks with a large community and extensive documentation.
AI Agent Builders
Graph-based stateful orchestration runtime for agent loops.
AI Agent Builders
OpenAI's official open-source framework for building agentic AI applications with minimal abstractions. Production-ready successor to Swarm, providing agents, handoffs, guardrails, and tracing primitives that work with Python and TypeScript.
No reviews yet. Be the first to share your experience!
Get started with AG2 and see if it's the right fit for your needs.
Get Started →Take our 60-second quiz to get personalized tool recommendations
Find Your Perfect AI Stack →Explore 20 ready-to-deploy AI agent templates for sales, support, dev, research, and operations.
Browse Agent Templates →