AI Agents for Beginners - 8. Multi-Agent Design Pattern

Multi-agent design patterns — when to use them, building blocks of agent communication and coordination, Group Chat / Hand-off / Collaborative Filtering patterns, and a WorkflowBuilder pipeline walkthrough.
June 9, 2026

AI Agents for Beginners - 8. Multi-Agent Design Pattern

This post summarizes Lesson 08 of Microsoft's AI Agents for Beginners course.

Scenarios Where Multi-Agents Are Applicable

A Multi-Agent System is a design pattern where multiple agents work together to achieve a common goal.
Using multi-agents provides significant benefits particularly in the following three scenarios:
ScenarioDescriptionExample
Large WorkloadsDividing large tasks into smaller units for parallel processingHigh-volume data pipelines
Complex TasksSeparating complex tasks into specialized domainsAutonomous driving: navigation, obstacle detection, and communication agents
Diverse ExpertiseEach agent possesses distinct expertiseHealthcare: diagnosis, treatment planning, and patient monitoring agents

Advantages of Using Multi-Agents Over a Singular Agent

Single-agent systems work well for simple tasks, but multi-agent systems offer several advantages when dealing with complex tasks.
AdvantageDescription
SpecializationEach agent focuses on a specific task → No confusion even with complex requests
ScalabilityScale the system by adding new agents without needing to modify existing ones
Fault ToleranceIf one agent fails, the remaining agents continue operating
For example, implementing a travel booking system as a single agent (mom-and-pop) results in a complex, hard-to-maintain system that tries to handle flights, hotels, and car rentals all at once. Configuring it as a multi-agent (franchise) system modularizes each domain with dedicated agents, making expansion and maintenance much easier.
Single Agent vs Multi-Agent
Mermaid
flowchart LR subgraph Single["Single Agent (Mom & Pop)"] SA["SingleAgent\nHandles flights + hotels\n+ car rentals all-in-one"] end subgraph Multi["Multi-Agent (Franchise)"] FA["FlightAgent"] HA["HotelAgent"] CA["CarAgent"] end User1["User"] --> SA User2["User"] --> FA & HA & CA

Building Blocks of Implementing the Multi-Agent Design Pattern

Key building blocks for implementing a multi-agent system:
Building BlockDescriptionTravel Booking Example
Agent CommunicationDetermines information sharing methods and protocols between agentsFlight agent passes travel dates to hotel agent
Coordination MechanismsCoordination between agents to align with user preferences and constraintsCoordinating hotel location with car rental pickup point
Agent ArchitectureInternal decision-making structure and learning mechanisms of agentsRecommending flights using an ML model based on past preferences
VisibilityTools for tracking agent activities and interactionsMonitoring each agent's status via a dashboard
Multi-Agent PatternsChoosing centralized, decentralized, or hybrid architecturesGroup Chat, Hand-off, Collaborative Filtering
Human-in-the-LoopDefining when agents request human interventionRequesting user confirmation before final booking
Multi-Agent Building Blocks
Mermaid
flowchart TD MAD["Multi-Agent\nDesign Pattern"] MAD --> Comm["Agent Communication\nInformation sharing method"] MAD --> Coord["Coordination\nConstraint alignment"] MAD --> Arch["Agent Architecture\nDecision-making & learning"] MAD --> Vis["Visibility\nActivity tracking"] MAD --> Pat["Patterns\nGroup/Hand-off/Filter"] MAD --> HITL["Human-in-the-Loop\nDefine intervention points"]

Multi-Agent Patterns

Group Chat

A pattern where multiple agents exchange messages in a group chat format.
Used in team collaboration, customer support, social networking, and more.
  • Can be implemented as a Centralized architecture via a central server, or a Decentralized architecture where agents exchange messages directly
  • Each agent sends, receives, and responds to messages in the group chat
Group Chat Pattern
Mermaid
flowchart LR GroupChat["Group Chat\n(Central Hub)"] A1["Agent 1\nTravelPlanner"] <--> GroupChat A2["Agent 2\nConcierge"] <--> GroupChat A3["Agent 3\nBudgetReviewer"] <--> GroupChat User["User"] --> GroupChat GroupChat --> User

Hand-off

A pattern where an agent completes a task and hands it off to the next agent.
Well-suited for customer support, task management, and workflow automation.
Hand-off Pattern
Mermaid
zenuml title Hand-off Pattern User->AgentA: initial request AgentA->AgentA: process own scope AgentA->AgentB: hand off with context AgentB->AgentB: process own scope AgentB->AgentC: hand off with context AgentC->User: final response

Collaborative Filtering

A pattern where multiple agents collaborate to generate recommendations based on their respective expertise.
Taking a stock recommendation scenario as an example:
AgentArea of Expertise
Industry Expert AgentSpecific industry domain knowledge
Technical Analysis AgentChart and pattern analysis
Fundamental Analysis AgentFinancial statements and valuation analysis
By collaborating, these three agents provide a far more comprehensive recommendation than a single agent could.
Collaborative Filtering Pattern
Mermaid
flowchart TD User["User\n'Which stock should I buy?'"] --> Coordinator["Coordinator Agent\nDispatch requests & aggregate results"] Coordinator --> IE["Industry Expert Agent\nIndustry trends & sector analysis"] Coordinator --> TA["Technical Analysis Agent\nCharts, patterns & entry point analysis"] Coordinator --> FA["Fundamental Analysis Agent\nFinancial statements & company valuation"] IE --> Agg["Aggregator\nSynthesize multi-angle insights"] TA --> Agg FA --> Agg Agg --> Rec["Comprehensive Recommendation\nHolistic investment recommendation"] Rec --> User

Creating Specialized Agents

Setup

setup.py
python
WorkflowBuilder allows you to connect agents as a directed graph.
First, create specialized agents with focused roles:
specialized_agents.py
python
Specialized Agents
Mermaid
flowchart LR P["TravelPlanner\nDraft itinerary\n(attractions, logistics)"] C["TravelConcierge\nReview & enhance plan\n(tips, restaurants, issues)"] P -->|"Pass context"| C

Sequential Workflow with WorkflowBuilder

Connect agents into a sequential pipeline using WorkflowBuilder.
add_edge(A, B) defines an edge where the output of A flows as input into B:
sequential_workflow.py
python
Sequential Workflow: 2-Agent Pipeline
Mermaid
flowchart LR U["User\n'Plan 5-day Paris, $3000'"] --> W["WorkflowBuilder\nstart_executor=planner_agent"] W --> P["TravelPlanner\nDraft itinerary\n(attractions, logistics)"] P -->|"AgentResponseUpdate"| C["TravelConcierge\nReview & enhance plan\n(tips, restaurants, issues)"] C -->|"AgentResponseUpdate"| S["Stream to User"]

Extending the Workflow

One of the greatest advantages of multi-agent patterns is that you can add new agents without modifying existing ones.
Extend it into a 3-step pipeline by adding the BudgetReviewer agent:
extended_workflow.py
python
Extended 3-Agent Pipeline
Mermaid
flowchart LR U["User\n'5-day Paris, $3000'"] --> P["TravelPlanner\nDraft itinerary"] --> C["TravelConcierge\nReview & enhance"] --> B["BudgetReviewer\nBudget validation & savings suggestions"] --> R["Final\nItinerary"]

Visibility into Multi-Agent Interactions

As the number of agents grows, tracking interactions becomes essential.
Secure visibility into multi-agent systems using three tools:
ToolContentApplication
Logging & MonitoringRecord agents, actions, timestamps, and results in logsDebugging, performance optimization
Visualization ToolsVisualize information flow between agents as a graphIdentifying bottlenecks and inefficiencies
Performance MetricsTrack task completion time, throughput, and recommendation accuracyPinpointing areas for system improvement
Travel booking dashboard example: Check each agent's status, user preferences and constraints, and exchanged information between agents at a glance.

Scenario: Refund Process

How would a refund process look when designed with multi-agents?
Agents are categorized into process-specific and general-purpose:
Refund-specific agents
AgentRole
Customer AgentRepresents the customer and initiates the refund process
Seller AgentRepresents the seller and processes the refund
Payment AgentProcesses the payment refund
Resolution AgentResolves issues arising during the refund
Compliance AgentValidates compliance with regulations and policies
General-purpose agents (Reusable across other business processes)
AgentRole
Shipping AgentHandles product returns (also usable for outbound purchase shipping)
Notification AgentSends customer notifications at each step
Escalation AgentEscalates issues to higher-tier support
Feedback AgentCollects customer feedback
Audit AgentAudits the process
Analytics AgentAnalyzes data
Refund Process Multi-Agent System
Mermaid
%%{init: {'look': 'handDrawn', 'themeVariables': {'clusterBkg': '#e8efff28', 'clusterBorder': '#aabbcc'}, 'flowchart': {'subGraphTitleMargin': {'top': 14, 'bottom': 8}}}}%% flowchart TD subgraph Core["Core Refund Flow (Sequential)"] Customer["Customer Agent\nRefund request"] Resolution["Resolution Agent\nIssue analysis & coordination"] Seller["Seller Agent\nRefund approval"] Payment["Payment Agent\nPayment refund"] end subgraph Checks["Parallel Validation — Resolution Stage"] direction LR Compliance["Compliance Agent\nCompliance verification"] Security["Security Agent\nSecurity verification"] Knowledge["Knowledge Agent\nPolicy & rules reference"] end subgraph Fulfillment["Parallel Fulfillment — Seller Stage"] Shipping["Shipping Agent\nReturn shipment processing"] end subgraph PostProcess["Post-Processing (Parallel)"] direction LR Feedback["Feedback Agent\nCollect customer feedback"] Analytics["Analytics Agent\nData analysis"] Audit["Audit Agent\nProcess audit"] Reporting["Reporting Agent\nGenerate reports"] Quality["Quality Agent\nQuality verification"] end Escalation["Escalation Agent\nEscalate to higher support"] Notification["Notification Agent\nStep-by-step customer notifications"] Customer --> Resolution Resolution -->|"Complex issue"| Escalation Resolution --> Compliance & Security & Knowledge Compliance & Security & Knowledge --> Seller Seller --> Payment & Shipping Customer & Seller & Payment --> Notification Payment --> Feedback & Analytics & Audit & Reporting & Quality
General-purpose agents (Shipping, Notification, Escalation, etc.) can be reused across other processes, enhancing the overall modularity and scalability of the system.

Summary

Lesson 08 Summary
Mermaid
flowchart LR Root["Multi-Agent\nDesign Pattern"] Root --> Why["Why Multi-Agent?"] Root --> Blocks["Building Blocks"] Root --> Patterns["Patterns"] Root --> Code["WorkflowBuilder"] Root --> Vis["Visibility"] Why --> W1["Specialization"] Why --> W2["Scalability"] Why --> W3["Fault Tolerance"] Blocks --> B1["Communication"] Blocks --> B2["Coordination"] Blocks --> B3["Architecture"] Patterns --> P1["Group Chat"] Patterns --> P2["Hand-off"] Patterns --> P3["Collaborative\nFiltering"] Code --> C1["create_agent x N"] Code --> C2["WorkflowBuilder\n+ add_edge"] Code --> C3["stream output"] Vis --> V1["Logging"] Vis --> V2["Visualization"] Vis --> V3["Metrics"]
  • Multi-Agent Systems overcome the limitations of single agents through Specialization, Scalability, and Fault Tolerance.
  • Connect agents into sequential pipelines using WorkflowBuilder's add_edge, and scale by adding new agents without modifying existing code.
  • Choose agent communication and coordination methods using three core patterns: Group Chat, Hand-off, and Collaborative Filtering.
  • As the number of agents grows, securing interaction visibility through Logging, Visualization, and Performance Metrics becomes crucial.
Jooojub
System S/W engineer
Explore Tags
Series
    Recent Post
    © 2026. jooojub. All right reserved.