datarekha

AutoGen: conversational multi-agent

Where LangGraph models agents as a graph and CrewAI as roles, AutoGen models them as agents that talk. Microsoft's framework for multi-agent conversations — the assistant/executor code loop, group chat with speaker selection, and the async actor-model runtime underneath.

8 min read Intermediate Agentic AI Lesson 51 of 71

What you'll learn

  • AutoGen's conversational model — ConversableAgents that exchange messages
  • The signature assistant + user-proxy code-execution loop
  • GroupChat and a manager that selects the next speaker
  • The 0.4 async actor-model runtime, and when to reach for AutoGen

Before you start

Multi-agent frameworks differ mainly in their mental model. LangGraph sees agents as nodes in an explicit graph; CrewAI sees them as roles with tasks. AutoGen (Microsoft) sees them as agents that hold a conversation — you define a few agents and let them talk to each other to solve a task. It is the most “let the agents figure it out by chatting” of the major frameworks.

ConversableAgents that message each other

AutoGen’s base abstraction is the ConversableAgent — anything that can send and receive messages. Two specializations do most of the work:

  • AssistantAgent — an LLM-backed agent that reasons and writes responses (including code).
  • UserProxyAgent — stands in for the user: it can execute code the assistant produces (in a sandbox), call tools, and optionally pause for human input.

The signature AutoGen pattern is the loop between them: the assistant writes code, the user-proxy runs it and feeds the result back, and the assistant iterates until the task is solved and it emits a termination signal.

# AutoGen-style two-agent loop: an Assistant writes code, a UserProxy executes it.
def assistant(turn):
    return "print(sum(range(1, 11)))" if turn == 1 else "TERMINATE"

def user_proxy(code):
    return "55" if "sum(range(1, 11))" in code else ""

turn = 1
while True:
    msg = assistant(turn)
    print(f"Assistant -> {msg}")
    if msg == "TERMINATE":
        print("conversation ends")
        break
    print(f"UserProxy (exec) -> {user_proxy(msg)}")
    turn += 1
Assistant -> print(sum(range(1, 11)))
UserProxy (exec) -> 55
Assistant -> TERMINATE
conversation ends

That tiny loop is the heart of AutoGen: a reasoning agent and an executing agent passing messages until the work is done. Real AutoGen wraps this with sandboxed execution, tool registration, and termination conditions — but the shape is exactly this conversation.

More than two: GroupChat

For more agents, AutoGen provides GroupChat plus a GroupChatManager. You give the manager a roster of agents; each turn it selects the next speaker — round-robin, LLM-chosen (“who is best suited to respond now?”), or a custom rule — and broadcasts the conversation. It’s conversational orchestration: a coder, a reviewer, and a tester can hash out a solution by talking, with the manager deciding who goes next.

Two-agent: assistant + executorAssistantAgentLLM · writes codeUserProxyAgentruns code, returnscoderesultloop until TERMINATEGroupChat: manager picks speakerGroupChatManagercoderreviewertesterselects next speaker each turn (round-robin / LLM / custom)
AutoGen orchestrates by conversation: a two-agent code loop, or a manager choosing who speaks in a group.

The actor-model runtime (AutoGen 0.4+)

The original AutoGen was a synchronous conversation library. The 0.4 redesign rebuilt it on an asynchronous, event-driven actor model: agents are actors that exchange messages concurrently over a runtime (autogen-core), layered under a higher-level conversation API (autogen-agentchat) and extensions. The actor model makes multi-agent systems more scalable and composable — agents run concurrently, react to events, and can be distributed — and it’s cross-language (Python and .NET).

In one breath

  • AutoGen (Microsoft) models multi-agent systems as conversations: define ConversableAgents and let them message each other to solve a task.
  • The signature pattern is AssistantAgent (LLM, writes code) + UserProxyAgent (executes the code / tools, optional human-in-the-loop) looping until TERMINATE.
  • GroupChat + GroupChatManager scale it to many agents — the manager selects the next speaker each turn (round-robin, LLM-chosen, or custom).
  • AutoGen 0.4 rebuilt the core as an async actor-model runtime (autogen-core) — agents as concurrent, event-driven actors — layered and cross-language.
  • It’s the conversational/actor choice: use it for dialogue-shaped problems and code-exec loops; LangGraph for explicit graphs, CrewAI for roles. (Lineage: AG2 fork; converging into the Microsoft Agent Framework.)

Quick check

Quick check

0/4
Q1What is AutoGen's core mental model for multi-agent systems?
Q2What is the signature AssistantAgent + UserProxyAgent loop?
Q3In a GroupChat, what does the GroupChatManager do?
Q4What did the AutoGen 0.4 redesign change architecturally?

Next

AutoGen is one point in the framework design space; compare CrewAI (roles) and LangGraph (graphs), and see multi-agent orchestration for the framework-agnostic patterns (supervisor, swarm) underneath them all.

Sign in to track your progress

Completed lessons, your XP, level, and streak save to your account — it's free and takes a few seconds.

Related lessons

Explore further

Skip to content