LangChain
Agent engineering platform for building LLM applications from composable parts
A Python framework for building AI agents and multi-agent systems, the successor to AutoGen.
Made ag2? Claim it to edit the listing and see how many people view it. Sign in to claim
AG2 is an open-source Python framework for building AI agents and getting several agents to cooperate on tasks. It is for developers who want a typed, async agent toolkit and who know the project formerly as AutoGen.
It is written in Python, uses the Apache-2.0 license, and has about 5,000 stars. The README says a volunteer group from several organizations maintains it.
Table of contents
AG2 gives you an Agent class, tools the agent can call, human-in-the-loop controls, and a way to orchestrate multiple agents. The README calls it an open-source AgentOS for AI agents. Everything is async, and a call to Agent.ask(...) returns an AgentReply whose text is in reply.body.
An important detail: this repository is AG2 v1.0, a rewrite. The old AutoGen-derived framework, with import autogen, ConversableAgent, GroupChat and swarms, now lives in a separate repository called ag2-classic. This repo no longer ships the autogen import name. In v1.0 the top-level package is ag2, and multi-agent work uses a Network model built from a hub and channels instead of group chats.
Agent as the main class.ag2[openai], ag2[anthropic], ag2[gemini], ag2[ollama] and others.OPENAI_API_KEY, ANTHROPIC_API_KEY and GEMINI_API_KEY, or passed explicitly per request.The topics on the repo also list A2A and MCP support, though the README sections reviewed here focus on the core agent model.
Install with the extra for your model provider. On Windows and Linux:
pip install ag2[openai]
On macOS, quote it:
pip install 'ag2[openai]'
Set your key:
export OPENAI_API_KEY="<your-api-key>"
Then follow the Quick Start in the docs at docs.ag2.ai, where the README shows an async example using Agent and a provider config such as OpenAICompletionsConfig(model="gpt-4o-mini"). If your code already imports autogen, do not upgrade to ag2>=1.0. The README says to stay on Classic and pin the classic distribution:
pip install ag2-classic
AG2 fits Python developers building agent workflows, especially ones that need several agents to hand off work, and teams with existing AutoGen code who want a maintained path. It also suits researchers who want an open framework to modify.
Skip it if you have a working AutoGen project and no reason to rewrite, because v1.0 is not a drop-in upgrade. The agent model, orchestration and imports all changed. Skip it if you want a visual builder or hosted service, since this is a code library. Because the rewrite is recent, expect docs and community examples to mix v1.0 and Classic, and check which one a tutorial uses.
Widely known alternatives include CrewAI, LangGraph and the OpenAI Agents SDK. They differ in orchestration style: CrewAI uses roles and crews, LangGraph uses explicit graphs, and AG2 uses a network of agents. AgentOps, an observability SDK, lists AG2 among its integrations. See AG2 alternatives and the AI repos directory.
AG2 is Apache-2.0 and free. You pay your model provider for tokens. The README gives support contact addresses for the project administrators but lists no paid plan.
AG2 is the continuation of the project formerly known as AutoGen. The old namespace now lives in ag2-classic, and v1.0 in this repo is a redesign.
Not directly. The README says v1.0 is not a drop-in upgrade, and tells Classic users to pin ag2-classic instead.
Python 3.11 or newer.
The README names OpenAI, Anthropic, Gemini and Ollama as install extras, and says there are others.
Through Network, a hub-and-channels model that replaces the old GroupChat approach.
Agent engineering platform for building LLM applications from composable parts
Agent harness optimisation for Claude Code, Codex, OpenCode and Cursor
Self-improving agent from Nous Research that learns across sessions
Small, composable agent skills from Matt Pocock's daily .agents directory