Building Multi-Agent Systems: A Practical Guide to Agent Configuration and Kanban Collaboration
This guide explains why single-agent workflows break down on complex tasks and how a multi-agent architecture solves the problem through context isolation, role separation, and externalized state. It defines three core concepts—agents, configuration files, and kanban boards—then walks through building a collaboration system step by step: splitting roles by cognitive responsibility, designing task cards with dependency graphs, defining handoff protocols, persisting state for recovery, and adding observability. It also covers common failure modes such as context bloat, role overreach, task starvation, duplicated work, and deadlocks, and closes with a phased rollout path from a single role to a four-role pipeline under version control.
1. Why a Single Agent Is Not Enough
Early AI coding tools mostly used a “single-session” design: one assistant handled requirement understanding, code retrieval, implementation, and verification feedback all in the same conversation. As task complexity grows, this model exposes three structural problems.
The first is context pollution. Subtasks of different natures share the same session memory, so irrelevant retrieved fragments keep interfering with decisions and output quality degrades with each turn. The second is blurred responsibility boundaries. When one agent plays architect, implementer, and reviewer at once, effective self-checking becomes difficult. The third is invisible progress. Task state lives only inside the session, so an interrupted process loses all progress and team collaboration has no starting point.
A multi-agent architecture is the engineering answer to these three issues: isolate context through configuration, divide responsibilities by role, and externalize state onto a kanban board.
2. Rigorous Definitions of Three Core Concepts
Agent: An Execution Unit with Its Own Context and Tool Boundaries
An agent is not just a prompt template. It is a runtime entity made of four elements: a role definition (how it thinks), a skill set (what it can do), a memory space (what it remembers), and tool permissions (the boundaries of its actions). Together these four elements form a closed and predictable reasoning environment. Agents do not share internal state by default; they exchange information only through explicit messages or a shared task board.
Configuration File: A Declarative Definition of an Agent
A configuration file is an agent’s “identity credential plus behavior manual,” capturing the four elements as structured text. Creating a configuration file is equivalent to creating an agent, and switching configuration files is equivalent to swapping the executor. The value of declarative definitions is that they are versionable, reviewable, and reusable: a team can bring role design into code review instead of leaving it scattered across chat logs.
A sample configuration structure looks like this (field names are generic illustrations, not a specific product interface):
agent:name: reviewer # unique identifierrole: code reviewer # role definitionskills: # available skills- static_analysis- diff_reviewmemory:scope: session # memory scope: session-level / task-levelmax_turns: 20 # context window constrainttools: # tool permissions, following least privilegeread: ["repo://src/**"]write: []handoff: # collaboration exitto: ["implementer"]via: kanban
Three design points matter here. First, least privilege: review roles get read-only access to prevent unauthorized changes. Second, explicit memory scope declarations prevent cross-task contamination. Third, writing the collaboration exit into the configuration makes the handoff path part of the design rather than an ad-hoc arrangement.
Kanban Board: An Externalized Collaboration State Machine
A kanban board is essentially a persistent task table plus a set of state transition rules. It moves “who is doing what, where things are stuck, and who they depend on” out of session memory and into shared storage, which gives it three key properties: real-time progress visibility, no progress loss on process restart, and dependency-driven transitions. Tasks typically move through four states on the board: To Do → In Progress → Pending Acceptance → Done. On failure, a task enters Blocked with a reason attached.
3. Building a Multi-Agent Collaboration System from Scratch
Step 1: Split Roles by Responsibility, Not by Module
A common mistake is to split agents along the code directory tree, which forces every role to understand the whole system and cancels out the isolation benefit. The right approach is to split by cognitive responsibility. Four typical roles:
- Planner: breaks down requirements, defines acceptance criteria, creates task cards, and does not modify code directly;
- Implementer: picks up tasks, writes and modifies code, with limited write access;
- Reviewer: read-only, responsible for static checks, diff review, and risk annotation;
- Verifier: runs tests and builds, reports pass rates and failure summaries.
Keep the number of roles between three and five. Too few gives insufficient isolation; too many sharply increases handoff overhead and scheduling conflicts.
Step 2: Design Task Cards and Dependencies
The task card is the smallest unit of collaboration. A card should contain seven fields: a stable identifier, title, acceptance criteria, assigned role, priority, dependency list, and artifact links. Dependencies are the core of orchestration, described as a directed acyclic graph:
{"id": "T-102","title": "Implement cache invalidation logic","assignee": "implementer","deps": ["T-101"],"acceptance": ["Unit test coverage no lower than the existing baseline", "No new static analysis warnings"],"status": "todo"}
The scheduler releases only those task cards whose dependencies are all complete, which naturally forms a pipeline: the planner produces T-101, the implementer picks up T-102, and the reviewer and verifier start in parallel once T-102 is done. If dependencies form a cycle, reject them during planning to avoid deadlock.
Step 3: Define the Handoff Protocol
Handoffs between agents must be structured. Use a fixed four-part message: task identifier, current status, output summary, and suggested next step. Do not embed large blocks of raw logs in handoff messages; pass logs by link through a logging service or object storage. This keeps context size under control and makes later tracing easier.
Step 4: State Persistence and Recovery
Kanban data should live in external storage (a relational database, object storage, or a persistent volume mounted by a container platform) rather than process memory. Every state change writes a timestamped event record, forming a replayable event stream. After an abnormal exit, the process loads the kanban snapshot on restart, moves In Progress tasks back to To Do with a retry counter attached, and achieves lossless recovery.
Step 5: Build Observability
Debugging a multi-agent system is far harder than debugging a monolith, so three types of observability are required. First, task-level metrics: time spent in each state, retry counts, and blocking rate. Second, call chain tracing: generate a trace identifier that spans each handoff. Third, cost metrics: context consumption broken down by role. Setting thresholds on blocking rate and retry counts through monitoring and alerting lets you intervene before collaboration freezes up.
4. Common Problems and How to Avoid Them
Context bloat: set a memory limit and a summarization strategy for each role, converting long histories into structured summaries instead of piling up raw text.
Role overreach: grant write access only to the implementer, keep all other roles read-only, and record overreach attempts as audit events.
Task starvation: introduce priority and an aging factor on the board, so the longer a task waits, the higher its weight.
Duplicated work: run a similarity search before creating a task card, and merge into an existing card on a hit instead of creating a new one.
Collaboration deadlock: keep the dependency graph acyclic, and automatically roll back on handoff timeout, escalating to a human queue.
5. A Recommended Rollout Path
First, get the configuration file and kanban board working in a single-role scenario, and validate the persistence and recovery logic. Then introduce a second role and observe whether the handoff protocol is structured enough. Next, expand to a four-role pipeline and wire in metrics and alerting. Finally, bring the configuration and kanban schema under version control and add regression checks through continuous integration. If you run on a container platform, mount kanban storage and logs externally so agent instances stay stateless, which enables elastic scaling and canary releases.
Following this path, a multi-agent system evolves from “able to converse” to “able to deliver”: clear role boundaries, queryable task state, recoverable failures, and measurable collaboration. Those four points are the foundation for reliably landing complex engineering work.
