Multi-Agent Orchestration: From Code Generation to Building an Operating System
This article explains how multi-agent orchestration turns large language models from code generators into task schedulers and engineering coordinators. It covers how planning, execution, review, integration, and observability layers work together, using an operating system prototype, 3D scene generation, and hardware-software co-design as examples. It also outlines an engineering architecture, cost routing, and the metrics teams can use to judge whether the approach works.
For the past two years, many teams have treated large language models as stronger search engines: they ask a question and get an answer. In complex engineering work, however, the scarce capability is not a single generated result. It is the ability to break a goal into tasks, organize multiple execution units, verify results continuously, and integrate everything in the end. This is where multi-agent orchestration adds value. It moves the model from a “code generator” to a “task scheduler” and “engineering coordinator,” splitting large projects into subtasks that can run in parallel, be reviewed, and be rolled back.
1. From Q&A Tools to Task Schedulers
The traditional question-and-answer model follows a single-turn “prompt, then response” pattern. It works well for information lookup, text editing, and local code completion. Complex system development, however, requires a long workflow: define the architecture first, then set module boundaries and interface contracts, develop and test modules in parallel, review and integrate them, and finally validate and deliver. Multi-agent orchestration makes this workflow explicit:
- The planning layer converts the goal into a task graph, with dependencies, acceptance criteria, and resource budgets.
- The execution layer uses multiple sub-agents to build relatively independent modules, write tests, generate documentation, and fix issues.
- The review layer runs static checks, interface consistency checks, and test coverage checks on submitted changes.
- The integration layer merges branches that pass verification, then triggers builds and acceptance tests.
- The observability layer records decisions, logs, metrics, and artifacts so the process can be traced.
This model does not replace engineering teams. It increases what they can do. People remain responsible for setting goals, making key trade-offs, defining security boundaries, and giving final sign-off. The models handle frequent, parallel, verifiable execution work.
2. Case Study: Building a Bootable Operating System Prototype from an Empty Directory
One representative experiment starts an orchestration system with an empty workspace and asks it to build a bootable operating system prototype from scratch. The difficulty is not generating a few scripts. It is managing the coupling between the kernel, memory management, hardware drivers, file storage, the window system, and the login interface. The sensible approach is not to write code immediately. Instead, a coordinator agent first acts as the architect:
- Produce architecture decision records that define module boundaries, dependency direction, and key constraints.
- Define interface contracts, such as the calling conventions between the kernel and drivers, or between the file system and the upper-level interface.
- Establish acceptance criteria, including a passing build, a passing boot self-check, passing core tests, and a runnable critical path.
- Generate a task graph that splits the large goal into parallelizable subtasks.
- Dispatch a large number of sub-agents to handle development, testing, review, and merging.
- Send failed tasks to a rework queue, with failure reasons and minimal reproduction information attached.
Public experiments show that an orchestration system can schedule more than a thousand subtasks in parallel. After several rounds of testing, review, and merging, it can deliver a bootable prototype. The key to success is not that the model gets everything right on the first try. It is the engineering closed loop: tasks are small enough, interface contracts are clear, every change has tests, and every merge passes a quality gate. Parallel development also creates conflicts, such as interface drift, duplicate implementations, insufficient test coverage, and security vulnerabilities. For that reason, teams need version control policies, interface freezing mechanisms, sandboxed execution, and automated review.
3. 3D Interaction and Large-Scale Scene Generation
Multi-agent orchestration also applies to graphics and interactive scenes. Take a 3D typewriter as an example. The work can be divided into mesh modeling, materials and lighting, the interaction interface, key-press motion mechanics, performance optimization, and accessibility checks. Each subtask has a clear output and a defined verification method. Model meshes must meet face count and coordinate constraints. Lighting must stay within a performance budget. Key-press motion must pass state machine tests. The interface must pass event replay validation.
Large-scale scene generation follows the same pattern. Building hundreds of interconnected 3D worlds from a text description looks like a single content generation task. In practice, it combines scene graph construction, connectivity topology validation, state persistence, loading strategies, and consistency checks. Multi-agent systems can generate scene assets in parallel, then use checker agents to verify connectivity, naming conventions, collision boundaries, and performance budgets. Without a shared coordinate system and asset naming rules, parallel generation quickly becomes unmanageable. The orchestration system therefore needs to keep creative generation within engineering contracts.
4. Hardware-Software Co-Design: Constraints for Errors That Cannot Be Rolled Back
Software defects can usually be fixed by reverting a commit. Hardware design is less forgiving. A wrong trace or an overlooked thermal issue can make an entire device unusable. When multi-agent orchestration moves into hardware-software co-design, it must shift from text generation to constraint-driven work:
- In the requirements phase, generate testable specifications and a list of failure modes.
- In the design phase, connect rule checks, simulation, and manufacturability checks.
- In the verification phase, run hardware-in-the-loop tests and record key metrics such as electrical behavior, thermal performance, and electromagnetic compatibility.
- In the sign-off phase, human engineers confirm irreversible decisions.
In this setting, agents are better suited to generating design candidates, filling gaps in test cases, analyzing failures, and organizing documentation. They should not replace critical sign-off. The orchestration system must be able to call simulators, rule engines, and test benches, so that a design that “looks reasonable” becomes one that has been verified to pass.
5. Engineering Architecture: Coordinator, Execution, Review, Verification, and Integration
A practical multi-agent orchestration system usually follows a layered architecture. The goal layer defines business objectives and acceptance criteria. The planning layer generates the task graph. The execution layer schedules tasks in parallel based on dependencies. The verification layer runs tests and reviews. The integration layer merges outputs. The observability layer records data across the full workflow. For cost control, teams can use tiered routing. Simpler, deterministic tasks go to lightweight models or rule-based scripts, while complex architecture work and difficult logic go to models with strong reasoning. This approach keeps the cost of each task under control.
On the infrastructure side, teams can run isolated execution environments on a container platform in a general-purpose cloud provider such as Baidu AI Cloud. They can store build artifacts in object storage, decouple task scheduling with a message queue, and build observability with a log service and monitoring alerts. The key is not any single cloud capability. The key is bringing sandboxing, permissions, quotas, logs, metrics, and artifact management under one unified orchestration layer.
The following configuration illustrates the idea:
Task graph = {"goal": "Build a bootable prototype","acceptance": ["Build passes", "Boot self-check passes", "Core tests pass"],"nodes": [{"id": "architecture", "type": "planning", "model": "strong reasoning", "outputs": ["Architecture decision record", "Interface contracts"]},{"id": "kernel", "type": "execution", "depends_on": ["architecture"], "model": "strong reasoning", "outputs": ["Source code", "Unit tests"]},{"id": "drivers", "type": "execution", "depends_on": ["architecture"], "model": "strong reasoning", "outputs": ["Source code", "Simulation tests"]},{"id": "interface", "type": "execution", "depends_on": ["architecture"], "model": "lightweight", "outputs": ["UI code", "Interaction tests"]},{"id": "review", "type": "review", "depends_on": ["kernel", "drivers", "interface"], "model": "strong reasoning", "outputs": ["Review report"]},{"id": "integration", "type": "integration", "depends_on": ["review"], "model": "rules plus lightweight", "outputs": ["Build artifacts", "Acceptance report"]}]}
The scheduling logic can be expressed as the following pseudocode:
function schedule(task_graph):ready_queue = sort_by_dependencies(task_graph)while ready_queue is not empty:batch = take_parallelizable_nodes(ready_queue, resource_quota)parallel for node in batch:sandbox = create_isolated_environment(node.depends_on, node.permissions)result = run_agent(node.model, node.outputs, sandbox)record(logs, metrics, artifacts)if not passed(result.tests):add_to_rework_queue(node, failure_reason)merge_reviewed_artifacts(batch)return acceptance_report
6. Rollout Path and Metrics
Teams should start with non-production scenarios that can be rolled back and have clear acceptance criteria. First, define the goals and boundaries. Next, set up a local orchestration framework, then establish task contracts and interface specifications. Add review and test gates, and finally expand to cross-module and hardware-software co-design work. Metrics should not focus only on how fast a single generation runs. Teams should also track first-pass success rate, rework rate, test coverage, merge conflict rate, average delivery cycle, cost per task, and defect escape rate. Multi-agent orchestration delivers real engineering value only when the process is observable, the outputs are verifiable, and failures can be rolled back.
