TAI BUI
Back to curriculum
BuildPython

AutoGen v0.4: Actor Model and Agent Framework

AutoGen v0.4 (Microsoft Research, Jan 2025) rebuilt agent orchestration on the actor model: async message exchange, event-driven agents, fault isolation, natural concurrency. As of early 2026 the framework is in maintenance mode, and Microsoft Agent Framework (public preview since Oct 2025) is the successor.

TIME: ~75 minutesPREREQUISITES: Phase 14 · 01 (Agent Loop), Phase 14 · 12 (Workflow Patterns)

Learning Objectives

  • Describe the actor model: agents as actors, messages as the only IPC, failure isolation per actor.
  • Name AutoGen v0.4's three API layers — Core, AgentChat, Extensions — and what each is for.
  • Explain why decoupling message delivery from handling gives fault isolation and natural concurrency.
  • Implement a stdlib actor runtime in Python and port a two-agent code-review flow onto it.

The Problem

Most agent frameworks are synchronous. One agent produces, another consumes, and the whole thing lives in a call stack. When one call fails, the stack fails with it. Concurrency gets bolted on afterward, and distributing the system across machines means rewriting it.

AutoGen v0.4 answers with the actor model. Each agent is an actor with a private inbox, and messages are the only way actors interact. The runtime separates delivery from handling, so a failure stays inside one actor, concurrency comes for free, and going distributed is just a change of transport.

Warm-up0/3
1. In a Lesson 12 workflow chain run as one synchronous program, a step's LLM call raises an exception partway through. What usually happens to the rest of the chain?Warm-up
2. In the Lesson 01 agent loop, what happens on each iteration after the model asks for a tool?Warm-up
3. Two parts of one program read and update the same variable at the same time. What problem commonly results?Warm-up

The Concept

Actors

An actor is a unit of private state with an inbox and a handler. Nothing outside it touches that state directly. The three pieces:

  • State, private to the actor.
  • Inbox, a queue of pending messages.
  • Handler, receive(message) -> effects, where an effect is one of: reply, send to another actor, spawn a new actor, update state, or stop self.

Two actors cannot share memory. They can only send each other messages.

Three API layers in AutoGen v0.4

  1. Core. The low-level actor framework: AgentRuntime, Agent, Message, Topic. Async message exchange, event-driven. A topic is a named channel that agents subscribe to, so one message can reach every subscriber instead of a single recipient.
  2. AgentChat. The task-driven high-level API, which replaces v0.2's ConversableAgent. It gives you AssistantAgent, UserProxyAgent, RoundRobinGroupChat, and SelectorGroupChat.
  3. Extensions. Integrations for OpenAI, Anthropic, Azure, tools, and memory.

Why decoupling matters

In the v0.2 model, agent_a.chat(agent_b) blocks agent_a until agent_b returns. In v0.4, send(agent_b, msg) drops the message in agent_b's inbox and returns immediately. The runtime delivers it later. That one change has three consequences:

  • Fault isolation. If agent B crashes, agent A keeps going. The runtime catches the failure in B's handler and decides what happens next: log it, retry, or dead-letter the message.
  • Natural concurrency. Many messages can be in flight at once, and actors work through their inboxes concurrently.
  • Distribution-ready. An inbox plus a transport is the same abstraction whether the actor lives in-process or on another host.

Topologies

  • RoundRobinGroupChat. Agents take turns in a fixed rotation.
  • SelectorGroupChat. A selector agent reads the conversation context and picks who goes next.
  • Magentic-One. A reference multi-agent team for web browsing, code execution, and file handling, built on AgentChat.

Observability

OpenTelemetry support is built in. Every message emits a span, and tool calls carry gen_ai.* attributes per the 2026 OTel GenAI semantic conventions (Lesson 23).

Status: maintenance mode

As of early 2026, AutoGen v0.7.x was stable for research and prototyping, and Microsoft had moved active development to the Microsoft Agent Framework (public preview Oct 1 2025, with 1.0 GA targeted for the end of Q1 2026). That target date has since passed, so check the Agent Framework repo for its current release status before choosing it. AutoGen patterns port forward cleanly. The actor model is the part that lasts.

Check: The Concept0/25
1. What is an actor?Define
2. In the actor model, what is a message?Define
3. What is an actor's inbox?Define
4. What does the runtime do in an actor system?Define
5. In AutoGen Core, what is a topic?Define
6. What does fault isolation mean for actors?Define
7. Which AgentChat topology rotates agents in a fixed order?Define
8. What is Magentic-One in this lesson?Define
9. How does SelectorGroupChat decide which agent acts next?Define
10. What can an actor's handler produce as an effect after receiving a message?Define
11. Which description matches AutoGen v0.4's Core layer?Define
12. What is the lesson's stated status of AutoGen v0.4 as of early 2026?Define
13. Which observability standard does AutoGen v0.4 emit by default?Define
14. Why must actors exchange only messages instead of sharing memory?Explain
15. A team wants to plug an Anthropic model client and a memory store into AutoGen v0.4. Which layer supplies those integrations?Explain
16. In v0.2, agent_a.chat(agent_b) blocks agent_a. What does v0.4's send(agent_b, msg) do instead?Explain
17. Why does decoupling delivery from handling give fault isolation?Explain
18. Besides fault isolation, which two other consequences does decoupling message delivery from handling bring?Explain
19. Why does the lesson call the actor design distribution-ready?Explain
20. What advantage does publishing to a topic have over sending to one named recipient?Explain
21. Why does the lesson say not to tie what you learn to AutoGen's API surface?Explain
22. A developer has agent A call agent B's handler method directly and wait for the result. B raises, and A crashes with it. What was skipped?Analyze
23. To save effort, two actors update one shared dictionary instead of sending messages. One handler crashes midway through an update. What is the main danger?Analyze
24. You must run the review actors as separate processes connected through RabbitMQ. What changes in the design?Design
25. A coordinator must choose the next reviewer from what has been said so far, for example a security expert once a risky call appears. Which team topology fits?Design

Build It

code/main.py is a stdlib actor runtime, built from these pieces:

  • Message: a typed payload with sender, recipient, topic, and body, plus a numeric mid. Here topic is a plain string tag that tells a handler what kind of message it got ("review", "start"); it does not do publish-subscribe routing the way AutoGen Core topics do.
  • Actor: an abstract class with receive(message, runtime).
  • Runtime: an event loop with a shared queue, delivery, and failure isolation. A handler that raises is caught, and the message is parked in a basic dead_letters list with the error text.
  • A two-actor demo. ChecklistAgent sends three code snippets to ReviewerAgent, which flags eval( and bare except: and replies with a result for each. The checklist actor then folds the three results into one verdict.

Run it:

python3 code/main.py

The trace shows messages being delivered, a simulated failure (a crash_me message that makes the reviewer raise) that does not stop the remaining reviews, and the checklist actor reaching its verdict (False here, since two snippets are flagged). The demo already has the dead-letter list; Exercise 1 extends it.

Check: Build It0/9
1. In the demo, `start` goes to checklist and `crash_me` goes to reviewer, then run_until_idle() runs. How many entries are in dead_letters afterwards?Apply
2. The demo sends `start` to checklist and then `crash_me` to reviewer before running. Which message does the runtime handle second?Apply
3. The reviewer receives the snippet `def silent(): try: f() except: pass` with topic `review`. What body does it send back?Apply
4. After the demo finishes, what is checklist.consensus and why?Apply
5. A handler calls runtime.send to a recipient named 'auditor' that was never registered. What happens when that message is reached?Apply
6. Two actors keep replying to each other forever, and Runtime uses its default max_messages. What does run_until_idle do?Apply
7. A caller reads checklist.consensus right after the first review_result arrives and it was ok. What does it see, and what does that show?Analyze
8. A runtime catches handler exceptions but neither appends to dead_letters nor records a trace line. What goes wrong in practice?Analyze
9. One malformed message crashes its handler on every attempt. You want a human to inspect it and any retry to be bounded. Which design fits?Design

Use It

Where each option fits:

  • AutoGen v0.4/v0.7 (maintenance): stable for research, prototyping, and multi-agent patterns.
  • Microsoft Agent Framework (public preview as of early 2026): the forward path. Same actor-model ideas, refreshed API.
  • LangGraph swarm topology (Lesson 13): a similar pattern, built on shared-tool handoffs.
  • Custom actor runtime: the right call when you need a specific transport such as NATS, RabbitMQ, or gRPC.

Ship It

outputs/skill-actor-runtime.md generates a minimal actor runtime plus a team template (RoundRobin or Selector) for a given multi-agent task.

Author's Note

Don't tie what you learn here to AutoGen's API surface. The framework is in maintenance mode, and the lesson's own claim is that the actor model is what carries forward. Private state, an inbox, and message-only interaction will show up again in whatever replaces it, so that's the part worth getting right.

The quickest way to get it right is to write the small runtime yourself and break it on purpose. Make one actor's handler raise and watch whether the other keeps running. That behavior is the whole argument for the design, and it's easier to believe once you've seen it in a small runtime of your own than in a framework diagram. Port to autogen_core or Microsoft Agent Framework afterward, when you know which of their features you actually need.

Exercises

  1. Extend the demo's dead_letters list into a real dead-letter queue. When a handler raises, park the failing message with enough context (attempt count, timestamp) for human inspection or a bounded retry. How often does the DLQ get hit in your toy?
  2. Implement SelectorGroupChat: a selector actor picks who processes the next message based on conversation state.
  3. Add distributed transport. Swap the in-process queue for a JSON-over-HTTP server so actors can run in separate processes.
  4. Wire an OTel span per message (or a no-op stand-in) and emit gen_ai.agent.name and gen_ai.operation.name per Lesson 23.
  5. Read AutoGen v0.4's architecture post, then port your toy to the real autogen_core API. What did you skip that matters in production?

Key Terms

TermWhat people sayWhat it actually means
Actor"Agent"Private state, an inbox, and a handler; no shared memory
Message"Event"A typed payload, and the only way actors interact
Inbox"Mailbox"A per-actor queue of pending messages
Runtime"Agent host"The event loop that routes messages and isolates failures
Topic"Channel"In AutoGen Core, a named publish-subscribe route between actors; in this lesson's demo, a string tag on a message
Fault isolation"Let it crash"One actor failing does not crash the others
RoundRobinGroupChat"Fixed-rotation team"Agents take turns in order
SelectorGroupChat"Context-routed team"A selector picks who goes next
Magentic-One"Reference team"A multi-agent squad for web, code, and files

Further Reading

Code

Ships With