🌏 中文版
Release Info
| Item | Value |
|---|---|
| Framework | AG2 (formerly AutoGen) |
| Version | v1.3.0 |
| Previous version | v1.2.2 |
| Released | 2026-11-04 |
| Release Notes | v1.3.0 |
| GitHub | ag2ai/ag2 |
| Stars | 5.0k |
Why this release matters
The moment multi-agent work involves delegation, two problems show up right away: the parent can't see what a child agent is doing, and when a child changes some shared variable, it's unclear whether the parent or its siblings should see that change too. AG2 used to leave both problems to the developer — want visibility, bolt on a callback that prints logs; want shared state, pass a reference around and hope nothing silently overwrites it. 1.3 turns both into first-class APIs: @observer lets events surface from a child at any depth without mixing into the parent's own reasoning context, and ScopedValue turns "should this variable be shared across nodes" into a declaration instead of a verbal agreement. The release also cuts: four older APIs are now deprecated and the Python floor moves to 3.11, consolidating a direction the last few releases had been building toward.
What changed
- Delegation-tree event observation:
@observer(ChildEvent)lets an ancestor agent receive every event emitted by any descendant — includingModelMessageChunkfrom streaming — without that event entering the ancestor's own model transcript or triggering its tools or model loop → build unified progress monitoring or live UI updates without polluting the parent agent's reasoning context - Events can be addressed back: an observed event carries
event.origin, andawait event.origin.send(...)delivers a message back to the exact delegation node that raised it, through that node's own normal handling path → a parent can actively intervene on a specific child instead of just passively listening in - Explicit variable scopes (
ScopedValue): addsScope.COPIED(deep-copied per branch, the default for plain values),Scope.LOCAL(not inherited by descendants), andScope.SHARED(one binding shared across the whole invocation tree) → when agents share state, which variables are shared and which stay isolated is declared upfront instead of discovered later while debugging an accidental shared reference - Descendant usage arrives in real time: original
UsageEventrecords now reach ancestors as they happen, preserving source identity, stage, model, and provider, with no more delegation rollups → billing and usage monitoring can attribute spend to the node that actually made the call, instead of reading one blurry total - Dynamic context before each model call (
statusbar_middleware): injects current state — progress, remaining steps, environment state — before every model call, with dependency-injection support;persist=Truekeeps those snapshots as service observations → no more cramming progress information into a prompt template - A shared task lifecycle: model runs, delegations, and standalone
Taskblocks now go through the same lifecycle transitions; passcapabilityorttl_secondstoask,run, orresumeto turn on lifecycle events (delegation enables them automatically);ttl_secondsis only an expiry deadline for an external observer, not a local execution timeout → monitoring systems can track different kinds of work through one consistent set of state transitions - Knowledge as a plugin (
KnowledgePlugin): bundles the store, the knowledge tool, bootstrap, and event logging into one plugin, replacing the settings that used to live scattered acrossAgent(knowledge=...)
- Worker streams a chunk, wrapped as ChildEvent, to the observer callback
- Observer callback handles the event in place, logs progress
- Worker finishes the delegation; the tool result goes straight to the model transcript
- Observer addresses a message back to Worker with event.origin.send()
Breaking Changes
TaskConfig,Agent(tasks=...),Agent.tasks, and the automatically injectedrun_subtask/run_subtaskstools → construct workers explicitly and delegate throughAgent.as_tool():- Affected: projects that use the
tasks=parameter to auto-generate subtask delegation need to rewrite before 1.4 removes it
- Affected: projects that use the
Agent(assembly=...)→ registerAssemblerMiddlewarethroughmiddleware=, and addHaltCheckMiddlewarealongsideAlertPolicy:- Affected: projects that assemble multi-agent flows with the assembly parameter
Agent(knowledge=...)→plugins=[KnowledgePlugin(...)]:- Affected: projects that pass knowledge settings directly in the
Agentconstructor
- Affected: projects that pass knowledge settings directly in the
Agent.task()→ constructTask(owner_id=..., spec=TaskSpec(...))directly:- Affected: code that calls
Agent.task()to create a standalone task
- Affected: code that calls
OpenAIConfigbecomes an alias forOpenAIResponsesConfigin 1.4; the official recommendation is to switch toOpenAIResponsesConfigorOpenAICompletionsConfigexplicitly now:- Affected: projects still using the
OpenAIConfigname will see its meaning shift once the alias lands in 1.4
- Affected: projects still using the
- Minimum Python version raised to 3.11:
- Affected: projects still on Python 3.10 must upgrade Python before installing AG2 1.3
Migration Guide
Upgrading from 1.2.2 to 1.3.0
pip install --upgrade ag2==1.3.0
# Old: Agent(tasks=...) auto-injects run_subtask / run_subtasks
agent = Agent(
"coordinator",
config=config,
tasks=[TaskConfig(worker_agent)],
)
# New: construct the worker explicitly, delegate through as_tool()
worker = Agent("worker", config=config, prompt="...")
coordinator = Agent(
"coordinator",
config=config,
tools=[worker.as_tool(description="Delegate to the worker")],
)
# Old: Agent(knowledge=...)
agent = Agent("assistant", config=config, knowledge=KnowledgeConfig(...))
# New: plugins=[KnowledgePlugin(...)]
from ag2.knowledge import KnowledgePlugin, MemoryKnowledgeStore
agent = Agent(
"assistant",
config=config,
plugins=[KnowledgePlugin(store=MemoryKnowledgeStore())],
)
Confirm the runtime is on Python 3.11 or newer before upgrading. Projects that don't touch tasks=, assembly=, knowledge=, or Agent.task() can upgrade as-is — the deprecation warnings don't change existing behavior.
How it compares to other frameworks
Neither CrewAI's role-based delegation nor LangGraph's graph-level state has turned "how does a child's event surface" and "how does a variable cross delegation boundaries" into explicit first-class APIs — developers usually wire up their own callbacks or pass references around by hand. AG2 1.3 formalizes both: events travel through the observer channel without mixing into the parent's reasoning context, and state travels through declared ScopedValue scopes instead of relying on implicit copying. That gives AG2 a more complete story for observability inside a delegation tree than comparable frameworks, but it's still an in-process delegation model — next to cross-process, durable workflow engines like Temporal or Inngest, it's solving a different layer of the problem.
Today's takeaway
I used to think "observability" in a multi-agent framework just meant bolting a callback onto the delegation point to print logs, then manually forwarding whatever mattered up the chain. Seeing AG2 explicitly define ChildEvent as something that never enters the parent's model transcript and never triggers the parent's tool loop made it click: observation and participating in the conversation have to be two separate pipes. If a child's progress update gets dropped into the parent's context as an ordinary message, the parent can easily mistake that progress notification for a new instruction it needs to respond to — sending the reasoning chain on an extra, unnecessary loop.