Part II: Discovery Through Software Engineering and Vibe Coding
Chapter 17: Multi-Agent Software Teams

Multi-Agent Software Teams

"I assigned the architecture review to Agent 7, but it delegated to Agent 3, who delegated back to Agent 7. They have been complimenting each other's work for forty minutes."

A Scrum Master Who Lost Control of the Sprint

Overview

A single AI agent can write a function, fix a bug, or draft a test. But real software engineering is a team sport: someone gathers requirements, someone designs the architecture, someone writes the code, someone reviews it, and someone verifies that it works. Multi-agent software teams replicate this division of labor with specialized AI agents, each carrying a distinct role, system prompt, and tool set.

This chapter teaches you how to design, coordinate, and supervise these teams. You will learn how to define agent roles (product manager, architect, developer, tester, reviewer), connect them through workflow graphs (sequential, parallel, conditional), manage shared state and message passing, implement debate patterns for design decisions, and insert human approval gates at critical junctures. The result is a system where AI agents collaborate on software tasks from issue triage to pull request, with humans retaining control over high-stakes decisions.

Where Chapter 16 focused on a single agent operating at repository scale, this chapter scales from one agent to many. The coordination patterns you learn here reappear in Chapter 54 (multi-agent discovery systems), where the "team" is not building software but running scientific experiments. The MCP servers from Chapter 12 become the tools these agents call, and the context engineering techniques from Chapter 11 determine how much of the codebase each agent can see.

Prerequisites

You should have read Chapter 10: Prompting to Programming for the basics of tool calling and agent loops, Chapter 11: Context Engineering for how to feed relevant context to agents, and Chapter 12: Building MCP Servers for the protocol that agents use to interact with tools. Familiarity with directed graphs (from Chapter 3) helps for understanding workflow topologies.

Learning Outcomes

Sections

17.1 Agent Roles and Workflows

Defining the five canonical software agent roles: product manager, architect, developer, tester, reviewer. Workflow graphs as directed graphs over agent nodes: sequential pipelines, parallel fan-out/fan-in, conditional branching, and cyclic refinement loops. Formalizing workflows with state machines and graph properties.

17.2 Coordination and Human Gates

Shared state and message passing: blackboard architectures, typed channels, and event-driven coordination. Debate and critique patterns for design review. Human-in-the-loop approval gates: when to block, what to surface, and how to design the approval interface. Trust calibration and progressive autonomy.

17.3 Building a Software Agent Team

Recipe: a complete multi-agent team that takes a GitHub issue and produces a reviewed pull request. Implementation with four frameworks (OpenAI Agents SDK, LangGraph, AutoGen, CrewAI). Testing, observability, and cost control for multi-agent pipelines. Integration with the Discovery Workbench.

What's Next

With a team of specialized agents collaborating on software tasks, Chapter 18: AI Assisted Testing and QA zooms in on one critical role: the tester. Where this chapter treated the tester as one node in a larger workflow, Chapter 18 explores the full depth of AI-driven testing: generating test suites from specifications, mutation testing, property-based testing, and the feedback loop between test failures and code repair. The testing agent you built here becomes the foundation; Chapter 18 gives it a far richer toolkit.

Bibliography

Foundational Papers

Qian, C., et al. (2023). ChatDev: Communicative Agents for Software Development. arXiv:2308.00352.

Introduces the idea of LLM-powered agents assuming distinct software development roles (CEO, CTO, programmer, tester) and collaborating through natural language. The original multi-agent software team paper that inspired much of this chapter.

Hong, S., et al. (2024). MetaGPT: Meta Programming for A Multi-Agent Collaborative Framework. ICLR 2024.

Formalizes multi-agent workflows using Standard Operating Procedures (SOPs) where each agent produces structured artifacts (PRDs, system designs, code). Demonstrates that structured outputs outperform free-form chat between agents.

Du, Y., et al. (2023). Improving Factuality and Reasoning in Language Models through Multiagent Debate. arXiv:2305.17126.

Shows that having multiple LLM agents debate and critique each other's outputs improves accuracy on reasoning tasks. The theoretical foundation for the debate patterns in Section 17.2.

Tools & Frameworks

OpenAI. (2025). OpenAI Agents SDK.

A lightweight Python framework for building multi-agent workflows with handoffs, guardrails, and tracing. Used in Section 17.3 for the sequential pipeline implementation.

LangChain. (2024). LangGraph: Build Stateful Multi-Actor Applications.

A graph-based framework for building agent workflows as state machines with typed state, conditional edges, and persistence. The primary framework used in Section 17.3 for complex workflows.

Wu, Q., et al. (2023). AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation. arXiv:2308.08155.

Microsoft's framework for multi-agent conversations with support for human-in-the-loop patterns, code execution, and group chat. Demonstrates flexible conversation topologies beyond sequential pipelines.

CrewAI. (2024). CrewAI: Framework for Orchestrating Role-Playing AI Agents.

A high-level framework that models agents as crew members with roles, goals, and backstories. Focuses on ease of use and hierarchical delegation patterns.

Architecture & Patterns

Wang, L., et al. (2024). A Survey on Large Language Model based Autonomous Agents. Frontiers of Computer Science, 18(6).

A comprehensive survey covering agent architectures, memory, planning, and multi-agent interaction. Provides the taxonomy used in Section 17.1 for classifying agent roles.

Talebirad, Y. & Nadiri, A. (2024). Multi-Agent Collaboration: Harnessing the Power of Intelligent LLM Agents. arXiv:2406.04692.

Analyzes collaboration patterns in multi-agent systems: cooperative, competitive, and mixed-motive. Useful background for understanding when debate helps and when it wastes tokens.

Zhuge, M., et al. (2024). GPTSwarm: Language Agents as Optimizable Graphs. arXiv:2310.02170.

Models multi-agent workflows as computational graphs and optimizes the graph structure itself. Relevant to Section 17.1's discussion of workflow graph topologies and their properties.

Evaluation & Benchmarks

Jimenez, C. E., et al. (2024). SWE-bench: Can Language Models Resolve Real-World GitHub Issues? ICLR 2024.

The standard benchmark for evaluating AI agents on real-world software engineering tasks. Multi-agent teams are evaluated against the same issues used in Section 17.3's recipe.

Yang, J., et al. (2024). SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering. arXiv:2405.04219.

Demonstrates the importance of agent-computer interfaces for software engineering tasks. The single-agent baseline that multi-agent teams aim to surpass.