Multi-Agent Systems in Practice: Building an Automated 24/7 Development Pipeline

    This article explains how to move from a single AI agent to a multi-agent system for automated software delivery. It covers role design, context isolation, message and artifact separation, scheduling for around-the-clock execution, and a practical price-monitoring example, along with governance practices for observability, cost, quality gates, and permissions.

    1. From Single Tools to an Agent Army: Why Multi-Agent Systems

    Over the past year, LLM applications have shifted from simple question-and-answer assistants to agents that can plan autonomously, call tools, and run continuously. However, a single agent quickly hits a ceiling: limited context window, mixed role objectives, and long task chains that lose focus midway. A multi-agent architecture is the engineering answer to these pain points. It breaks a complex task into independently verifiable subtasks, assigns each to an agent with a specific role, and connects them into a complete pipeline through messages and shared artifacts.

    The scenario in the original article is representative: an orchestrator agent receives a request, then research, PRD, architecture, coding, and testing agents take over in sequence, ultimately delivering a runnable competitor price-monitoring application overnight. What is worth learning here is not any specific tool, but the system design and engineering constraints behind it.

    2. Role Design: Mapping Organizational Experience to Agent Topology

    The success of a multi-agent system depends largely on whether role boundaries are clear. Three principles are recommended:

    1. Single responsibility: One agent is responsible for only one deliverable. For example, the research agent only outputs competitor and requirement insights and does not write code.
    2. Capability matching: The research role needs web search and summarization; the coding role needs file read/write and command execution; the testing role needs execution and assertion capabilities. Grant permissions on a least-privilege basis.
    3. Verifiability: Each role’s output must be verifiable in a structured way, such as a document with fixed sections, a signed interface definition, or executable test cases.

    A practical role topology example:

    1. Orchestrator
    2. ├── Research agent -> outputs market_report.md
    3. ├── PRD agent -> outputs prd.md (with acceptance criteria)
    4. ├── Architect agent -> outputs design.md + api_spec.yaml
    5. ├── Dev agent -> outputs code repository + config
    6. ├── Test agent -> outputs test_report.md
    7. └── Delivery agent -> compiles release_note and sends notification

    3. Context Isolation and Message Bus: Keeping the Army from Cross-Contaminating

    The most common failure in multi-agent systems is context pollution: one role’s intermediate reasoning is treated as fact by another role, causing conclusion drift. Engineering practice usually does two things.

    First, isolated context. Each agent maintains its own session history and tool-call records and exchanges information only through messages and artifacts. The orchestrator does not forward raw conversations downstream; instead, it passes a structured task card:

    1. {
    2. "task_id": "T-102",
    3. "role": "architect",
    4. "goal": "Design the price collection and alerting module",
    5. "inputs": ["prd.md#Chapter3", "market_report.md#competitor_list"],
    6. "constraints": ["concurrency no more than 5", "retry 3 times on failure"],
    7. "acceptance": ["api_spec.yaml passes validation", "includes sequence diagram"]
    8. }

    Second, separate messages from artifacts. Messages carry only “what to do and what the constraints are.” Larger documents, data tables, and code are stored in a shared workspace (a local directory or object storage), with only paths and version numbers in the message. This avoids context bloat and makes every step traceable and rollback-friendly.

    4. Orchestration and Scheduling: Running the Army 24/7

    Around-the-clock operation requires two types of scheduling layered together:

    • Event-driven: The orchestrator triggers the next step when it receives a request or a downstream completion event.
    • Time-driven: Scheduled jobs handle periodic collection, inspection, and report generation.

    Pseudocode for the main loop:

    1. while True:
    2. task = queue.pop() or scheduler.next_due()
    3. if task is None:
    4. sleep(5); continue
    5. result = worker[task.role].run(task) # run in isolated context
    6. workspace.commit(result.artifacts) # store artifacts with versioning
    7. bus.publish("task.done", task.id) # broadcast completion event
    8. if result.failed and result.retry < 3:
    9. queue.push(task.retry())

    Key engineering details to emphasize: all long-running tasks must be idempotent and re-entrant on failure; artifact writes should use “temporary directory + atomic rename”; and each run should keep logs and snapshots for review.

    5. Practical Case: Implementing a Competitor Price Monitoring System

    Using the e-commerce competitor price monitoring example from the original article, it can be split into four pipelines:

    1. Collection layer: Periodically scrape price, original price, discounts, and stock status against a target list; use rate limiting and randomized backoff, and respect the target sites’ terms and robots conventions.
    2. Storage layer: Write raw responses to object storage for archival, and structured metrics to a time-series or relational database, with the primary key being “product + time.”
    3. Analysis layer: Compute moving averages, period-over-period changes, and volatility; flag abnormally low prices, sharp fluctuations, and out-of-stock items; keep thresholds configurable to avoid hardcoding.
    4. Notification and export: When a rule is hit, send an alert via message push and support spreadsheet file export for manual review.

    Corresponding rule configuration example:

    1. rules:
    2. - name: price_drop
    3. metric: price_ratio_vs_avg7d
    4. op: "<"
    5. threshold: 0.85
    6. notify: [im_group]
    7. - name: out_of_stock
    8. metric: stock_status
    9. op: "=="
    10. threshold: 0

    6. Stability, Cost, and Governance

    After scaling into an agent army, governance becomes significantly harder. At least five areas should be covered:

    • Observability: Use a unified trace_id across the orchestrator and sub-agents, recording each step’s latency, tokens, and tool calls.
    • Cost control: Set budget caps for different roles, and compress long documents before passing them along.
    • Quality gates: Block delivery if tests fail; no “shipping while broken.”
    • Permission boundaries: Separate coding and execution permissions; high-risk commands require human confirmation.
    • Human fallback: Provide a takeover switch that automatically escalates to a human when anomalies occur repeatedly.

    7. Conclusion

    The value of a multi-agent army is not “no humans,” but solidifying a standardizable collaboration process so that machines handle repetitive work while people focus on goals and judgment. To further lower the barrier to setup and operations, you can use general capabilities such as container platforms, message queues, object storage, and monitoring and alerting from Baidu AI Cloud for deployment and hosting, leaving your energy for role design and acceptance criteria—the parts that truly determine success.