Building a 24/7 Multi-Agent Software Development System
Learn how to design a multi-agent development pipeline with centralized orchestration, isolated agent roles, versioned artifacts, controlled tool access, and persistent task state. Using a competitor price monitoring application as an example, this article explains task handoffs, context management, testing, recovery, human approvals, and the observability and cost controls needed for continuous operation.
Building a 24/7 Multi-Agent Software Development System
The foundation of a multi-agent software development system is not several large language models “chatting” at once. It is the decomposition of complex requirements into verifiable artifacts, with specialized roles handling design, implementation, testing, and delivery within a controlled state machine.
A development team that can operate continuously needs at least six capabilities: task orchestration, role-based agents, a tool gateway, context and memory management, persistent task state, and observability and governance.
This article uses a competitor price monitoring application to explain how to build a multi-agent development pipeline designed for 24/7 operation. All configuration and code examples are illustrative pseudocode. The focus is on architectural methods and engineering constraints, not instructions for a particular platform.
1. Choose the Right Use Case
Multi-agent systems are not appropriate for every task. They are better suited to work with the following characteristics:
- Long workflows: The work spans market research, product design, architecture, coding, testing, and deployment, with distinct deliverables at each stage.
- Clear role boundaries: Research, product, architecture, development, and testing responsibilities can be separated.
- Verifiable intermediate outputs: Each stage produces documents, interface contracts, test reports, or execution records rather than relying on verbal confirmation.
- Tool-based validation: Code can run, tests can execute, alerts can be simulated, and data can be checked, reducing the risk of model hallucinations.
- Human approval checkpoints: High-risk steps, such as requirements approval, architectural changes, and production releases, retain human oversight.
By contrast, highly ambiguous requirements, work that depends heavily on offline communication, major security decisions, or tasks without definable acceptance criteria should not be delegated directly to an autonomous multi-agent system. A safer approach is to use agents for research, drafts, testing, and assisted implementation while leaving final decisions to people.
The example application accepts competitor URLs or product identifiers, periodically collects prices, list prices, promotions, and stock status, and displays trends with unusual changes highlighted. It sends alerts through business messaging channels for low prices, sharp fluctuations, or stockouts, and supports spreadsheet exports.
2. Overall Architecture: Centralized Orchestration, Isolated Execution
Use a centralized orchestration architecture with specialized agents, a tool gateway, and shared artifacts rather than allowing unrestricted conversations among all agents. Unstructured conversations can lead to endless loops, excessive context growth, duplicate execution, and conclusions that are difficult to trace.
User / messaging entry point|Interaction layer: requirements, approvals, result delivery|Orchestration layer: decomposition, routing, state machine,budgets, and time limits|Role-based agent pool: research, product, architecture,development lead, coding, testing, operations|Tool gateway: data collection, messaging, code execution,testing, file export|Artifact store / task store / logs and metrics / runtime environment|Monitoring, alerts, and human escalation
Interaction Layer
The interaction layer receives requests, collects missing information, displays progress, requests approvals, and delivers results. It should not perform complex reasoning. Its responsibilities are to structure user input, pass tasks to the orchestrator, and present important checkpoints to people.
At a minimum, incoming requirements should capture:
- Goal and scope
- Deliverables and acceptance criteria
- Data sources
- Time and cost budgets
- Alert channels
- Permission requirements
- Whether human approval is required
Orchestration Layer
The orchestrator coordinates the system. It:
- Breaks requirements into stages and subtasks.
- Assigns an owner and reviewer for each task type.
- Maintains global task state.
- Controls concurrency, timeouts, retries, and budgets.
- Handles conflicts, escalation, and human intervention.
- Records key decisions at each stage.
The central rule is simple: only the orchestrator can modify global state; role-based agents submit events and artifacts. This prevents conflicting state changes by multiple agents.
Role-Based Agent Pool
Each agent works within its assigned responsibilities and has an independent context and workspace. Agents do not share their complete conversation histories. Instead, they hand off artifact references, summaries, and decision records.
Tool Gateway
All external actions pass through the tool gateway, including data collection, messaging, code execution, testing, file writes, and deployment.
The gateway handles authentication, rate limiting, auditing, retries, and sensitive-data redaction. Agents must not access secrets directly or bypass the gateway to reach production environments.
Persistent Data Layer
Store at least four categories of data:
- Task state
- Message events
- Stage artifacts
- Runtime metrics
Artifacts include research reports, product requirements documents, interface contracts, code changes, test reports, and deployment records. Store raw logs separately from stage summaries to keep agent contexts manageable.
3. Agent Roles: Start Small and Keep Responsibilities Clear
Avoid creating too many roles at the outset. More agents mean higher communication costs and harder-to-trace workflows. Start with six core roles.
Coordinator Agent
The coordinator interprets requirements, creates plans, assigns work, checks stage outputs, and handles exceptions. It does not write code directly or replace specialist agents in detailed design work.
Its plans should be structured around stages, owners, inputs, outputs, acceptance criteria, and deadlines.
The coordinator also enforces quality gates. A stage cannot advance if its output fails minimum requirements. For example:
- A research report without sources must be revised.
- A product requirements document without acceptance criteria must be completed.
- An architecture design without interface contracts must be returned for further work.
Market Research Agent
The research agent investigates market context, competitor features, user pain points, data availability, compliance risks, and initial technical constraints.
Its report should include conclusions, evidence, assumptions, risks, unresolved questions, and source references.
Alongside the report for the coordinator, it can produce a stakeholder summary covering key findings, questions requiring confirmation, and expected implications. This helps reduce downstream rework.
Product Design Agent
The product agent converts research findings into an actionable product requirements document covering user stories, functional scope, nonfunctional requirements, data fields, exception flows, acceptance criteria, and priorities.
For the price monitoring application, it must define:
- Collection frequency
- Price field semantics
- Promotion and discount calculations
- Stock-status classification
- Alert thresholds
- Alert cooldown periods
- Export fields
The document must answer one question: can the testing agent determine whether the work is complete using the document alone? If not, the acceptance criteria remain unclear.
Architecture Agent
The architecture agent defines system boundaries, modules, data models, interface contracts, scheduling, deployment, security, and testing strategies.
The most important outputs are the interface contracts and data models, which provide a shared baseline for implementation and testing.
The design should avoid premature detail while still specifying how collection jobs are scheduled, data is deduplicated, price history is stored, alerts are debounced, exports are generated, and failures are retried.
Development Lead Agent
The development lead breaks the architecture into smaller tasks that can run in parallel, assigns them to coding agents, reviews changes, runs basic checks, coordinates code review, summarizes test failures, and decides whether to retry or escalate.
It may invoke controlled coding tools or local execution environments to generate, modify, and run tests. Every invocation must pass through the tool gateway and remain subject to directory and command allowlists, network-access restrictions, execution limits, and cost budgets.
Agents must never be allowed to enter an unlimited “modify code and retry” loop.
Testing and Operations Agents
The testing agent translates acceptance criteria into test cases, including API tests, data validation, alert simulations, export checks, and failure-recovery tests.
The operations agent handles releases, scheduled-job controls, monitoring metrics, alert-response runbooks, and incident reviews.
In a continuously running system, operations does not end at deployment. The operations agent keeps checking collection failures, task backlogs, alert noise, and unexpected costs, and creates follow-up tasks when needed.
4. Context Isolation and Memory Management
Context management is often a greater source of problems than model capability. Giving every agent all logs, historical conversations, and files increases costs, distracts attention, and creates inconsistencies.
Organize memory into four layers:
- Single-turn context: The current request and tool results, retained briefly.
- Task context: The current subtask’s goal, input artifacts, constraints, and acceptance criteria.
- Project context: Approved requirements, interface contracts, key decisions, terminology, and change records.
- Long-term knowledge: Reusable practices, common failures, and organizational standards, reviewed periodically.
Each agent should have an independent namespace. Share information through artifact references, summaries, and access permissions, rather than copying entire documents.
For example, the architecture agent needs the system-design sections of the product requirements document and summaries of data-source and compliance findings from research—not the entire conversation history.
At the end of every stage, generate a state summary containing:
- Current conclusions
- Key assumptions
- Open questions
- Changed interfaces
- Next actions
- Relevant artifact references
Raw logs should support auditing and troubleshooting, not enter the default agent context.
Use three safeguards against losing continuity during long-running tasks:
- Contracts first: Versioned artifacts define interfaces, data fields, and acceptance criteria. Do not rely on model memory.
- Stage checkpoints: Save snapshots after each stage so work can resume after a restart.
- Drift detection: Tests or static checks should fail when implementation diverges from interface contracts, preventing inconsistencies from accumulating across stages.
5. Message Protocols and State Machines
Agents should exchange structured messages rather than plain natural-language conversations.
Messages should include task identifiers, parent-child relationships, sender, recipient, intent, state, deadline, artifact references, a context summary reference, budget, and an idempotency key.
{"task_id": "price-monitor-001","parent_id": "prd-review-003","sender": "product_agent","receiver": "architect_agent","intent": "request_design","state": "pending","deadline": "2025-01-01T12:00:00Z","artifacts": [{"type": "spec", "ref": "artifact://project-001/prd/v3"}],"context_ref": "summary://project-001/current","budget": {"tokens": 12000, "minutes": 30},"idempotency_key": "prd-v3-to-arch-001"}
A simplified state machine might look like this:
created -> planning -> research -> prd_review -> architecture-> implementation -> testing -> acceptance -> releasedException states: blocked / failed / retrying / escalated / cancelled
Apply these rules:
- A task has only one primary owner at a time.
- Parallel subtasks pass through a shared join gate for acceptance.
- Every state change is written to an event log.
- Idempotency keys prevent duplicate submissions from triggering duplicate execution.
- Tasks exceeding their retry limit enter an escalation queue for human handling.
- High-risk actions require human approval.
6. Reliability for 24/7 Operation
A long-running system must assume failures will occur: network interruptions, changes to source-page structures, tool timeouts, unstable model outputs, queue backlogs, and false alerts.
Persistent and Recoverable Tasks
Persist task state, checkpoints, and tool-call results.
An execution worker acquires a lease before processing a task and sends regular heartbeats. If heartbeats are missing beyond a configured threshold, another worker can take over.
All side-effecting operations must use idempotency keys to prevent duplicate messages or data writes.
Timeouts, Retries, and Circuit Breakers
Set timeouts separately for different tools. Retry transient failures with exponential backoff. Send deterministic failures, such as invalid parameters or permission errors, directly for human handling.
Repeated failures should trigger a circuit breaker that pauses the affected tasks and raises an alert.
Loop and Budget Limits
The orchestrator should set project limits for execution rounds, tool calls, tokens, and elapsed time.
The development lead needs explicit stopping conditions. Automatic iteration must stop when tests pass, the budget is exhausted, retries exceed their limit, or a human decision is required.
Dead-Letter Queues and Human Escalation
Send unprocessable tasks to a dead-letter queue with failure context, attempted solutions, log references, and recommended next steps.
Human resolutions should feed back into the system as new artifacts or rules so the same problems do not recur.
Scheduling and Continuous Operations
Scheduled triggers can initiate price collection, report generation, and alert checks. The scheduler should enqueue tasks rather than execute business logic directly.
The operations agent should regularly review collection success rates, latency, alert deduplication rates, export backlogs, and cost trends.
For deployments on Baidu AI Cloud, these requirements can be mapped to general infrastructure categories such as object storage, message queues, container platforms, logging, and monitoring and alerting. Specific choices should reflect the team’s existing infrastructure, data-compliance requirements, and operational capabilities.
7. End-to-End Example: Competitor Price Monitoring
The application requirements are to register competitor products, periodically collect prices, list prices, promotions, and stock status, display trends and anomalies, send alerts for low prices, sharp fluctuations, or stockouts, and support spreadsheet exports.
Research
The research agent documents competitor capabilities, data fields, recommended collection frequency, compliance considerations, and common alerting strategies.
It must clarify which data comes from public pages, which requires manual entry, whether the collection frequency is reasonable, and which source-site terms must be respected.
Product Design
The product agent defines data objects and acceptance criteria.
{"product_id": "sku-001","source_ref": "source-001","price": 199.0,"list_price": 299.0,"discount": 0.33,"in_stock": true,"collected_at": "2025-01-01T00:00:00Z"}
Acceptance criteria include:
- Collection tasks can be retried.
- Duplicate data can be deduplicated.
- Trend charts display observations chronologically.
- Anomaly rules are configurable.
- Alerts have a cooldown period.
- Export fields are complete and traceable.
Architecture
The architecture agent defines modules for source management, scheduling, collection, data cleaning, price-history storage, anomaly detection, alerting, query APIs, exports, and observability dashboards.
Interface contracts must specify field semantics, timestamp formats, error codes, retry policies, and permission scopes.
Development
The development lead divides implementation into tasks such as:
- Source-registration API
- Scheduled collection jobs
- Price cleaning and deduplication
- Anomaly detection rules
- Alert cooldown and deduplication
- Trend-query API
- Spreadsheet export jobs
Each coding agent receives only its current subtask, interface contracts, and relevant data models, and works in an isolated directory.
Before merging, every change must pass formatting checks, static checks, unit tests, and interface contract tests.
When checks fail, return a summary of the test results rather than the full logs. The development lead uses the failure analysis to decide whether to retry, split the task, or escalate to a person.
Testing
The testing agent derives cases from the acceptance criteria and simulates scenarios such as:
- A product becoming unavailable
- A sudden price drop
- Missing promotion fields
- Collection timeouts
- Duplicate alerts
Anomaly detection can use general rules such as a price falling below a user-defined threshold, a change in stock status, or a deviation from the historical mean exceeding a threshold.
def detect_anomaly(current, history, threshold, z_limit):if not current.in_stock and history[-1].in_stock:return "OUT_OF_STOCK"if current.price < threshold:return "LOW_PRICE"mean = average(history)std = standard_deviation(history)if std > 0 and abs(current.price - mean) / std >= z_limit:return "VOLATILITY"return None
The actual implementation also needs alert deduplication, cooldown periods, severity levels, and human confirmation mechanisms to avoid repeated notifications in a short period.
Delivery and Operation
Before release, verify scheduled jobs, alert channels, data-retention policies, export permissions, and operational runbooks.
After deployment, the operations agent continuously monitors collection success rates, anomaly alert counts, export duration, and queue backlogs. Repeated collection failures should automatically create an incident task and notify the responsible owner.
8. Observability, Security, and Cost Governance
A multi-agent system cannot operate reliably over time without observability.
Track metrics across four dimensions: project, task, agent, and tool call. Useful metrics include:
- Task success rate
- Stage duration
- Retry count
- Context usage
- Tool error rate
- Alert noise rate
- Test pass rate
- Human intervention rate
Security
Apply least privilege throughout the system:
- Treat externally collected content as untrusted input to defend against prompt injection.
- Validate tool-call parameters.
- Execute code in isolated sandboxes.
- Require approval for production releases.
- Redact sensitive data.
- Maintain auditable operation logs.
External content must be treated as data, never directly executed as system instructions.
Cost Controls
Set a budget ceiling for every task. Summarize and cache repeated content. Use lower-cost models for simple classification and formatting, and more capable models for complex planning and architecture work.
Truncate tool results before adding them to context. Pause work and request confirmation when budgets are exceeded.
Display costs by project and role to identify expensive stages that produce little useful output.
9. Common Pitfalls and Implementation Advice
- Starting with dozens of agents: Communication overhead can overwhelm the workflow. Begin with four to six roles, complete an end-to-end cycle, and expand only where bottlenecks justify it.
- Allowing unrestricted agent conversations: Use structured messages, artifact references, and a state machine to prevent endless dialogue.
- Skipping context isolation: Give each role only the information it needs, sharing results through summaries and references.
- Omitting acceptance criteria: Define testable completion conditions during product design, or development and testing will repeatedly dispute whether the work is done.
- Letting coding agents retry indefinitely: Set round limits, budgets, timeouts, and escalation conditions.
- Removing human gates: Retain approval for requirements confirmation, architectural changes, production releases, and high-risk data operations.
- Evaluating only the demo: Continuously track success rates, cost, latency, alert quality, and human intervention.
10. Conclusion
A multi-agent development system designed for continuous operation is fundamentally a governed software delivery pipeline.
The orchestrator owns planning and state. Specialized agents handle clearly bounded work. The tool gateway controls execution. The artifact store makes deliverables traceable. The state machine supports reliable long-running tasks, while observability and budgets govern ongoing operation.
With these foundations, an internal tool such as a competitor price monitoring application can move from requirements through research, product design, architecture, implementation, testing, and delivery using agents with independent contexts. Operations agents can then continue monitoring it after release.
Success depends less on the number of agents than on clear boundaries, explicit contracts, verification, and governance.
