Multi-Agent Development in Practice: From Code Generation to Team Scheduling

    Multi-agent development extends beyond individual model capabilities to become an engineering coordination challenge. This article explores practical strategies for multi-agent development, covering task decomposition, dependency graph management, shared memory maintenance, concurrent collaboration, layered verification, the evolving role of developers, tool design, and a phased approach for enterprise adoption. It emphasizes that successful multi-agent systems require controlled delivery chains rather than simply scaling up concurrent instances.

    1. Why More Agents Might Slow Down Development

    Traditional AI-assisted programming primarily focuses on local tasks: explaining code, completing functions, generating test cases, or assisting in debugging. Developers hold the context, decide the scope of modifications, and take responsibility for the final output.

    When agents can continuously read codebases, modify multiple files, execute tests, and commit changes, this collaborative relationship shifts. Developers are no longer just reviewing generated results line by line; they must also assign tasks, coordinate dependencies, handle conflicts, and determine whether the entire project is genuinely progressing toward its goals.

    Consider a scenario with 320 programming instances running simultaneously. This number only indicates the scale of concurrency, not productivity. Assuming each instance consumes about 1GB of memory, the instances alone might consume 320GB of RAM. This is a basic capacity estimate; actual resource demands are also affected by context length, process structure, test loads, and execution methods. Beyond this, code builds, storage I/O, network requests, and model invocation costs must be considered.

    More importantly, an instance does not equate to an effective unit of work. One agent might be writing a feature, another modifying the same module, and a third generating tests based on an outdated interface. Each local result might look reasonable, but merged together, they may fail to run.

    Therefore, multi-agent development is primarily an engineering coordination problem, and secondarily a model capability problem. The key metric for measuring system maturity is not “how many instances were launched simultaneously,” but “how many verified changes were stably delivered.”

    2. Transforming Development Tasks into Schedulable Work Units

    Clear Task Boundaries

    “Complete the user management module” is a suitable business goal, but not an execution task directly assignable to multiple agents. It encompasses multiple layers such as permission design, data structures, interface implementation, exception handling, testing, and documentation, with dependencies between different tasks.

    A better approach is to break it down into work units with independent acceptance criteria, such as:

    • Define account states and state transition constraints;
    • Define the inputs, outputs, and error semantics of the read interface;
    • Implement permission validation for state changes;
    • Add tests for illegal state transitions;
    • Check whether existing callers are compatible with the new interface contract.

    Each task should at least record its goal, input materials, allowed modification scope, prerequisites, expected output, and acceptance criteria. This gives the scheduling system a basis to determine whether tasks can be parallelized and which verification process they should enter upon completion.

    Tasks should not be infinitely subdivided either. Over-segmentation increases the overhead of context passing, model invocation, and result integration. A reasonable granularity should allow tasks to be independently verified while retaining sufficient business context.

    Organizing Work with Dependency Graphs Instead of Chat Histories

    Multi-agent collaboration should not rely on developers remembering “who is waiting for whom.” The sequential relationships between tasks should be explicitly stored as a dependency graph.

    For example, interface implementation depends on the interface contract, caller adaptation depends on contract stability, and integration verification depends on both implementation and adaptation being complete. The scheduling system should only launch tasks whose prerequisites are met and block subsequent tasks from continuing on failed assumptions when dependencies fail or change.

    When circular dependencies arise between tasks, boundaries should be redrawn first, or a common contract confirmation step should be extracted, rather than having agents wait for each other. Otherwise, the system appears busy but makes no deliverable progress.

    3. Shared Memory is About Maintaining Engineering Facts, Not Saving More Conversations

    A single agent’s conversational context has capacity limits and may be lost when the session ends. When dozens or even hundreds of agents collaborate, if each instance tries to understand the project from scratch, costs will rise rapidly; if they rely on different versions of information, errors will propagate.

    Therefore, shared memory should serve as the “foundation of engineering facts” rather than simply archiving all chat content.

    Distinguishing Facts, Decisions, and Speculations

    Shared information can be at least categorized into three types:

    • Verified facts: Current code locations, interface definitions, test results, merged changes.
    • Engineering decisions: Reasons for adopting a certain data structure, compatibility requirements, explicitly prohibited implementation methods.
    • Unverified speculations: Possible causes of failures, unconfirmed performance bottlenecks, temporary workarounds.

    These three types must not be conflated. If a judgment made by one agent enters the public knowledge base without verification, other agents may treat it as an established fact, causing errors to multiply.

    Important records should be accompanied by their source, timestamp, associated code version, and verification status. When reading this information, agents should also check whether it applies to the current task, rather than assuming that “once written, it is always valid.”

    Update and Invalidation Mechanisms for Shared Memory

    After an interface is adjusted, the old contract must be marked as expired; test conclusions only prove the performance of a specific version in a specific environment and cannot directly cover subsequent changes.

    In practice, structured task records, versioned design specifications, test evidence indexes, and searchable project summaries can be used. When an agent executes a task, it should only load relevant information, rather than stuffing the entire project history into its context.

    Special attention should be paid: summaries or indexes used for retrieval should not become the sole source of truth. For code behavior, security requirements, or acceptance conclusions, it should still be possible to trace back to the original files, formal decision records, and actual execution results.

    4. Concurrent Collaboration Must Resolve Write Conflicts and Redundant Execution

    Isolating Workspaces and Restricting Change Scopes

    Multiple agents directly modifying the same working directory will result in file overwrites, dependency pollution, and irreproducible test results. A more robust approach is to provide isolated workspaces for tasks and clearly define the allowed access and modification scopes.

    Isolation does not mean logical conflicts can be ignored. Even if two tasks modify different files, they might separately change the interface provider and the caller, creating semantic inconsistencies. Therefore, the system needs to check for both textual conflicts and behavioral contract violations.

    Tasks involving core configurations, permission rules, data migrations, and public interfaces can have stricter review requirements to prevent local modifications from causing global impacts.

    Using Task Leases and State Control to Prevent Redundant Work

    In systems with process exits, network interruptions, or execution timeouts, the same task might be reassigned. The scheduling system should record the assignee, assignment time, lease duration, and execution progress, and control task ownership through atomic state changes.

    A representative task state flow can be:

    Pending -> Assigned -> In Progress -> Pending Verification -> Pending Integration -> Completed

    If execution fails, acceptance is not passed, or it is manually returned, the task should enter a specific branch state rather than directly overwriting historical records.

    An expired lease does not necessarily mean the original executor has stopped working. Therefore, key writes should also validate the current task version or valid execution token to prevent old executors from continuing to submit results. For operations such as submitting changes or releasing artifacts, idempotent mechanisms should be designed as much as possible to reduce the side effects of redundant execution.

    5. “The Agent Says It’s Done” is Not an Acceptance Criterion

    The most dangerous misconception in multi-agent development is equating a natural language statement of completion with engineering completion. Whether a task is successful should be determined by verifiable evidence.

    Establishing a Layered Verification Process

    Verification can generally be divided into the following layers:

    Basic Checks: Does the code meet formatting constraints? Are there obvious syntax, type, or static analysis issues?

    Local Tests: Does the new feature meet expectations? Are exception inputs and boundary conditions covered?

    Integration Tests: Do the changes affect other modules? Are interfaces and data interactions consistent?

    Security and Compliance Checks: Does it introduce unauthorized access, sensitive information leakage, insecure data processing, or unauthorized dependencies?

    Manual Review: For business rules, architectural trade-offs, and high-risk operations, confirmation should be made by a responsible human.

    These checks should be executed by independent processes as much as possible. An agent that generated the code claiming “tests passed” cannot replace actual test results from a trusted execution environment.

    Tests Themselves Need Review

    If both the implementation and the tests are generated by the same agent, they might share the same misunderstanding. All tests passing does not necessarily mean the requirements are met.

    Key business scenarios should retain independently defined acceptance cases, including normal paths, boundary inputs, permission denials, and failure recovery. If necessary, different execution units can supplement the tests, followed by manual confirmation that the tests genuinely cover the business goals.

    For tasks where requirements are still ambiguous, clarification should be requested first, rather than letting the agent fill in assumptions and then proceed to integration.

    6. The Developer’s Role Shifts to Scheduling, But Does Not Disappear

    Multi-agent development indeed has the characteristics of strategic scheduling: limited resources need to be allocated, dependencies exist between tasks, certain operations need to wait, and local failures require replanning.

    However, software development cannot be simply understood as “launch units, wait for victory.” Real engineering also involves requirement correctness, data security, long-term maintenance, and accountability. A scheduling interface can reduce operational burden but cannot replace the understanding of system behavior.

    Developers need to strengthen three capabilities:

    First, defining problems. Transforming vague goals into executable constraints, interface contracts, and acceptance criteria.

    Second, designing collaboration. Identifying parallelizable tasks, arranging shared memory, isolation mechanisms, and verification processes.

    Third, controlling risks. Determining which changes can be automatically merged, which require manual approval, and which failures necessitate immediate halting of subsequent execution.

    This does not mean coding skills are no longer needed; rather, it requires developers to use coding skills at a higher level: understanding key implementations, identifying systemic flaws, and ensuring that automated behavior always serves the correct goals.

    7. Whether Tools are Adopted by Agents Depends on Comprehensibility and Operability

    As agents take on more execution work, the users of software tools are no longer just humans. Whether a tool is easy for automated systems to understand also affects its probability of entering the engineering process.

    However, interpreting this trend as “if the model knows a tool, it will definitely be able to use it” is too absolute. Model selection is also constrained by context, tool permissions, organizational norms, availability, and verification results.

    More robust product and system design directions include:

    • Provide clear, stable, and machine-readable inputs and outputs;
    • Let error messages explain the failure cause and feasible recovery paths;
    • Explicitly distinguish query operations from operations with side effects;
    • Provide pre-checks, confirmations, and rollback mechanisms for high-risk operations;
    • Reduce the number of calls required to complete common tasks while retaining necessary evidence;
    • Provide status queries, cancellations, and timeout handling for long-running operations.

    Reducing context consumption is valuable, but important constraints should not be hidden just to save a few calls. Reliability, security, and auditability should take precedence over the superficially shortest path.

    8. Enterprise Adoption Should Start with Controlled Pilots

    Starting with hundreds of agents is not recommended. A more realistic path is to first select low-risk, clearly bounded tasks with mature acceptance methods, such as adding tests, updating internal documentation, fixing local defects, or executing constrained code refactoring.

    Phase One: Verify the execution quality of individual tasks to ensure inputs, outputs, and acceptance evidence are fully recorded.

    Phase Two: Introduce a small number of parallel tasks to check whether dependency management, workspace isolation, and result integration are effective.

    Phase Three: Establish shared memory, automated verification, permission layering, and failure recovery mechanisms, then gradually increase concurrency scale.

    Phase Four: Adjust scheduling strategies based on real metrics, rather than scaling up based on demo effects.

    Metrics worth continuously observing include: task end-to-end completion time, first-time acceptance pass rate, rework ratio, integration conflict rate, manual review time, and total cost per unit of valid change. Model invocation, operational resources, and manual governance should all be included in the cost, not just comparing code generation speed.

    Additionally, agent permissions should follow the principle of least privilege. Text in code repositories, external materials, and execution outputs may contain untrusted instructions; entering the context should not grant them permissions to modify the system, read credentials, or release artifacts.

    Conclusion

    The value of multi-agent development does not lie in having more instances output code simultaneously, but in connecting requirements, tasks, memory, execution, and verification into a controllable delivery chain.

    Once the scheduling mechanism matures, developers can indeed step away from a large number of repetitive operations and invest their energy into goal definition, architectural judgment, and quality governance. However, this shift has no fixed timeline applicable to all teams and will not happen automatically.

    A truly reliable agent team must do four things: know what to do, understand the current effective engineering facts, execute in a restricted environment, and prove the results with independent evidence. Only when these foundations are established can the growth in concurrency scale translate into sustainable, measurable software delivery capabilities.