AG2 (framework)
Last reviewed
May 20, 2026
Sources
No citations yet
Review status
Needs citations
Revision
v1 ยท 3,694 words
Improve this article
Add missing citations, update stale details, or suggest a clearer explanation.
Last reviewed
May 20, 2026
Sources
No citations yet
Review status
Needs citations
Revision
v1 ยท 3,694 words
Add missing citations, update stale details, or suggest a clearer explanation.
AG2 (formerly AutoGen) is an open-source Python framework for building applications composed of multiple cooperating large-language-model (LLM) agents. The project is a community-governed continuation of the original AutoGen library that began as a Microsoft Research project in 2023. In November 2024 the framework's two academic founders, Chi Wang and Qingyun Wu, established an independent organization called AG2AI to host development outside Microsoft, renamed the community project AG2, and continued shipping the familiar 0.2-era ConversableAgent API. Microsoft's official AutoGen project continued in parallel as a separate codebase, culminating in the architecturally re-designed AutoGen 0.4 and, later, the unified Microsoft Agent Framework.[^1][^2][^3]
AG2 is distributed under the Apache 2.0 license from version 0.3 onward and is published on the Python Package Index under three interchangeable names (ag2, autogen, and pyautogen). It is one of several prominent open-source agent frameworks alongside CrewAI, LangGraph, Agno, Semantic Kernel and the OpenAI Agents SDK, and is notable as one of the few significant open-source AI projects to have undergone a public, contributor-led fork away from a major industrial sponsor.[^1][^4]
The framework that became AG2 began life in 2023 as AutoGen, an open-source library released by researchers at Microsoft Research, Pennsylvania State University, the University of Washington and Xidian University. The associated paper, AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework, was posted to arXiv on 16 August 2023 with Qingyun Wu, Gagan Bansal, Jieyu Zhang, Yiran Wu, Shaokun Zhang, Erkang Zhu, Beibin Li, Li Jiang, Xiaoyun Zhang and Chi Wang as authors.[^5]
AutoGen's central idea was conversable agents: rather than a single LLM call returning a final answer, an application would be expressed as a structured conversation among multiple agents (assistants, user proxies, code-running agents, tool-using agents), each with its own system prompt and reply-generation logic. The repository attracted rapid uptake on GitHub, was awarded best paper at the ICLR 2024 LLM Agents Workshop, and was widely cited as one of the most influential early agent frameworks. By mid-2024 the original pyautogen PyPI package and the microsoft/autogen repository together formed one of the most popular agent stacks in the Python ecosystem.[^5][^1]
In September 2024 several of AutoGen's original creators, including project lead Chi Wang and academic co-author Qingyun Wu, left Microsoft Research. Wang subsequently joined Google DeepMind as a senior staff research scientist; Wu, a faculty member at Pennsylvania State University, remained in academia.[^1][^6] On 11 November 2024 they announced the formation of the AG2AI organization on GitHub and moved the project they had been leading to a new repository at github.com/ag2ai/ag2. The codebase was forked from AutoGen 0.2 and the project was renamed AG2. From v0.3 onward AG2's modifications were placed under the Apache 2.0 license while original Microsoft-authored code retained its MIT license, so the released artifact is a dual-licensed source tree.[^1][^7]
The split was unusually visible because both groups continued to use the AutoGen name and several shared distribution channels. Within days of the rename, two parallel statements appeared:
microsoft/autogen GitHub Discussions, writing that "the official GitHub repository for the AutoGen project is still github.com/microsoft/autogen/" and noting that "the current version of pyautogen is not affiliated with the microsoft/autogen project" because admin access to the package on PyPI was "currently blocked" for the Microsoft team. The post also acknowledged "unfortunate confusion about forks, changes in access to pypi packages, and blocked permission for participation".[^8]pyautogen, autogen and ag2 PyPI packages.[^9]Both sides have generally been measured in their public statements. The community-facing summary in Qingyun Wu's blog post AG2's Vision for Community-Driven Agent Development describes the move as a way to "keep it community-driven and maintain the architecture you're familiar with" and to set up an organization "with open governance" outside any single corporate sponsor, while Microsoft's communications emphasize continued, separately-staffed development of AutoGen at the original repository.[^7][^8][^9]
The following dates are drawn from the AG2 GitHub releases, Microsoft's AutoGen blog and the founders' announcements. They are presented to clarify the sequence rather than to adjudicate any dispute.
microsoft/autogen.[^5]github.com/ag2ai/ag2 and renamed AG2.[^1][^7]autogen.beta module is slated to become the official AG2 API at v1.0.[^15][^16]AG2 is governed by AG2AI, an organization announced on 11 November 2024 to host the project "with open governance".[^7] Chi Wang and Qingyun Wu serve as administrators and primary contacts, and they continue to co-teach a DeepLearning.AI short course on agentic design patterns based on the framework. The published maintainer roster lists about twenty active maintainers drawn from Google, IBM, Meta, Pennsylvania State University, the University of Washington and several other organizations; new contributors can earn maintainer status and seats on a Technical Steering Committee on the basis of contributions.[^1][^7]
AG2AI is also incorporated as a commercial entity that the founders use to pursue sustainability for the open-source project. According to Wu's vision post, planned revenue sources include an agent marketplace, hosted platform infrastructure and enterprise licensing for proprietary add-ons, while the framework itself "will always be free and community-driven" under Apache 2.0. The phrase AG2 Labs is occasionally used in community communications to refer to research and incubation work conducted under AG2AI, but it is not a separate legal entity in the AG2 public documentation as of 2026.[^7]
The PyPI namespace remained an issue through the transition. AG2AI retained admin control over the autogen and pyautogen packages (which had been administered by the founders before they left Microsoft) as well as the new ag2 distribution and the original AutoGen Discord server of more than 20,000 members. Microsoft's parallel project ships under the separate autogen-agentchat, autogen-core and autogen-ext distributions and uses a fresh community presence.[^1][^7][^8]
AG2 preserves and extends the core architecture that AutoGen 0.2 popularized. The framework is organized around a small number of agent base classes, several orchestration patterns, a tool/function-calling layer and a set of code-execution backends.
The fundamental building block is ConversableAgent, the base class for all agents in the framework. A ConversableAgent encapsulates a system prompt, an LLM configuration, a set of registered tools and a customizable reply-generation pipeline. Specialized subclasses such as AssistantAgent (a default chat assistant), UserProxyAgent (which represents a human user and can optionally execute code) and GPTAssistantAgent (which delegates to OpenAI's Assistants API) inherit from ConversableAgent. Each agent maintains a per-peer conversation history and exposes hooks for pre- and post-processing of messages, enabling features like guardrails, transcript redaction and structured output enforcement.[^4][^17]
For multi-agent coordination, AG2 provides GroupChat, a shared conversation in which several ConversableAgent instances participate. A GroupChatManager selects which agent speaks next on each turn, using either an LLM-based selector, a round-robin strategy, a random strategy or a manual human-driven choice. The group-chat abstraction is the canonical entry point for orchestrating teams of agents in AG2 and is the basis of every higher-level pattern in the library.[^17][^18]
Earlier AutoGen versions introduced a separate Swarm pattern modeled on the handoff abstraction from OpenAI's Swarm educational framework: agents could declare AfterWork and OnCondition handoffs that transferred control to another agent on completion of a tool call or based on context. AG2 v0.9, released on 28 April 2025, unified Swarm and Group Chat into a single, more configurable Group Chat system with five orchestration modes (Auto, RoundRobin, Random, Manual, Default), an enhanced handoff system supporting both LLM-based and context-based conditions, flexible transition targets and a ContextVariables class for structured state that is shared across all agents in the group. The legacy swarm module remains available in 0.9 and 0.13 but is deprecated and slated for removal.[^13]
Agents in AG2 expose external capabilities through tools: ordinary Python functions registered against an agent's tool registry. The framework integrates with OpenAI-style function calling, supports parallel tool calls on providers that allow it, and offers a higher-level tools package with built-in helpers for tasks such as web search, browser automation and code execution. A tools with secrets mechanism allows credential material to be supplied to a tool at call time without ever appearing in the LLM-visible conversation transcript. Structured outputs are supported through Pydantic schemas, including ResponseSchema-based structured output that constrains LLM responses to a typed shape.[^4][^17]
Code execution is a first-class concern, reflecting the framework's roots in tool-using assistants. AG2 provides several executor classes that can be attached to a UserProxyAgent or used directly by other agents:
LocalCommandLineCodeExecutor runs code blocks in the local shell. The default working directory is a sandboxed scratch folder, but the executor can read and write the wider filesystem and is recommended only for trusted environments.DockerCommandLineCodeExecutor runs each code block inside a Docker container, isolating the execution from the host. Since January 2024 Docker execution has been the recommended default in the documentation, on the grounds that LLM-generated code should not be trusted to run unconfined.[^19]JupyterCodeExecutor runs code statefully against a long-lived Jupyter kernel (local or remote), preserving variables between calls and enabling notebook-style data-analysis workflows.[^20]CustomExecutor interface allows users to plug in their own sandboxing layer, for example to delegate execution to a remote container orchestrator or a cloud sandbox.[^21]AG2 ships RAG support through RetrieveUserProxyAgent and a companion RetrieveAssistantAgent, which extend the user-proxy and assistant abstractions with vector search over a configurable corpus. The framework supports several vector backends including Chroma, Qdrant, MongoDB Atlas Vector Search and PostgreSQL pgvector, and exposes a higher-level Knowledge interface on the path to v1.0 that abstracts knowledge stores from the agents that consult them. RAG-enabled agents can be dropped into the same GroupChat as ordinary agents and are commonly used for question-answering over codebases, technical manuals and internal documentation.[^17]
Beyond the base classes AG2 publishes a growing set of reference agents that demonstrate non-trivial patterns built on the core. Notable examples include the DeepResearchAgent, an OpenAI Deep Research-style agent that breaks complex research prompts into sub-tasks and synthesises answers across multiple web sources, and the experimental RealtimeAgent, which orchestrates a swarm of agents during a live OpenAI Realtime voice or video session.[^22][^23]
The AG2 release roadmap describes a deliberate migration from the original autogen Python module to a new autogen.beta module that will become the official surface at v1.0. The v0.12 line introduced deprecation notices for legacy APIs; v0.13, released on 13 May 2025, is described as the transition release and is the last in which deprecated features remain available; v0.14 is planned to remove the deprecated APIs and promote autogen.beta to release-candidate status; and v1.0 will replace the original ConversableAgent with a new Agent class, move the legacy code to a maintenance-only ag2-original branch and add first-class native multimodal support.[^15][^16]
The most direct point of comparison for AG2 is the line of work that Microsoft continued after the split.
AutoGen 0.4, released on 17 January 2025, is a complete redesign of the original AutoGen 0.2 codebase. It abandons the synchronous, conversation-centric programming model in favor of an event-driven actor runtime, with messages passed asynchronously between agents that can live in different processes and even different programming languages (Python and .NET are supported). The library is split into three layers: a low-level autogen-core actor framework, a higher-level autogen-agentchat API for two-agent and group chats and a plug-in autogen-ext ecosystem. AutoGen Studio, a no-code GUI, and Magentic-One, a generalist multi-agent system in which a lead Orchestrator directs a WebSurfer, FileSurfer and Coder, were rebuilt on top of the new core.[^11][^12]
AG2, by contrast, preserves the conversational, in-memory programming model that AutoGen users were familiar with. Existing AutoGen 0.2 applications can be ported to AG2 by changing the package name; in many cases code written against pyautogen==0.2.x runs unmodified on AG2's autogen namespace. The core engine has been substantially extended (new orchestration modes, a richer tools framework, the path to a new Agent class) but the underlying mental model of ConversableAgents exchanging structured messages is intact. The result is that AG2 occupies a different design point: less ambitious about distributed scale-out, but easier to reason about and faster to iterate on at small scale.[^4][^15]
On 1 October 2025 Microsoft announced the Microsoft Agent Framework, an open-source SDK that combines AutoGen 0.4's orchestration runtime with Semantic Kernel's enterprise primitives (session-based state, type safety, middleware, telemetry, native Azure AI Foundry integration). The framework released a production-ready 1.0 on 3 April 2026. AutoGen and Semantic Kernel were both moved into maintenance mode at that point, with new feature work concentrated on the unified platform. AG2's roadmap continues independently, and the framework's design point (community-governed, light-weight, conversational, Python-first) is now noticeably distinct from Microsoft's enterprise-oriented unified platform.[^14][^24]
In short: AG2 is the closest current heir to the API and ergonomics of the original AutoGen 0.2; Microsoft Agent Framework 1.0 is the production-ready synthesis of the actor-model rewrite and Semantic Kernel's enterprise scaffolding; and the standalone microsoft/autogen repository is community-maintained with bug fixes and security patches only.[^14][^15]
AG2 sits in a crowded ecosystem of open-source agent frameworks released between 2023 and 2026. The comparisons below are based on each framework's primary design point as documented by its maintainers; they are simplifications and ignore considerable feature overlap.
The AG2 documentation has also begun to frame the project as an AgentOS and an orchestrator in its own right, capable of coordinating heterogeneous teams that include agents written for other frameworks (Google's ADK, the OpenAI Agents SDK, LangChain) via standardized protocols such as A2A and the Model Context Protocol. This is a positioning move rather than a sharp technical difference, but it captures the framework's continued emphasis on multi-vendor, multi-framework interoperability.[^3][^15]
AG2 is distributed under the Apache License 2.0, adopted from version 0.3 onward as part of the move to the AG2AI organization in November 2024. Code inherited from the original Microsoft AutoGen repository remains under its original MIT license, and the AG2 source tree is therefore a dual-licensed work. Apache 2.0 governs new code added by the AG2 community, while the MIT-licensed Microsoft code retains its original headers. The combination is compatible because both licenses are permissive and Apache 2.0 is a strict superset in terms of obligations on downstream users.[^4][^7]
Documentation is published at docs.ag2.ai and includes user guides, an API reference, notebook-style use-case examples, a versioned blog used to announce releases, and the Release Roadmap that describes the v1.0 transition. The framework is developed openly on GitHub at github.com/ag2ai/ag2, with public Discord-based discussion at discord.gg/sNGSwQME3x and a separate set of community office hours coordinated by the maintainers.[^3][^4][^15]
In addition to the framework itself, AG2's founders have produced public-facing teaching material on multi-agent design. The DeepLearning.AI short course AI Agentic Design Patterns with AutoGen, co-taught by Wang and Wu, remains a primary on-ramp to the conceptual model; later content under the AG2 name continues to use the same vocabulary of ConversableAgents, group chats and tool calls.[^1][^7]