Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 42

Multi-Agent Topologies and Trade-offs

Recommended resources

Introduction

In our last lesson, we developed the core mechanism for sub-workflow invocation, enabling a parent workflow graph to call a child graph recursively. This provided the "how" of delegation from a code-level perspective. Now, we will elevate our view from implementation details to system architecture. The ability to delegate tasks opens up a rich design space of multi-agent collaboration, and choosing the right structure is a critical engineering decision.

This lesson directly addresses the learning outcome: Compare supervisor, peer-to-peer, and hierarchical multi-agent topologies and their trade-offs. We will analyze the fundamental patterns of agent collaboration, treating them not as abstract AI concepts, but as distributed systems architectures. Given your background, you'll find direct parallels to service orchestration, event-driven architectures, and the trade-offs between centralized control and decentralized autonomy. We will explore how decisions about communication flow, dependency management, and authority structure impact a system's resilience, scalability, and debuggability.


1. The Fundamental Choice: Orchestration vs. Choreography

Before we examine specific topologies, we must understand the two primary modes of coordination in any distributed system, including multi-agent systems. The choice between them dictates how agents interact and how control is managed. The speaker in the following video frames this perfectly, arguing that multi-agent systems are fundamentally distributed systems problems where bad architecture, not bad AI, is the primary cause of failure.

From Chaos to Choreography: Multi-Agent Orchestration Patterns That Actually Work — Sandipan Bhaumik

This segment from AI Engineer's channel introduces the core challenge of scaling from one to many agents and frames it as a choice between two distributed coordination patterns.

First, watch the introduction from happy to understand how coordination complexity grows exponentially and why multi-agent projects often fail due to architectural, not model-related, issues. The anecdote about cache invalidation is a classic distributed systems failure mode. Next, watch the explanation of the two fundamental patterns from choreography or orchestration. Pay close attention to the distinction: Choreography: Decentralized, event-driven communication via a message bus. Agents are autonomous and loosely coupled. Orchestration: Centralized control via a coordinator. The orchestrator explicitly calls agents and manages state.

This dichotomy is the lens through which we will evaluate all other topologies.

  • Orchestration corresponds to architectures with a central authority, like a manager or supervisor.
  • Choreography corresponds to architectures where peers coordinate among themselves, typically by reacting to shared events.

2. A Taxonomy of Multi-Agent Topologies

With the orchestration/choreography framework in mind, let's explore the most common architectural patterns, or topologies. Each represents a different approach to structuring communication and control, with distinct advantages and disadvantages.

This image illustrates four common architectural patterns for multi-agent systems: Centralized (a form of hierarchical), Decentralized (peer-to-peer), Hierarchical, and Sequential (a pipeline).

The following reading provides an excellent, detailed breakdown of these patterns and their trade-offs.

Multi-Agent Systems: Coordination and Communication Protocols ...

This article section delves into the primary ways multi-agent systems are organized, detailing the pros and cons of each approach from a systems design perspective.

Please read the entire section on Topologies and Coordination Patterns. Start at the beginning of the section and read through the discussions on: Hierarchical Orchestration: The classic "manager-worker" or supervisor pattern. Peer-to-Peer Collaboration: A decentralized model where agents communicate directly. Pipeline Patterns: A sequential flow where one agent's output is the next's input.

Let's summarize and connect these patterns to your distributed systems expertise.

Hierarchical (Supervisor) Topology

This is the most common pattern and a direct implementation of the orchestration model. A central "supervisor" or "orchestrator" agent decomposes a task, delegates subtasks to specialized "worker" agents, and synthesizes their results.

This diagram shows a classic hierarchical system. A central "Coordinator" agent receives a complex task, routes work to specialized agents (Data, Analysis, Writing, Review), and synthesizes their outputs into a comprehensive result.
  • Trade-offs:
    • Pros: The flow of control is explicit and easy to trace, making debugging simpler. The supervisor acts as a natural point for quality control, validation, and error handling. It's conceptually simple to manage.
    • Cons: The supervisor is both a performance bottleneck and a single point of failure. The entire system's quality is capped by the supervisor's ability to plan and delegate effectively. If the supervisor makes a poor decision, the entire workflow is compromised.

Peer-to-Peer (Decentralized) Topology

This pattern embodies choreography. Agents are autonomous peers in a network, communicating directly with each other or through a shared medium (like an event bus or a "blackboard"). There is no single leader.

  • Trade-offs:
    • Pros: Highly resilient; there is no single point of failure. The system can continue to operate even if some agents fail. This structure is well-suited for dynamic, exploratory tasks where the path forward is not clear and local adaptation is beneficial. It can also lead to more robust solutions through patterns like multi-agent debate.
    • Cons: Coordination is complex and can lead to issues like deadlock or conflicting strategies. Without a central authority, global consistency is difficult to achieve. Observability is a major challenge; debugging is notoriously difficult as you have to reconstruct a distributed flow of events to find the point of failure.

Pipeline (Sequential) Topology

This is the simplest topology, where agents are arranged in a linear sequence. The output of agent N becomes the input for agent N+1. This is a very constrained form of orchestration.

  • Trade-offs:
    • Pros: Extremely simple to implement and reason about. The data flow is unidirectional and predictable.
    • Cons: Offers no parallelism, making it the slowest option for decomposable tasks. It is also very brittle. An error in an early stage will silently propagate through the entire pipeline, corrupting the final result. There is no natural mechanism for feedback or revision to earlier stages.

3. An Engineering View: Quantifying the Trade-offs

While the qualitative descriptions are useful, engineering and architecture decisions benefit from quantitative data. Recent research has started to formalize the costs and benefits of these topologies, giving us empirically-backed rules for when to use each.

The following article provides a fantastic summary of this research, framing the trade-offs in terms that are highly relevant to a systems architect.

How to Scale LLM Agents: Coordination Costs, Topologies, and ...

This article translates a research paper's findings into practical laws and a decision matrix for scaling agentic systems. It provides the quantitative backing for our architectural choices.

First, review the definitions in The Five Architectures. Note the mapping: "Centralized" is our hierarchical/supervisor model, and "Decentralized" is peer-to-peer. Next, carefully read the section on The Three Foundational Laws. These are crucial: Tool-Coordination Trade-off: Coordination messages consume context tokens that could have been used for reasoning. Capability Saturation (The "45% Rule"): Do not scale an incompetent agent. Multi-agent systems amplify noise below a certain single-agent performance threshold. Topology-Dependent Error Amplification: This is a key trade-off. A centralized architecture contains errors far better than decentralized or independent agent setups (4.4x vs. 17.2x amplification). Finally, study the Decision Matrix and the cheat-sheet. These provide a direct, actionable guide for architectural decisions.

The video below reinforces some of these key findings, particularly the "45% rule" and the stark difference in error amplification between topologies.

Multi-agent Systems Explained in 17 Minutes

This video provides a concise overview of multi-agent systems, including when to use them and the trade-offs of different architectures.

Watch the introduction from it's not a cure all to review the criteria for choosing multi-agent systems, including task decomposability and the "45% Rule". Then, watch the segment on the centralized architecture from effective for error correction. This highlights its primary strength: error containment, as empirically verified by the Google research paper. Contrast this with the brief discussion on independent agents (a simple form of decentralized system) from there's no opportunity for error correction, which notes the massive (17x) increase in errors.

This quantitative view makes the architectural choice much clearer. For tasks where correctness is paramount and sub-tasks are well-defined, the hierarchical/supervisor model's ability to contain errors makes it a superior choice, despite its bottleneck limitations. For highly exploratory tasks where resilience is more important than predictable control, a peer-to-peer model might be justified, provided you invest heavily in observability.


Conclusion

In this lesson, we have moved from the mechanics of delegation to the high-level architecture of collaboration. We've established that designing a multi-agent system is analogous to designing a distributed microservices architecture, with similar trade-offs between centralized orchestration and decentralized choreography.

Key Takeaways:

  • Topologies as Architectural Choices: The primary multi-agent topologies are Hierarchical (Supervisor), Peer-to-Peer, and Sequential (Pipeline).
  • Orchestration vs. Choreography: Hierarchical systems use orchestration (a central coordinator), which is easier to debug but creates a bottleneck. Peer-to-peer systems use choreography (event-driven peers), which is more resilient but harder to debug and coordinate.
  • Error Amplification is a Key Trade-off: Centralized/hierarchical systems are significantly better at containing errors than decentralized ones. A supervisor acts as a natural validation and correction point.
  • No "Best" Topology: The optimal architecture is task-dependent.
    • Use Hierarchical for complex but decomposable tasks requiring correctness and control.
    • Use Peer-to-Peer for dynamic, exploratory tasks where resilience is key and central planning is impractical.
    • Use a Single Agent for inherently sequential tasks, as multi-agent coordination adds overhead for no benefit.
  • Scale Competence, Not Incompetence: Before building a multi-agent system, ensure your single-agent baseline is reasonably proficient (the "45% Rule"). Adding more agents to a failing system will only make it worse.

Preview of the Next Lesson:
Theory is essential, but engineering is about building. In our next lesson, we will put this architectural theory into practice by implementing the most common and versatile of these patterns. We will focus on the learning outcome: Implement a supervisor agent that delegates subtasks to specialized worker agents and aggregates their results. You will build the core logic for the orchestrator you designed conceptually today, making the hierarchical topology a concrete and functional part of our agentic system.