Building Multi-Agent Systems: A Practical Guide to Kanban-Based Collaboration

    This guide explains why single-agent setups hit structural limits and how multi-agent architectures solve them through role isolation, configuration profiles, and a shared Kanban board. You will learn how to define agents, split roles by cognitive stage, set input and output contracts, manage concurrency and file conflicts, add human approval gates, and persist state with dependency-driven scheduling. It also covers common anti-patterns and a phased rollout plan with metrics to measure whether the collaboration model actually works.

    1. The Starting Problem: Why a Single Agent Is Not Enough

    In real engineering scenarios, when one agent handles everything, three structural problems tend to surface.

    The first is context bloat. Requirement analysis, code search, implementation, testing, and review all get packed into the same session. Historical information quickly crowds out the effective window, the model’s attention is diluted, and output quality degrades with each turn.

    The second is blurred responsibility boundaries. The same role is asked to make architectural trade-offs and to write boilerplate code. This persona conflict makes it swing back and forth between “play it safe” and “experiment quickly.”

    The third is unrecoverable state. Once a long-running task’s session is interrupted, progress exists only in the conversation history. After a restart, a human has to restate the context manually.

    The essence of a multi-agent approach is to decouple these concerns: isolate roles through configuration, carry state on a board, and constrain interactions with a collaboration protocol. Let’s first define the three core concepts precisely.

    2. Precise Definitions of the Three Core Concepts

    Agent: An Execution Unit With Its Own Persona and Memory

    An agent is an execution subject with a clear goal, an available toolset, and an independent memory context. Its independence shows up in three places: persona (answer style, decision preferences, area of expertise), skills (callable tools and scope of operations), and memory (only the conversation history relevant to its own responsibilities). Together, these three determine its consistent performance on a certain class of tasks.

    Configuration Profile: The Agent’s Identity and Instruction Manual

    A configuration profile is the structured carrier of an agent definition. It typically contains four parts: role description, skill list, tool permissions, and memory policy. One profile maps to one agent; loading a profile instantiates the agent, and switching profiles is equivalent to swapping the executor. The engineering value of this design is that role definitions are decoupled from runtime instances, so profiles can be version-controlled, reused, and audited.

    A sample profile structure (YAML-style pseudocode that only expresses field semantics):

    1. agent_profile:
    2. name: implementer
    3. role: Backend implementation engineer, responsible only for coding against agreed interfaces
    4. skills: [code_search, file_edit, run_tests]
    5. permissions:
    6. read: [src/**, docs/**]
    7. write: [src/**]
    8. deny: [deploy/**, config/prod/**]
    9. memory:
    10. scope: task_only
    11. max_turns: 20

    The “default deny” behavior of the permissions field is a key practice: declare the forbidden scope first, then open access as needed, so the agent does not overstep and modify production configuration.

    Kanban Board: A Visual Dispatch Console for Multi-Agent Collaboration

    A Kanban board is a shared task whiteboard where tasks move as cards through “To Do -> In Progress -> Done.” It solves three things: clear task ownership (each card has exactly one responsible agent), real-time progress visibility (humans can step in at any time), and state persistence (nothing is lost on restart, with dependency-driven automatic transitions). The board is not a replacement for chat history; it is the single source of truth for collaboration.

    3. A Four-Step Method for Building Multi-Agent Systems

    Step 1: Split Roles by Concern, Not by Tech Stack

    A common mistake is to carve out a “frontend agent, backend agent, database agent.” The result is that every role needs to understand the global requirement, context is duplicated, and boundaries stay blurry. A more robust split is by cognitive stage: requirements clarifier, solution designer, implementer, verifier, reviewer. Each stage takes structured artifacts as input and produces structured artifacts as output, so handoffs are cheap.

    Step 2: Define Input and Output Contracts for Each Role

    Most collaboration failures come from ambiguous handoff semantics. It is recommended to specify required fields for every card:

    1. {
    2. "task_id": "T-102",
    3. "goal": "Add pagination parameters to the order query API",
    4. "input": ["docs/api.md#order-query", "src/order/handler.ts"],
    5. "output": ["src/order/handler.ts", "tests/order.test.ts"],
    6. "acceptance": ["default page size is 20", "out-of-range page returns an empty list", "unit tests pass"],
    7. "depends_on": ["T-101"]
    8. }

    Acceptance criteria must be decidable; otherwise the downstream verifier can only wave things through based on gut feeling.

    Step 3: Control Concurrency and Shared-Resource Conflicts

    When multiple implementers run in parallel, the biggest risk is editing the same file. In practice, use “file leases”: a card declares the paths it will modify, and the board checks for conflicts before dispatch. On conflict, it automatically degrades to serial execution and writes a dependency. Also cap global concurrency (usually 2-4 executors) to avoid tool calls and test environments competing for resources.

    Step 4: Add Human Confirmation Gates

    High-risk actions (deleting data, changing permissions, publishing configuration) should not be completed autonomously by agents. The approach is to add a “Pending Confirmation” column to the board. A card pauses when it enters this column and only moves on after human approval. This preserves the gains of automation while keeping irreversible operations under human control.

    4. How Kanban Collaboration Runs

    A typical flow goes like this: the clarifier turns a vague requirement into a card with acceptance criteria and puts it in To Do; the designer picks it up, produces a design note and task breakdown, generates sub-cards, and establishes dependencies; the implementer takes cards with no blocking prerequisites in dependency order and writes code and tests; the verifier runs the tests and fills in the results, and on failure sends the card back to In Progress with the failure reason attached; the reviewer does a final check and archives it on pass.

    The key point of dependency-driven scheduling is “only release cards whose prerequisites are done.” If dependencies are written as a directed acyclic graph, the scheduler can automatically compute the executable set for each round, with no manual ordering. When a cycle is detected (A depends on B, B depends on A), it should raise an error immediately; this usually means the task breakdown itself is flawed.

    For state persistence, board data should live on durable storage (such as a relational database or structured files in object storage). Each transition writes an event record, forming a replayable operation log. This way, after a restart you can not only restore progress but also review “why a card was sent back three times.”

    5. Common Anti-Patterns and Fixes

    • Too many roles: beyond seven roles, communication cost rises sharply; merge roles with similar responsibilities.
    • Cards too coarse: a card containing multiple independently verifiable goals leads to unclear ownership; split it to a granularity that can be accepted within half a day.
    • Memory overreach: letting all agents share the full history throws away the isolation benefit; trim memory to the task scope.
    • No fallback path: rewriting directly after a verification failure loses the accumulated failure reason; require a failure summary before sending the card back.
    • Permissions too broad: giving the implementer production write access is an uncontrollable risk; stick to least privilege and default deny.

    6. Implementation Recommendations

    To lower the cost of building your own system, you can compose general cloud capabilities: use a container platform to host each agent runtime for isolation and elasticity, use a message queue to distribute and buffer card events, use object storage to keep profiles and artifacts, and use logging and monitoring/alerting to observe transition latency and failure rates. Baidu AI Cloud offers corresponding capabilities in these general categories, so you can select what you need and avoid tightly coupling scheduling logic to infrastructure.

    The recommended rollout pace is to pilot two or three roles in one low-risk module, get the “card - dependency - acceptance - archive” loop working end to end, then gradually expand roles and concurrency. Measure three metrics: average card transition time, bounce-back rate, and number of human interventions. If all three keep improving, the collaboration paradigm is genuinely working, rather than just splitting one conversation into multiple windows.