Multi-Agent Orchestration in Practice: Building an Always-On Automated Development Pipeline
This article explains how to build an automated software development pipeline using a multi-agent architecture instead of a single conversational agent. It covers the limitations of single-agent execution for long delivery chains, a three-layer design with an orchestrator, functional directors, and execution units, a unified message bus format, context isolation and artifact persistence, a full walkthrough of one requirement from market research to archiving, quality gates with human checkpoints, observability and cost control, and a phased rollout strategy. Readers will learn how clear responsibility boundaries, artifact contracts, and rollback mechanisms make a continuously running development pipeline reliable and maintainable.
1. Why a Single Agent Cannot Handle Long Delivery Chains
In real software delivery, a requirement typically moves through market research, product definition, architecture design, implementation, testing, and delivery archiving before it goes live. When one person or a single conversational agent drives this process sequentially, problems appear quickly: the context keeps growing and dilutes critical information, instructions from earlier turns are forgotten, the task chain breaks midway, and when something goes wrong it is hard to tell which step introduced the deviation.
The value of a multi-agent architecture is that it splits this long chain into responsibility units with clear boundaries. Each unit has its own context and only cares about its own inputs and outputs. Units communicate through messages, forming a traceable task flow. This keeps the context size of each inference step under control and allows failures to be retried locally instead of rolling back the entire pipeline.
It is worth emphasizing that this kind of system does not just need a model that produces good single-turn answers. It needs three hard capabilities: stability across long tasks, information retention under very long contexts, and task-chain consistency across many interaction turns. Missing any one of them, the agent team will drift away from its goal after a few dozen turns.
2. Overall Architecture: Layered Responsibilities and a Message Bus
A three-layer structure is recommended to avoid the tangled topology that appears when all agents call each other as peers.
The first layer is the orchestrator agent, the single entry point. It handles requirement clarification, task decomposition, dispatch, and acceptance. It does not write code itself; it only orchestrates and decides.
The second layer is the functional director agents, covering roles such as market, product, architecture, development, and testing. Each director receives only the subtask issued by the orchestrator and produces a structured deliverable.
The third layer is the execution units, for example coding tool instances that handle specific implementation work, script runners that handle data collection, and renderers that handle document generation. The development director can invoke a local coding tool on its own, letting that tool decide file changes and command execution, which enables genuine continuous coding.
At the message level, a unified message bus is recommended, with all communication flowing in the form of “topic + payload + related task ID”. A sample structure looks like this:
{"task_id": "T-20260406-001","from": "orchestrator","to": "dev_director","topic": "task.assign","payload": {"goal": "Competitor price monitoring dashboard", "constraints": ["scheduled collection", "anomaly alerts", "table export"]},"trace": ["market_report#v1"]}
The related task ID is the foundation of later observability: any message can be traced back to the requirement it belongs to and the upstream artifact it came from.
3. Context Isolation and State Persistence
Independent contexts are not about simply cutting a conversation apart. Three constraints matter: minimal inputs, structured outputs, and externalized state.
Minimal inputs mean each agent receives only the information required for its own responsibility, rather than the entire history. Structured outputs mean deliverables must be in a verifiable format, such as a requirements document with a version number, a data model with field definitions, or a design note with interface signatures. Externalized state means all intermediate artifacts land in a shared artifact store while the agents themselves stay stateless and can restore their state from the store after a restart.
A simplified artifact commit routine can be written as:
def commit_artifact(task_id, stage, content, version):key = f"{task_id}/{stage}/v{version}"store.put(key, content) # Write to the artifact storebus.emit("artifact.commit", {"key": key, "stage": stage})return key
The benefit is that any stage can be compared across versions, and when quality regresses you can quickly locate the specific artifact instead of manually digging through chat history.
4. Execution Trace of a Complete Requirement
Suppose the orchestrator receives a requirement: build a competitor price monitoring dashboard that supports entering competitor links, periodically collects price, original price, discount, and stock status, provides trend charts and anomaly markers, pushes alerts through an office collaboration platform on low prices, sharp fluctuations, or out-of-stock events, and supports table export.
Step 1, market research. The orchestrator assigns the research subtask to the market director, which outputs a report covering competitor scope, field definitions, suggested collection frequency, and compliance boundaries. The report goes back to the orchestrator and is copied to the requester to keep progress visible.
Step 2, product design. The orchestrator first checks the research conclusions for conflicting definitions, then hands off to the product director, who produces the requirements specification with field definitions, the state machine, and alert threshold rules. Thresholds must be configurable to avoid hardcoding.
Step 3, architecture design. Based on the requirements specification, the architecture director defines the module breakdown, storage choices, and scheduling approach, and makes the dependency direction explicit among the collector, the rule engine, the notification adapter, and the export service.
Step 4, implementation. The development director breaks the work into parallel tasks, invokes the local coding tool autonomously to complete the code, and registers each change as an artifact version.
Step 5, testing. The testing director generates test cases from the requirements specification, covering normal collection, missing fields, interface timeouts, and duplicate alert suppression, and returns a defect list to the development director.
Step 6, delivery archiving. The orchestrator consolidates the artifacts, produces the delivery note, and keeps the complete chain of records for auditing.
5. Quality Gates and Human Fallback
Fully automated does not mean nobody is accountable. Three types of gates are recommended in the pipeline: a static gate that checks code conventions and dependency risks; a contract gate that verifies whether interfaces and data fields match the design; and an effectiveness gate that uses a small real sample to validate collection accuracy and alert hit rate. If any gate fails, the task is automatically returned to the responsible director with a summary of the failure context.
Human fallback points should also be kept. Three categories of actions require human confirmation before execution: external data compliance, production environment changes, and cost-sensitive operations. This controls risk and prevents the agent team from taking irreversible actions under ambiguous instructions.
6. Observability and Cost Control
Multiple agents bring significant call overhead, so observability and budget must be designed in advance. It is recommended to record the task ID, stage, input summary, output summary, latency, and failure reason for each call, forming a searchable execution log; to cache repeated tasks; and to use smaller models for low-risk stages, concentrating higher-capability models on architecture and complex coding. Tiered scheduling of this kind balances quality against cost.
7. Implementation Advice
At the start, do not aim for a full set of roles. First get a closed loop of three roles working: orchestrator, development, and testing, and run one minimal requirement end to end. Then gradually add the market, product, and architecture roles. Finally introduce gates and budget control. Baidu AI Cloud can provide a stable foundation for hosting and observability of such a continuously running agent cluster through general capabilities such as compute, containers, and log monitoring, but the focus of the architecture design should remain on responsibility boundaries, artifact contracts, and rollback mechanisms. When these three are solid enough, an always-on automated development pipeline has the ability to evolve sustainably.
