Multi-Agent Software Development: From AI Assistant to Engineering Team

    Multi-agent software development works best when roles, handoffs, and acceptance criteria are explicit. This article explains how to organize planning, implementation, and review agents, govern permissions and context, and coordinate parallel work. A bookmark API rate-limiting example shows how task contracts, test evidence, escalation rules, and rollback planning turn agent collaboration into a controlled engineering workflow.

    1. From a Single Assistant to an Engineering Team

    In a conventional AI coding workflow, one model handles requirements analysis, code search, solution design, file changes, and testing in sequence. This approach has low setup overhead and works well for small, clearly bounded tasks, such as fixing a localized bug, adding a simple test, or explaining a piece of code.

    When a task spans multiple modules, however, a single assistant can run into three problems.

    First, goals and implementation details compete for context. After processing many files and test logs, the model may overlook an original compatibility requirement.

    Second, implementation and verification lack independence. A model reviewing its own work tends to follow the assumptions behind its design, making flaws in those assumptions harder to detect.

    Third, execution failures can lead to open-ended trial and error. Without explicit escalation conditions, the assistant may repeatedly change code instead of reconsidering the requirements or architecture.

    Multi-agent collaboration is not simply about adding more models. It establishes an engineering-style responsibility structure: who defines the goal, who makes changes, who provides acceptance evidence, and which problems must return to the decision-maker.

    A practical baseline includes:

    • Planning agent: Interprets requirements, investigates the project, defines design boundaries, breaks down tasks, and reviews results.
    • Execution agent: Searches code, implements changes, and runs builds and tests within the agreed task scope.
    • Acceptance reviewer: Checks the outcome against criteria defined in advance. The planning agent can perform this role, or it can be assigned separately when practical.

    These roles do not necessarily require different models, and more models do not automatically produce better results. Clear responsibilities, complete handoffs, and traceable decisions matter more.

    2. Orchestration: Turning Conversation into a Controlled Workflow

    The orchestrator’s main responsibility is to manage task state and handoffs between roles—not to make unlimited autonomous decisions on behalf of developers.

    A complete workflow can follow this sequence:

    Requirements → Project investigation → Design confirmation → Task assignment → Implementation and testing → Independent review → Human merge

    The workflow also needs exception paths:

    • Conflicting requirements: Pause implementation and request clarification of business rules.
    • Architectural constraints: Return the issue to the planning role for reassessment.
    • Persistent test failures: Submit failure evidence rather than retrying indefinitely.
    • High-risk operations: Wait for human authorization.
    • Failed acceptance review: Identify specific defects and allow a bounded number of revisions.

    This replaces “the model thinks it is finished” with “the task meets explicit completion criteria.”

    Keep a short record for each task, covering at least its goal, affected scope, design decisions, execution results, and unresolved issues. Records should contain verifiable facts, not vague conclusions such as “optimized” or “tests look fine.”

    3. Environment Setup and Configuration Migration: Govern Permissions First

    AI coding environments may use a graphical interface or a command line. A graphical interface makes it easier to inspect tasks, file changes, and conversation history. A command-line interface is easier to integrate into existing development workflows. Choose based on how the team works, not on a preference for a particular interface.

    Before deployment, complete three checks.

    Verify Software Sources and Installation Behavior

    Confirm that installation materials come from a trusted source. Inspect the behavior of installation scripts or packages, including the directories, configuration files, and environment variables they will modify. Convenience is not a reason to execute an untrusted remote script.

    In an enterprise environment, also establish whether the software requires external network access, uploads source code, and how it stores logs and task data.

    Migrate Configuration by Category

    Existing configuration generally falls into three categories:

    • External tool connections: Access to repositories, documentation, databases, or task systems.
    • Reusable workflows: Test generation, code review, release checks, and similar processes.
    • Project constraints: Coding standards, protected directories, dependency-change requirements, and security rules.

    Migration should not be a direct copy. File paths, authentication methods, and permission scopes from the old environment may no longer apply. Review them first, enable them individually, and validate them with low-risk tasks.

    Apply Least Privilege

    By default, agents should be able to read the project and run necessary tests. They should not automatically receive access to production data, deployment credentials, or destructive operations.

    Database schema changes, file deletion, access-control changes, new dependency installation, and deployment should all have explicit authorization requirements. The ability to call tools does not justify unrestricted permissions.

    4. Model Selection and Context Management

    Planning roles need reliable requirements interpretation, constraint analysis, and design review. Execution roles need accurate code navigation, focused implementation, and the ability to revise code based on tool feedback.

    Evaluate models using a set of small, real tasks. Check whether they:

    • Stay within the allowed modification scope.
    • Detect ambiguous requirements.
    • Produce runnable tests.
    • Report execution failures accurately.
    • Avoid unrelated refactoring.

    If the environment supports adjustable reasoning effort, match it to task complexity. Simple fixes do not need the highest setting. Cross-module design, security-boundary analysis, and complex troubleshooting may benefit from more extensive reasoning. Higher reasoning effort still cannot replace testing or human review.

    Context capacity also requires careful interpretation. A model’s theoretical context limit may differ from what an application actually makes available. Account permissions, tool output, and session management can further affect usable space.

    Rather than trying to put the entire project into context, organize information into layers:

    1. Project-level constraints: Architecture overview, coding standards, and test commands.
    2. Task-level information: Requirements, acceptance criteria, and relevant interfaces.
    3. Execution evidence: Change summaries, test results, and error logs.

    Each handoff should carry the information and evidence needed for the next step, reducing repeated scanning and irrelevant context.

    5. Practical Example: Rate Limiting a Bookmark API

    Rate limiting is a useful example of multi-agent collaboration because it involves business rules, API behavior, storage consistency, and test design.

    Before implementation begins, the planning role should answer:

    • Which endpoints need protection: reads, creates, or all requests?
    • What identifies the rate-limited subject: a user, an access credential, a source address, or a combination?
    • What time window applies?
    • How should the API respond when the limit is exceeded?
    • Must existing clients remain compatible?
    • How will counters remain consistent across multiple service instances?
    • If the counting infrastructure is unavailable, should requests be allowed or rejected?

    These are prerequisites for a valid design, not incidental implementation details.

    Define the Rate-Limiting Identity

    Authenticated requests can typically use a stable user identifier. Anonymous requests may use a source address, but proxy forwarding, shared network egress, and address spoofing require care.

    Do not trust a client-supplied “real source address” directly. Use validated forwarding information only after configuring a trusted proxy chain.

    Avoid writing raw access credentials into logs or counter keys. Counter keys must distinguish request subjects while protecting sensitive information.

    Choose the Algorithm and Storage

    Common options include fixed windows, sliding windows, and token buckets.

    A fixed window is simple to implement, but it can permit a burst of requests around a window boundary. A sliding window controls request distribution more precisely, usually at the cost of additional state or computation. A token bucket permits some burst traffic while limiting the long-term average rate.

    In-process memory counters can be suitable for some development and testing scenarios, but they do not inherently provide consistency across multiple instances. A multi-instance service needs shared counter storage, or an explicitly documented limit on rate-limiting accuracy.

    Shared storage also requires attention to atomic updates, expiration cleanup, request latency, and failure handling. A read-increment-write sequence is not a reliable counter implementation under concurrency.

    Define Client-Facing Behavior

    When a request exceeds the limit, return a clear rate-limit status and a stable error structure. Where appropriate, use HTTP status code 429 and provide retry timing based on the actual policy.

    The following pseudocode illustrates the flow; the project must define the concrete interfaces:

    1. subject = identify_request_subject(request)
    2. result = rate_limiter.try_acquire(subject, endpoint_id, current_time)
    3. if not result.allowed:
    4. return rate_limit_response(result.retry_wait)
    5. continue_processing_business_request()

    Keep rate limiting separate from business logic where possible. This makes the rules easier to test independently and allows the algorithm or storage implementation to change later.

    6. Write a Task Contract Before Delegating Implementation

    A plan such as “add rate limiting to the API” is too abstract to execute reliably. A useful task contract should specify:

    Goal: Limit request frequency for the designated endpoints to protect backend resources.

    Modification scope: Request entry points, the rate-limiting component, configuration loading, and related tests.

    Prohibited changes: Do not refactor unrelated modules, change existing successful response structures, or add dependencies without approval.

    Acceptance criteria: Requests within the threshold succeed; requests beyond it receive the agreed response; users have independent counters; and window recovery behaves correctly.

    Escalation conditions: Pause and submit an analysis if authentication behavior is unclear, existing storage lacks the required atomic operations, or the client protocol must change.

    The execution agent should confirm its understanding before searching and modifying code. If the plan conflicts with the actual codebase, it should report the discrepancy rather than expand the task scope on its own.

    7. Parallel Collaboration: Split Tasks, Not File Ownership

    Multiple execution agents can reduce waiting time for independent tasks, but only when the work is divided with low coupling.

    For the rate-limiting example, roles could be assigned to:

    • Investigate the existing request path and authentication entry points.
    • Prepare unit tests for the rate-limiting algorithm.
    • Check API compatibility and error responses.
    • Integrate the core implementation through a designated execution agent.

    Parallel tasks should preferably run in separate working copies to avoid simultaneous changes to the same directories or files. If tasks depend on a shared interface, agree on that interface before implementation begins.

    Integrate branches in dependency order, then rerun end-to-end validation of the combined changes. Passing tests on individual branches do not prove that the integrated result is correct.

    Parallel work also adds coordination, review, and merge costs. Splitting a small change among several agents can be slower than assigning it to one executor. Task dependencies—not the number of available models—should determine whether parallelism is worthwhile.

    8. Acceptance Requires Evidence, Not Completion Claims

    The execution agent should provide specific evidence:

    • Which files changed and why.
    • Which checks actually ran.
    • Which tests passed and which failed.
    • Which validations were not performed.
    • Remaining risks and the rollback approach.

    The acceptance reviewer should return to the original requirements rather than relying only on the implementation summary.

    For rate limiting, validation should cover at least:

    1. Requests below the threshold are allowed.
    2. The next request after the threshold is reached is rejected.
    3. Counters are isolated between subjects.
    4. Window transitions or token replenishment follow the design.
    5. Concurrent requests do not substantially exceed the intended boundary.
    6. Counter infrastructure failures follow the agreed fallback policy.
    7. Existing API behavior and client compatibility remain unchanged except where explicitly intended.

    Time-dependent tests should use a controllable time source to reduce instability caused by real waiting. Concurrency requires dedicated validation; sequential unit tests cannot establish concurrent correctness.

    If the environment cannot run a test, mark it as unverified and explain why. Static code inspection provides partial confidence, but it is not a substitute for execution results.

    9. Release and Governance: Define Stop Conditions

    Passing code review does not mean a change is ready for immediate full deployment. Rate limiting can reject legitimate requests, so use a staged rollout appropriate to the business and monitor rejection rates, request latency, error rates, and counter-storage failures.

    Key configuration must support controlled adjustment and rollback. Rollback may involve more than reverting code: it may require disabling rate limiting, restoring previous thresholds, or changing the fallback policy.

    The agent workflow itself should also define:

    • Time and resource budgets.
    • Automatic retry limits.
    • Rules for detecting unrelated changes.
    • Approval requirements for high-risk operations.
    • Records of key decisions and tool execution.
    • A human takeover path.

    Treat code, documentation, and external tool output as task material, not inherently trusted instructions. Content that asks an agent to expose credentials, expand permissions, or bypass review must not change established authorization boundaries.

    10. Start with a Small, Complete Workflow

    The most effective starting point for multi-agent development is not connecting every available tool. It is choosing a clearly bounded task and completing the cycle of planning, execution, acceptance, and rollback.

    Add roles and automation in response to observed problems. If requirements are frequently missed, improve the planning template. If test coverage is weak, add independent acceptance review. If parallel changes regularly conflict, redefine task boundaries.

    Evaluate the workflow by more than the amount of code generated. More useful measures include completion time, rework, acceptance results, production defects, and human review effort.

    The shift from an AI assistant to an AI engineering team is not primarily about giving models greater autonomy. It is about assigning responsibility within clear boundaries. Developers remain accountable for business goals, risk acceptance, and final releases; agents carry out well-defined engineering work through a verifiable process.