Multi-Agent Orchestration in Practice: From an AI Assistant to an AI Development Team

    Learn how to organize AI-assisted development around separate planning and execution roles, structured task handoffs, and quality gates. This article covers configuration migration, context and state management, failure escalation, and a phased rollout that makes development workflows easier to review, verify, and roll back.

    1. Where the Single-Model Approach Breaks Down

    In early AI-assisted development workflows, a single general-purpose large language model often handles five types of work: planning, code retrieval, editing, building, and testing. This approach can be efficient for small changes, but as tasks grow, three recurring problems emerge.

    The first is context contamination. Planning notes, large blocks of retrieved source code, and build failure logs accumulate in the same context. During subsequent edits, irrelevant details can distract the model, leading it to change unrelated code.

    The second is conflicting role objectives. Planning calls for a cautious, system-wide approach with a clear rollback path. Execution calls for focused changes and rapid experimentation. Trying to enforce both objectives through the same prompt often produces a mixture of overengineering and rushed implementation.

    The third is difficult failure recovery. When a build or test fails, a single model may keep making incremental adjustments within the same context. There is no independent reviewer to decide whether to keep fixing the implementation or reconsider the plan.

    Together, these problems point to an organizational issue rather than simply a model capability issue: responsibilities have not been separated.

    2. Separate Planning from Execution

    The core idea behind multi-agent orchestration is to divide the workflow into two complementary roles, with an escalation path when execution needs a new plan.

    • Planner: Clarifies requirements, designs the solution, selects technologies, assesses the scope of impact, defines acceptance criteria, and performs the final code review. Its output explains what to do, why to do it, and how to verify the result.
    • Executor: Retrieves code, edits files, installs dependencies, and runs builds and tests. Its output records what changed, which commands ran, and what results they produced.
    • Escalation loop: When consecutive execution failures reach a defined threshold, or when a planning assumption proves invalid, the executor returns a structured problem summary to the planner for a new decision instead of continuing to patch the implementation.

    This separation creates clear checkpoints. People can review planning outputs, while machines can verify execution outputs. Planning and implementation errors can therefore be caught at different stages.

    3. Prepare the Environment and Migrate Configuration

    Before deployment, prepare two interfaces: a graphical interface for inspecting sessions, files, and task status, and a command-line interface for scripting and running tasks on remote hosts. Both should share the same role configuration to avoid behavioral drift.

    When migrating configuration from existing tools, follow three steps: export, trim, and validate.

    1. Export existing rule files, ignore lists, commonly used command aliases, and coding conventions.
    2. Remove entries that do not apply to the current technology stack, especially outdated directory allowlists.
    3. Validate the migrated configuration with a small, real task. Confirm that permission boundaries and coding conventions are enforced.

    Before running any remote installation script, verify its source and inspect its contents. Confirm that the download location is trustworthy and that the script’s behavior can be audited before authorizing execution. This is a basic supply-chain security requirement, regardless of the tool being installed.

    4. Define a Structured Task Handoff

    The two roles should exchange structured information rather than rely on informal conversation. The following is a minimal handoff example, not an interface for a specific product:

    1. {
    2. "task_id": "T-014",
    3. "goal": "Add pagination parameters to the order query API",
    4. "constraints": [
    5. "Do not change the database schema",
    6. "Maintain backward compatibility"
    7. ],
    8. "acceptance": [
    9. "Add unit tests for empty and final pages",
    10. "Build passes"
    11. ],
    12. "attempts": 0,
    13. "artifacts": [
    14. "src/api/order.ts",
    15. "tests/order.spec.ts"
    16. ]
    17. }

    The planner supplies goal, constraints, and acceptance. The executor updates attempts and artifacts, and adds a failure_summary when execution fails. Once attempts exceeds the configured threshold, the escalation loop is triggered.

    Structured handoffs can be persisted and replayed, making it possible to trace a problem back to a specific decision.

    5. Manage Context and State Explicitly

    Adding roles does not automatically prevent context growth. Boundaries must be designed deliberately:

    • Maintain a separate context for each role. Give the executor only the current subtask and relevant files.
    • Store persistent project facts—such as architectural constraints, naming conventions, and prohibited actions—in project-level rule files rather than repeatedly pasting them into conversations.
    • Summarize large logs and retrieval results, save the summaries to disk, and pass only those summaries to the model.
    • Use a shared ignore list to exclude dependency directories, build artifacts, and local configuration files, reducing both noise and the risk of exposing sensitive information.

    For collaboration across sessions, general-purpose cloud capabilities can support external state management. Object storage can hold handoff artifacts, message queues can connect asynchronous tasks, container platforms can provide isolated execution environments, and logging and monitoring services can preserve records and issue alerts.

    These are capability categories, not product recommendations. Specific choices should be evaluated against compliance requirements and cost constraints.

    6. Establish Quality Gates and a Review Loop

    Automation does not remove the need for verification. Set up four quality gates:

    1. Static checks: Block progress when formatting or type checks fail.
    2. Build gate: Require successful compilation or packaging.
    3. Test gate: Require tests for new behavior and prevent a decline in test coverage.
    4. Human review: Have the planner provide a change summary and risk assessment, with a person making the final decision.

    The executor’s changes should be eligible for merging only after all four gates pass. Review should produce a structured outcome—approved, changes required, or replanning required—so that the workflow closes with an explicit decision rather than an informal judgment.

    7. Common Anti-Patterns

    • Roles in name only: Giving both roles the same prompt effectively recreates a single-model workflow.
    • Escalation without a threshold: Returning to planning after every failure creates repeated cycles with little progress.
    • Excessive permissions: Giving the executor write access to production environments creates unacceptable risk.
    • Recording conclusions but not the process: Without handoff records, decisions and failures cannot be reconstructed.
    • Full automation too early: Start with a low-risk repository and expand the scope gradually.

    8. Roll Out in Stages

    Stage 1: Separate the roles and validate the handoff protocol in a small repository.

    Stage 2: Add quality gates and failure thresholds, then assess whether the escalation loop works effectively.

    Stage 3: Move state into general-purpose cloud services to support parallel tasks and auditing.

    Stage 4: Build a team-wide library of rules and templates that new members can reuse.

    Measure engineering outcomes rather than how impressive the workflow appears. Useful metrics include first-pass success rate, average number of rework cycles, time spent on human review, and rollback rate. Expand the scope of automation only after these metrics stabilize.

    Moving from one AI assistant to an AI development team means turning an opaque reasoning process into engineering steps that can be reviewed, verified, and rolled back. Role separation addresses conflicting objectives, structured handoffs reduce information loss, and quality gates establish a basis for trust. Without all three, a multi-agent workflow is merely a more complicated version of an unreliable single-model approach.