Chapter 16: Multi-Agent Systems Architecture¶
Design systems of cooperating AI agents: roles, message-passing protocols, contract-net task allocation, consensus, and the orchestration patterns and failure modes behind production multi-agent applications.
Metadata¶
| Field | Value |
|---|---|
| Track | Advanced |
| Time | 10 hours |
| Prerequisites | Chapters 1, 9, 11, 20 |
Learning Objectives¶
- Model agents with explicit roles, tools, memory, and a perceive-decide-act loop
- Pass messages with a typed performative protocol (inform / request / propose / accept)
- Allocate tasks with the Contract-Net Protocol and reason about greedy vs optimal assignment
- Share state safely through a blackboard and understand read/write contention
- Reach consensus across agents with gossip averaging and majority voting
- Orchestrate workflows with supervisor, pipeline, and debate topologies
- Diagnose failure modes — deadlock, infinite delegation loops, and runaway token cost
- Evaluate a multi-agent system on task success, cost, and latency, not vibes
What's Included¶
Notebooks¶
| Notebook | Description |
|---|---|
01_agents_and_messaging.ipynb | Agent model, perceive-decide-act loop, typed messages, blackboards |
02_coordination.ipynb | Contract-Net task allocation, gossip consensus, majority voting |
03_orchestration_and_evaluation.ipynb | Supervisor / pipeline / debate topologies, failure modes, cost-aware evaluation |
Scripts¶
config.py— Chapter config: seeds, agent roster, topology presetsagents.py— Agent dataclass, Message/Blackboard, Contract-Net allocation, gossip consensusorchestration.py— Supervisor / pipeline / debate orchestrators with cost + latency accounting
Exercises¶
- Problem Set 1: Agents & Allocation — Build an agent loop, route messages by performative, and run a Contract-Net auction
- Problem Set 2: Consensus & Orchestration — Prove gossip convergence, implement weighted voting, and add a loop guard to an orchestrator
- Solutions — in
exercises/solutions/(notebooks andsolutions.pyfor CI)
Diagrams (Mermaid)¶
agent_loop.mermaid,contract_net.mermaid,orchestration_topologies.mermaid
Read Online¶
- 16.1 Introduction — Agent model, perceive-decide-act loop, typed messages, blackboards
- 16.2 Intermediate — Contract-Net task allocation, gossip consensus, majority voting
- 16.3 Advanced — Supervisor / pipeline / debate topologies, failure modes, cost-aware evaluation
Or try the code in the Playground.
How to Use This Chapter¶
Quick Start
Clone the repo, install dependencies, and open the first notebook.
git clone https://github.com/luigipascal/berta-chapters.git
cd berta-chapters/chapters/chapter-16-multi-agent-systems-architecture
pip install -r requirements.txt
jupyter notebook notebooks/01_agents_and_messaging.ipynb
GitHub Folder
All chapter materials live in: chapters/chapter-16-multi-agent-systems-architecture/
Created by Luigi Pascal Rondanini | Generated by Berta AI