Skip to main content

07. Frameworks & Libraries

Microsoft AutoGen Fundamentals

Microsoft AutoGen is a multi-agent framework built on an async, event-driven actor model (v0.4+): Core for message/runtime primitives, AgentChat for assistants/teams/group chat, and Extensions for integrations. Agents collaborate by exchanging messages — GroupChat is sequential by design; true parallelism lives in Core topics and direct messaging.

What you will learn

  • Explain AutoGen Core, AgentChat, and Extensions layers
  • Describe GroupChat turn-taking and the manager role
  • Contrast sequential GroupChat with concurrent Core patterns
  • Map AutoGen to CrewAI and LangGraph choices
  • Answer interview questions with short, solid answers
AutoGen layers: Extensions, AgentChat, and Core
Interview staple: AgentChat for speed; Core for custom concurrency and scale.

Definition

AutoGen is Microsoft’s open-source framework for building multi-agent applications. In v0.4+, agents are event-driven actors: they receive messages, do work, and publish or reply — coordinated by a runtime rather than a single synchronous call stack.

You typically start in AgentChat (assistants, teams, GroupChat, GraphFlow) and drop into Core when you need custom messaging, concurrency, or deployment-scale control.

Introduction

This lesson (#7 in Frameworks & Libraries) follows Building Multi-Agent Apps with CrewAI. You know crew/task composition; AutoGen emphasizes conversational teams and an actor-style runtime.

Next: OpenAI Agents SDK (Tools, Handoffs, Guardrails, Tracing) — another production-oriented agent stack.

Why AutoGen

  • Strong multi-agent collaboration metaphors (assistants + group chat)
  • Layered design: prototype fast, scale with Core
  • Native async messaging for observability and control
  • Patterns for HITL via user-proxy style participants
  • Active Microsoft Research / open-source ecosystem

Layered architecture

Think of three layers stacked: Core (actors + messages), AgentChat (ergonomic teams API), Extensions (clients and integrations).

AutoGen Extensions AgentChat Core stack
Stay in AgentChat until you need Core-level fan-out or custom protocols.
  • Core - runtime, topics, subscriptions, async message delivery
  • AgentChat - AssistantAgent, teams, GroupChat, streaming, state helpers
  • Extensions - model clients, tools, third-party connectors
  • v0.2 APIs are legacy - prefer v0.4+ mental model in interviews

Agents as actors

  • An agent reacts to messages (events), not only to a single prompt string
  • Runtime routes messages by topic subscription or direct AgentId
  • Work can span processes/hosts because delivery is decoupled from handling
  • Observability hooks attach to message flow - critical for production
  • Same idea as Module 06 collaboration: specialized roles exchanging handoffs

GroupChat fundamentals

GroupChat is a shared-thread pattern: participants publish to a common topic; a GroupChat Manager selects who speaks next. Turns are sequential — one agent works at a time.

GroupChat manager selecting Writer Critic or User
Protocol: message in → manager RequestToSpeak → agent posts → repeat until terminate.
  • Shared topic - all participants see the conversation thread
  • Manager - round-robin or LLM selector picks the next speaker
  • RequestToSpeak - manager prompts one agent to contribute
  • Termination - stop when approval keyword, max turns, or custom condition
  • Optional human participant - HITL guidance inside the same thread

Concurrency patterns

Do not assume GroupChat is parallel. For concurrent work, use Core patterns (or AgentChat GraphFlow where supported): publish to a topic with multiple subscribers, or send parallel direct messages and combine results.

Sequential GroupChat versus concurrent topic fan-out
Interview trap: GroupChat is sequential; concurrency is a Core (or GraphFlow) design.
  • Sequential GroupChat - collaboration and debate style workflows
  • Topic fan-out - one publish, many agents process independently
  • Direct messaging - address AgentId; await or gather replies
  • Mixture-of-agents style - parallel workers then merge
  • Choose based on dependency: debate vs fan-out vs pipeline

Map to earlier modules

  • GroupChat ≈ dynamic multi-agent collaboration / debate
  • Manager selector ≈ lightweight supervisor choosing next worker
  • User participant ≈ HITL interrupt inside the conversation
  • Core fan-out ≈ parallel specialized workers (Module 06)
  • CrewAI hierarchical ≈ similar supervisor idea with task objects
  • LangGraph ≈ prefer when you need durable checkpointed graphs

Failure modes

  • Expecting parallel speakers inside classic GroupChat
  • No termination condition - endless turn thrash
  • LLM selector without diversity rules - one agent dominates
  • Tools without allowlists - same Module 05 risk
  • Ignoring budgets/traces because demos feel chatty and cheap

Program / implementation notes

Prototype a two-agent team or GroupChat in AgentChat, define a clear stop condition, then add Core concurrency only when parallel workers are required. Wrap runs with your API auth, budgets, and logging.

  • Pin package versions; v0.2 vs v0.4 APIs differ sharply
  • Next: OpenAI Agents SDK (Tools, Handoffs, Guardrails, Tracing)

Advantages and limitations

  • Advantage: excellent multi-agent conversation and team patterns
  • Advantage: Core actor model scales messaging and observability
  • Advantage: layered API matches prototype → production path
  • Limitation: GroupChat alone is not a parallel executor
  • Limitation: Core patterns need more design than CrewAI kickoff
  • Limitation: still need your own auth, evals, and cost caps

Key points

  • AutoGen v0.4+ = Core + AgentChat + Extensions.
  • Agents are event-driven actors exchanging messages.
  • GroupChat is sequential: manager selects the next speaker.
  • Concurrency uses Core topics/direct messages (or GraphFlow).
  • HITL often appears as a user participant in the thread.
  • Compare with CrewAI (crews/tasks) and LangGraph (durable graphs).

FAQs

AutoGen vs CrewAI?

AutoGen centers on message-driven agents and GroupChat/teams. CrewAI centers on Agents + Tasks + Process kickoff. Both can build multi-agent apps; pick the metaphor your team ships faster with.

Is GroupChat parallel?

No. Classic GroupChat is one speaker per turn. Use Core concurrency or GraphFlow for parallel work.

When use Core instead of AgentChat?

When you need custom protocols, topic fan-out, cross-process agents, or control beyond the high-level teams API.

How do you stop a GroupChat?

Define a termination condition: max turns, approval keyword from a critic/editor, or a custom manager rule — never rely on hope.

Interview questions

  1. What are AutoGen’s main layers in v0.4+?

    Answer Core (async actor runtime and messaging), AgentChat (high-level assistants/teams/GroupChat), and Extensions (clients and integrations).

  2. How does GroupChat work?

    Answer Agents share a topic; a manager selects the next speaker (round-robin or LLM), issues RequestToSpeak, and stops when a termination condition is met — turns are sequential.

  3. How do you run agents concurrently in AutoGen?

    Answer Use Core patterns: publish to a topic with multiple subscribers, or send parallel direct messages and combine results; GraphFlow can also express parallel flows.

  4. Why does AutoGen use an actor model?

    Answer It decouples message delivery from handling, improving modularity, observability, and the ability to run agents across processes at scale.

  5. How does AutoGen relate to HITL?

    Answer A human can participate as a user-proxy style agent in the conversation, or your app can gate side effects outside the framework — both are common.

  6. When prefer LangGraph or CrewAI instead?

    Answer LangGraph for durable checkpointed graphs and fine-grained routing; CrewAI for role/task/crew composition with sequential or hierarchical processes.

Related topics

Practice task

Complete each numbered practice step in a notebook or doc before opening the next lesson.

  1. Sketch Core / AgentChat / Extensions and write one sentence per layer.
  2. Design a Writer–Critic–User GroupChat: list roles and a termination condition.
  3. Explain in 3 bullets why that GroupChat is sequential, not parallel.
  4. Propose one Core fan-out use case (e.g., three reviewers in parallel) and how results merge.
  5. Answer interview questions 1, 2, and 3 in two sentences each.