Skip to main content
Back to Exercises
Advanced advanced 50 min

Multi-Agent System

Design and implement a multi-agent system for a complex task.

Objectives

  • Choose appropriate orchestration pattern
  • Define agent specializations
  • Design communication mechanism
  • Handle coordination and error recovery

Beads Tasks

Create these tasks in Beads before starting. You learn Beads by using Beads.

bd create "Praxis: Design multi-agent system for [task]" --type=feature--labels=learn,advanced
bd create "Choose orchestration pattern (parallel, sequential, swarm)" --type=task--labels=learn
bd create "Define agent specializations and boundaries" --type=task--labels=learn
bd create "Design communication mechanism" --type=task--labels=learn
bd create "Implement coordination logic" --type=task--labels=learn
bd create "Handle error recovery and graceful degradation" --type=task--labels=learn

Claude Code Prompt

Copy this prompt into Claude Code to build YOUR own version:

## Setup: Track this exercise with Beads

```bash
bd create "Praxis: Design multi-agent system for [task]" --type=feature --labels=learn,advanced
bd create "Choose orchestration pattern (parallel, sequential, swarm)" --type=task --labels=learn
bd create "Define agent specializations and boundaries" --type=task --labels=learn
bd create "Design communication mechanism" --type=task --labels=learn
bd create "Implement coordination logic" --type=task --labels=learn
bd create "Handle error recovery and graceful degradation" --type=task --labels=learn
```

---

Help me design MY multi-agent system for [COMPLEX_TASK].

I'm building a system where multiple agents work together. Guide me through:

1. **Analyze the task**:
   What is [COMPLEX_TASK]?
   - What sub-tasks can be parallelized?
   - What must happen sequentially?
   - What requires coordination between agents?

2. **Choose orchestration pattern**:

   **Parallel** (independent work):
   - Tasks don't depend on each other
   - Speed is the priority
   - Example: Reviewing multiple files simultaneously

   **Sequential** (pipeline):
   - Each stage feeds the next
   - Order matters
   - Example: Parse → Transform → Validate → Deploy

   **Swarm** (collaborative):
   - Agents share context
   - Dynamic task assignment
   - Example: Exploring a codebase together

   Which pattern fits MY task?

3. **Define agent specializations**:
   | Agent | Specialization | Tools | Boundaries |
   |-------|----------------|-------|------------|
   | Research | Information gathering | Web, Read | No writes |
   | Implement | Code changes | Edit, Write | No deploys |
   | Review | Quality assurance | Read, Grep | No edits |

4. **Design communication**:
   How do agents share information?
   - Shared file system?
   - Message passing?
   - Shared database (D1)?

5. **Implement coordination**:
   Using Claude Code's Task tool:
   ```
   Task: "Research the authentication patterns in this codebase"
   subagent_type: "Explore"
   run_in_background: true
   ```

6. **Handle errors**:
   - What if an agent fails?
   - How do we retry vs. skip?
   - What's the graceful degradation path?

7. **Document MY multi-agent patterns**:
   - When do I use multi-agent vs. single agent?
   - What specializations are reusable?
   - What coordination patterns work for my domain?

Complex task: [YOUR_COMPLEX_TASK]
Sub-tasks: [LIST_THE_PARTS]

Your Design

Document your design decisions and artifacts below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15