Skip to main content
← Frameworks

AG2

ag2ai
Orchestration framework Python Open source Apache-2.0 Multi-agent Role assignments Subagents HITL human-in-the-loop Sandbox Event-driven Workflows Persistence Long-term memory Context compression MCP A2A Local models Ollama Multiple backends 8 axes checked Active Checked 2026-10-23

Read the two badges separately: the first is whether this page is backed by evidence, the second is whether the product is still maintained. An archived product can have complete evidence; complete evidence does not mean the product is active.

30-second check: should it make your shortlist?

In one line

The community continuation of AutoGen after the original repo stalled. The repository…

How you use it

Local / self-hosted · Framework / SDK

Licence / commercial use

Open licence

Read the original licence before commercial use
Mainland China

Direct in mainland · Not in filing list

These four cards help you rule things out, not decide for you. The real differences are in the eight questions and sources below.

Information not confirmed

  • Framework-level default file-access boundaries and container-level isolation (not stated officially)
  • Hosting options and resume-after-crash semantics in crash scenarios (not stated officially)
  • Tool calling / structured output reliability comparison across providers (not stated officially)
  • A2A implementation details in AG2 v1.0 (the official repository topics include a2a; the 2026-10-08 pass did not capture a dedicated page)
  • The full command-allowlist semantic boundary of the restricted shell (the official docs give allowed/readonly/blocked three tiers; details need measured runs)
  • The long-term parallel-maintenance policy of the Classic line vs v1.0 (officially only "remains maintained") Verification sources per item:
  • file-access boundaries and container isolation, hosting options: network/overview and agent_harness pages checked
  • reliability after switching providers: beta/model_configuration and the Grok compatibility page checked

AG2 is an open-source Python framework for building AI agents and coordinating multiple agents to solve tasks, with "agents capable of interacting with each other," broad LLM support, tooling, autonomous and human-in-the-loop workflows, and multi-agent conversation patterns. It is the community continuation of AutoGen: as of v1.0 the protocol-driven framework became the top-level package (import ag2), while the classic framework (ConversableAgent, GroupChat, import autogen) moved to its own repository, ag2ai/ag2-classic. Officially, "AG2 v1.0 (pip install ag2) is not a drop-in upgrade from Classic. The agent model, orchestration, and imports all changed." v1.0 orchestrates agents through the Network — a Hub that owns the registry, write-ahead log, and audit trail, with agents talking over typed channels — and exposes an opt-in harness of composable primitives (assembly=, knowledge=, tasks=). It is licensed Apache-2.0 and runs entirely in your own process (no managed hosting), so the only cost is model calls, billed by whichever provider you install.

When to use it, when not to

Orchestrating multi-agent conversations / a protocol-driven network in Python (Hub + channels, with consulting, discussion, and workflow adapters) Needing auditable durable messaging (write-ahead log, audit trail) and cross-process deployment (WsLink) Running on local models (Ollama / vLLM / LM Studio) Needing HITL and a restricted shell tool; MCP and AG-UI integration Preferring opt-in, composable harness primitives

Not a fit for expecting pip install ag2 to still be the classic AutoGen API (since v1.0 those classes live in ag2-classic); needing a vendor-managed backend (it is a pure library — you run the process); needing out-of-the-box container-level sandboxing (officially you get a restricted-shell allowlist, not a container); or non-Python stacks (there is no official non-Python port).

China availability domestic / direct access / CAC filing · snapshot 2026-10-23

Origin
foreign-made foreign entity (no matching filing entity in the CAC registry).
Direct access
direct OK official site measured 200 direct.
CAC filing
not in filing list:not in the CAC public registry (13 batch attachments searched 2026-10-20, https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm); the product does not serve the mainland public, so filing does not apply.

Filing status is quoted from the CAC public registry (updated batch by batch; this site copies the number and does not interpret it). "Direct access" is this site's own reachability measurement from a mainland network, not a vendor promise. GitHub-hosted sites fluctuated on the measurement day — the note says so.

8 questions, one table

8 questions, each comparable item by item with its peers.

Model & openness

The provider list is explicit, type-safe config classes, covering both cloud and local paths.

Official beta/model_configuration page wording:

"The AG2 framework provides an explicit, predictable, and type-safe way to configure Large Language Models"

One Config class + one extra per provider:

  • OpenAIConfig / OpenAIResponsesConfig (ag2[openai])
  • AnthropicConfig (ag2[anthropic])
  • GeminiConfig / VertexAIConfig (ag2[gemini])
  • BedrockConfig (ag2[bedrock])
  • OllamaConfig (ag2[ollama])
  • DashScopeConfig (ag2[dashscope])
  • XAIConfig (ag2[xai])
  • ZAIConfig (ag2[zai])

Local / self-hosted support is explicit.

The official docs have a dedicated section "Self-Hosted and OpenAI-Compatible Models (vLLM, LM Studio, etc.)", via OpenAIConfig's base_url. The README also lists ag2[ollama].

Bedrock switched to the native async client aiobotocore in v1.1.1. The official release marks it breaking.

Unknown — how tool calling / structured output reliability compares across providers, not stated officially (beta/model_configuration and the Grok compatibility page checked).

Where it runs

A pure Python library, async throughout, no hosted service.

README wording:

"AG2 requires Python version >= 3.10"

"AG2 is async throughout. Agent.ask(...) starts a turn and returns an AgentReply"

Install is pip install ag2[openai].

The official docs give two scheduling links for multi-agent form (network/overview page):

  • default LocalLink — official description:

"same-process duplex queues"

i.e. hub + agents inside one process.

  • switch to WsLink — official description:

"the hub and each agent as separate OS processes connected over WebSocket"

i.e. the hub and each agent live in separate OS processes.

When switching links the HubClient API is unchanged; no business-code changes needed.

It does not operate an agent loop.

Everything in the library runs on your own process / host; the official docs offer no hosted offering.

Local files

The framework ships no general-purpose file tools. File capability comes from KnowledgeStore and the sandboxed shell tool.

The latter's boundaries are written more clearly than most peers — the single most notable thing about this object.

① Disk knowledge store.

The official harness example uses DiskKnowledgeStore(Path("./knowledge_demo")), official comment:

"Disk-backed, so anything the agent remembers survives the process exiting"

i.e. where knowledge lands on disk is decided by the directory you specify.

② Restricted shell (verified, see official release v1.1.1).

Restricted mode "runs commands without a shell".

When SandboxShellTool / ShellAdapter gets allowed=[...] or readonly=True, it splits the command into argv. Then it checks only the argv and executes it verbatim:

Official wording: "Nothing can expand after the check"

Pipes / redirection / wildcards / variables are rejected in restricted mode.

  • readonly=True allows only non-writing commands that launch no other programs
  • blocked=[...] officially stated plainly:

"remains best-effort. It is not a security boundary."

Unknown — framework-level default file-access boundaries and container-level isolation, not stated officially (network/overview, agent_harness and the release page checked).

Tasks after shutdown

"Still running after shutdown" is pure-library form on this site — there is no hosted background.

But the durable messaging mechanism has an explicit official implementation. The Network capabilities listed on the network/overview page include:

"Durable messaging with replayable channel transcripts (write-ahead log)"

"Distributed / cross-process deployment: replace LocalLink with WsLink"

The hub holds authoritative state: registry, audit log, channel table, write-ahead logs. Clients are:

"thin frontends"

There is also a dedicated Distributed Deployment page.

It covers WsLink, serve_ws, auth, at-least-once delivery, reconnect and task durability.

Long-term memory can survive across processes. DiskKnowledgeStore persists to disk, see the local_files axis.

But there is no vendor-hosted offering at all.

Processes must run on your own servers; a true background needs your own containers / K8s.

Unknown — hosting options and the exact semantics of resume-after-crash, not stated officially (network/overview page checked).

Tools & extensions

Tools, MCP and AG-UI are all verifiable from official sources; A2A is only seen in repository topics.

① Native tools.

A plain Python function with the @tool decorator becomes a tool. Official wording:

"AG2 runs the full tool-calling loop: the model decides when to call it, AG2 executes it, and the result is fed back"

Agents can also be used as tools by other agents via Agent.as_tool().

② MCP.

Official releases record ongoing maintenance of MCPToolkit and MCPServerTool:

  • v1.1.1 "send exactly one Authorization header on every provider"
  • v1.1.2 "fix(mcp): derive model output schemas from serialization"

③ AG-UI.

  • v1.1.2 "feat(ag-ui)!: serve AG-UI 1.0"
  • v1.1.1 supports "Human input over AG-UI" (questions via context.input() inside tools are raised as interrupts to the AG-UI client)

④ Skills.

Official releases contain skill-related fixes:

  • "check local skill ownership before validating arguments"
  • "execute nested scripts from declared paths"

A2A can currently only be seen in the official repository topics (including a2a).

This pass did not capture the body of a v1.0 A2A dedicated page, so it is not expanded.

Subtask delegation has separately auto-injected run_subtask / run_subtasks tools (see the context axis).

Context & memory

This is the AG2 design that best matches this site's "state ≠ context" stance.

It explicitly splits the harness into three groups of opt-in primitives.

Official agent_harness page wording:

"A bare Agent is just a model loop. The harness is the set of opt-in primitives you compose onto it"

Three key parameters:

  • assembly= (context policy) — official examples include WorkingMemoryPolicy (injects memory/working.md into the system prompt), SlidingWindowPolicy(max_events=50) (caps history usage), AlertPolicy
  • knowledge= — KnowledgeConfig(store=..., compact=..., compact_trigger=..., aggregate=...), with SummarizeCompact / TailWindowCompact doing context compaction (README example "18 -> 3 events"); write_event_log dumps stream history to /log/{stream_id}.jsonl
  • tasks= (off by default) — when enabled, subtask tools are auto-injected; sub-Agents inherit parent tools by default, and subtasks themselves have tasks=False, official wording:

Official wording: "recursive delegation is structurally impossible"

The boundary is clear: compact= governs window compaction.

KnowledgeStore governs cross-process persistent memory — the official docs describe the two separately.

Permissions & limits

The official mechanisms come in two layers: HITL human review + restricted shell tools. Neither layer equals a container sandbox.

① HITL.

README wording:

  • calling context.input(...) inside a tool pauses the run to ask a human
  • hitl_hook decides where the answer comes from (CLI / web UI / queue)

② Tool approval.

Release v1.1.1 states plainly:

"Approval grants are keyed by tool implementation"

and only one same-named tool is exposed per turn.

MCP-discovered tools rank below code-declared tools and cannot override local tools.

③ Restricted shell.

SandboxShellTool's allowed / readonly / blocked — see the local_files axis. The official docs themselves declare blocked=[...] not a security boundary.

v1.1.2 also fixed a shell command-filter bypass vulnerability (GHSA-42mf-vpmr-gw5r).

④ Data-interface security note.

Official docs warn that Redis's Serializer.PICKLE hands code-execution capability to anyone who can write that stream.

The advice is to use only fully trusted Redis; JSON is the default.

Unknown — framework-level process / container sandbox defaults, not stated officially (agent_harness and release pages checked).

Best for

Fits.

  • orchestrating multi-agent conversations / protocolized networks in Python (Hub + channel, with consulting, discussion, workflow adapters)
  • needing auditable durable messaging (write-ahead log, audit trail) and cross-process deployment (WsLink)
  • running on local models (Ollama / vLLM / LM Studio)
  • wanting HITL and restricted shell tools
  • needing MCP and AG-UI integration
  • preferring opt-in, composable harness primitives

Does not fit.

  • expecting pip install ag2 to still be the old AutoGen API (since v1.0 the classic classes moved into ag2-classic)
  • needing a vendor-hosted background (pure library, processes are your own)
  • needing out-of-the-box container-level sandbox isolation (the official offering is a restricted-shell allowlist, not containers)
  • non-Python stacks (no official non-Python port)

Licence and terms of use

Apache-2.0

Top misconception

  • Assuming pip install ag2 is still classic AutoGen — since v1.0 ConversableAgent / GroupChat / import autogen all moved to the ag2-classic package
  • Assuming ag2 is a smooth upgrade from autogen — officially v1.0 is not a drop-in upgrade; the agent model, orchestration, and imports all changed
  • Assuming it is a Microsoft-official project — it is maintained by community volunteers (ag2ai), a different line from Microsoft's Microsoft Agent Framework
  • Assuming blocked=[...] is a security boundary — officially it is only best-effort; isolation in the restricted shell comes from the allowed allowlist and readonly

Evidence sources

Checked 2026-10-23,Content updated 2026-10-08。This is the date of the entry, not a claim that every field was rechecked that day.

TypeNameLink
repoag2ai/ag2 · repository (5,011★, Apache-2.0, pushed_at 2026-10-22, topics include mcp/a2a/ag2, rolling check 2026-10-23)https://github.com/ag2ai/ag2
docsMain README (AG2 v1.0 vs AG2 Classic split, Agent/tools/HITL/Network/harness concepts, Apache-2.0 statement)https://github.com/ag2ai/ag2/blob/main/README.md
docsOfficial docs · Network Overview (Hub + channel, four adapters, LocalLink/WsLink, write-ahead log, audit trail, HumanClient)https://docs.ag2.ai/docs/user-guide/network/overview/
docsOfficial docs · Agent Harness (assembly= / knowledge= / tasks= primitive groups, compaction, recursive delegation impossible, turn lifecycle)https://docs.ag2.ai/docs/user-guide/agent_harness/
docsOfficial docs · Model Configuration (provider Config classes and extras list, self-hosted OpenAI-compatible, Vertex/Z.AI/Bedrock auth)https://docs.ag2.ai/latest/docs/beta/model_configuration/
docsOfficial docs · Grok & OpenAI-API-Compatible (xAI via the OpenAI client, function calling and structured output)https://docs.ag2.ai/latest/docs/user-guide/models/grok-and-oai-compatible-models/
docsAG2 Classic docs · LLM Configuration (classic line's provider list: OpenAI/Anthropic/Gemini/Bedrock/Mistral/Cerebras/Together/Groq + local Ollama/LiteLLM/LM Studio)https://classic.docs.ag2.ai/latest/docs/user-guide/basic-concepts/llm-configuration/
changelogReleases (latest v1.1.2 @ 2026-10-03; v1.1.1 includes restricted shell and tool-approval changes, GHSA-42mf-vpmr-gw5r fix, Bedrock switch to aiobotocore)https://github.com/ag2ai/ag2/releases
repoag2ai/ag2-classic · the classic framework's separate repository (pip install ag2-classic, import autogen, still maintained)https://github.com/ag2ai/ag2-classic

Test notes

This site has not completed measured runs.

The test protocol is at protocols/framework/_protocol.md.

Suggested measurement (tailored to the orchestration-framework + multi-agent-conversation dimensions):

#What to testWhy it is worth testing
1Effort to port a piece of classic GroupChat code using WorkflowAdapterverifies the official "closest to GroupChat" claim
2Switching LocalLink to WsLink cross-process deployment — does business code really stay unchangedthe official promise is the HubClient API stays the same
3Usability of the restricted shell (allowed/readonly) under a realistic command setstronger security often costs usability; the boundary needs measuring
4Attach Ollama and run a multi-agent network, observing token and latency overheadthe real cost of local models + multi-agent
5DiskKnowledgeStore + compaction across two runs, verifying cross-process memory really worksthe README example claims it remembers after restart
6The breaking-change surface of the two consecutive v1.1.x releasesfast iteration; selection needs quantified upgrade risk

A version fault line that must be made clear: AG2 v1.0 split out Classic

The README top uses a prominent notice:

Looking for ConversableAgent, GroupChat, or import autogen? That's now AG2 Classic.

Since v1.0, the classic framework moved wholesale to the separate repository ag2ai/ag2-classic.

  • classic line: pip install ag2-classic, import autogen, docs at classic.docs.ag2.ai
  • new top-level package: pip install ag2 is now the protocol-driven new framework

The classic line is still maintained; existing code does not stop working.

The new top-level package no longer ships the autogen import name or the classic agent classes.

The official wording on the upgrade path is blunt:

AG2 v1.0 (pip install ag2) is not a drop-in upgrade from Classic. The agent model, orchestration, and imports all changed.

So the answer to "is AG2 the new AutoGen" is: same lineage.

But v1.0 is not a lift-and-shift upgrade.

Multi-agent orchestration: Network (Hub + channel)

v1.0 uses Network to replace the classic GroupChat / swarm / nested chat:

a Hub that owns the registry, the write-ahead log, and the audit trail, with agents talking over typed channels.

The official wording is explicit:

"This replaces the classic GroupChat / swarm / nested-chat patterns."

Four built-in channel adapters:

AdapterParticipantsSpeaking orderTermination
conversationexactly 2free (either side at any time)explicit close or TTL
consultingexactly 2strict question-answerauto-closes after the answer
discussion2+round-robinexplicit close or TTL
workflow2+declarative TransitionGraphgraph termination

Of these, the official docs call workflow "the closest counterpart to the classic GroupChat".

For deployment the default is LocalLink (same process). Switching to WsLink goes cross-process / cross-host with business code unchanged.

The harness: three groups of opt-in primitives, landing exactly on "state ≠ context"

Official agent_harness page wording:

A bare Agent is just a model loop. The harness is the set of opt-in primitives you compose onto it.
ParameterRoleCorresponding dimension on this site
assembly=context policy: WorkingMemoryPolicy / SlidingWindowPolicy / AlertPolicycontext
knowledge=KnowledgeStore + SummarizeCompact / TailWindowCompact compaction + aggregationlong-term memory + context compaction
tasks=subtask delegation (off by default), sub-Agent tasks=False, recursion impossiblesubagents

This boundary is clean: compaction (compact=) governs window usage.

The knowledge store (KnowledgeStore) governs cross-process persistent memory.

Permissions: HITL + restricted shell, but not a container sandbox

  • HITL: context.input(...) inside a tool pauses the run to ask a human; hitl_hook decides the answer source.
  • Tool approval: official v1.1.1 states approvals are keyed by "tool implementation", and only one same-named tool is exposed per turn.
  • Restricted shell: SandboxShellTool's allowed=[...] / readonly=True split the command into argv, then check only the argv and execute verbatim.

Official wording:

"Nothing can expand after the check"

The official docs also declare of blocked=[...]:

"best-effort. It is not a security boundary."
  • v1.1.2 fixed a shell command-filter bypass vulnerability (GHSA-42mf-vpmr-gw5r), showing this class of tool's security surface needs watching across releases.

Note: this is not container isolation — the official offering is an allowlist and read-only mode.

One more data-interface note.

With Serializer.PICKLE, anyone who can write that Redis stream gains code-execution capability.

The official advice: use only fully trusted Redis; JSON is the default.

Verification notes

Basis for confidence: partial:

Why not verified: the 2026-10-08 pass verified the v1.0-vs-Classic split, the Network Hub/channel abstraction, the three harness primitive groups, the provider list (including local models).

The restricted shell and tool-approval mechanisms are also verified. The release cadence (v1.1.1 / v1.1.2) was verified the 2026-10-08 pass too.

But several items are genuinely not given officially:

  • framework-level default file-access boundaries and container-level isolation
  • hosting options and crash-resume semantics
  • tool calling / structured output reliability after switching providers
  • A2A implementation details in v1.0 (only seen in repository topics)

Plus fast version iteration (two releases within days), so it is not enough to raise to verified.

Official pages checked the 2026-10-08 pass: repository and README, network/overview, agent_harness, beta/model_configuration, the Grok compatibility page, the classic line's LLM Configuration page, the releases page, the ag2ai/ag2-classic repository.

Verified metadata: repository exists, ★5,011 (rolling check 2026-10-23), license Apache-2.0 (via the license API), last push 2026-10-22 (still active), latest version v1.2.1 (releases @ 2026-10-21).

Related entries

  • Microsoft Agent FrameworkSame-lineage divergence: AG2 is the community continuation of AutoGen; MAF is Microsoft's official successor merging AutoGen with Semantic Kernel. The AutoGen sunset recorded by this site's harness section is why these two branches are collected separately.
  • CrewAIAbstraction-level contrast: CrewAI uses the business metaphors of Crew (roles/goals/tasks) / Flow. AG2 v1.0 uses the protocolized abstraction of Network (Hub + typed channels). One leans toward team roles, the other toward message protocols and governance.
  • Google ADK(Agent Development Kit)Orchestration and HITL contrast: ADK is a graph execution engine + tool-level confirmation. AG2 is a Hub/channel network + context.input() human review. Both provide state persistence, but at different granularity and semantics.
  • Filesystem MCP ServerOther layer · MCP tools

Same-category peers

Look at these three before reading further

Selected by overlap in jobs, not ranked. Compare where it runs, licence and status first; if one of the three fails, skip it.

ObjectWhereLicenceEvidence / statusWhat it is for
CrewAILocal / self-hostedOpen licence8 questions checked
Active
"Organises multi-agent collaboration through role division and business
Google ADK(Agent Development Kit)Cloud / APIOpen licence8 questions checked
Active
In one line: Google ADK is a code-first agent orchestration framework wh
Hermes AgentLocal / self-hostedOpen licence8 questions checked
Active
A resident personal assistant with a learning loop — put plainly: a resi

This page is generated from the ai-handbook data layer (CC BY 4.0). For the judging criteria and method notes, see METHODOLOGY.md.