Building a 24/7 Multi-Agent Software Development and Delivery System from Scratch

    A reliable multi-agent development system requires more than assigning roles to separate chat sessions. This article explains how to design task orchestration, persistent state, controlled execution, independent validation, and human oversight, using an e-commerce competitor price monitoring application as a practical example. It also covers recovery, budgets, observability, and a phased implementation plan for continuous operation.

    1. Define the Goal: Build a Collaboration System, Not More Chat Windows

    Giving an AI agent a requirement and asking it to research, write code, and deliver a result is a development approach worth exploring. Moving from a one-off demonstration to continuous operation, however, requires more than a model that can generate code. The entire task chain must remain consistent, errors must be detected promptly, and execution must stay under control.

    Opening separate chat sessions labeled “product manager,” “architect,” “developer,” and “tester” does not automatically create a reliable team. These roles may interpret requirements differently, modify the same files, or confirm one another’s work without evidence.

    Multi-agent collaboration should instead be treated as an engineering organization model:

    • Use role specialization to narrow each agent’s responsibilities.
    • Define inputs, outputs, and acceptance criteria through structured tasks.
    • Persist state so long-running tasks can recover.
    • Restrict the impact of automated actions through tool permissions.
    • Control delivery risk through independent testing and human approval.

    Operating around the clock does not mean that models must reason continuously or that the system has unlimited autonomy. It means that task intake, scheduling, execution environments, and monitoring remain available, allowing the system to process scheduled work and pause, retry, or request human intervention when needed.

    2. Define a Complete Deliverable: Competitor Price Monitoring

    To make the design concrete, consider an application with relatively clear boundaries: an e-commerce competitor price monitoring system.

    The system accepts a set of product monitoring targets, periodically retrieves prices, promotion details, and stock status, stores historical records, displays price trends, and notifies relevant users when alert conditions are met.

    Data sources must be lawful, authorized, and compliant with applicable rules. Prefer authorized APIs, files supplied by the business, or sources that permit access. Do not bypass access controls or assume that technically accessible data is unrestricted for use.

    Turn Business Goals into Testable Requirements

    “Monitor prices and send timely alerts” is too broad to support development acceptance. Break it into explicit requirements:

    • Records for the same product across different sources can be linked.
    • Every price includes its currency, collection timestamp, and source.
    • Original prices, current prices, and promotion conditions are stored separately.
    • Uncertain stock status is recorded as unknown, not assumed to mean out of stock.
    • Trend charts distinguish valid prices from collection failures.
    • Low prices, significant price changes, and stock changes use separate alert rules.
    • Alerts support deduplication, cooldown periods, and retries after delivery failures.
    • Historical data can be exported to a common spreadsheet format.
    • Administrators can pause collection tasks and inspect execution logs.

    Set Boundaries for the First Release

    The initial release should not attempt to cover complex promotion calculations, regional tax conversions, automated purchasing, and dynamic repricing at once. These features expand the scope and introduce greater business risk.

    Start with a complete loop covering collection, storage, visualization, and alerts. Add more advanced pricing analysis only after the basic workflow is stable.

    Agree on Price Semantics

    The most common mistakes in price monitoring are often not runtime failures but inconsistent interpretations of the data.

    For example, a displayed promotional price may require buying a specified quantity, applying a coupon, or holding a membership. It should not be compared directly with an unconditional selling price.

    Record the following separately:

    • Displayed price
    • Verifiable unconditional price
    • Conditional promotion details
    • Whether the price is comparable
    • Data quality status

    When promotion conditions cannot be parsed reliably, preserve the original description and mark the record as requiring confirmation. This is more reliable than producing an apparently precise final price.

    3. Architecture: Let Models Make Judgments and Systems Enforce Constraints

    A continuously operating development system can be organized into six layers:

    1. Requirement intake
    2. ↓
    3. Task orchestration and state management
    4. ↓
    5. Role-based agents and message coordination
    6. ↓
    7. Controlled tool execution
    8. ↓
    9. Artifact storage and quality acceptance
    10. ↓
    11. Operational monitoring and human approval

    Requirement Intake

    Requirements may arrive through an internal messaging channel, an administration page, or a task form. Regardless of the interface, convert each request into a standardized task record rather than forwarding the user’s message directly to every agent.

    At minimum, the intake layer should verify identity, confirm project scope, detect duplicate submissions, and flag sensitive operations.

    Orchestration and State Management

    The orchestrator determines which role acts next, whether dependencies are satisfied, whether a task has timed out, and how failures should be handled.

    Models can propose task breakdowns, but task state should not exist only in conversation text. Store state in a database and distribute pending work through a message queue.

    If an execution process exits unexpectedly, persistent records then allow the system to identify completed tasks and work that needs recovery.

    Role-Based Agents

    Agents perform specific activities such as requirement clarification, design, implementation, and test analysis.

    Each role should have its own working context while sharing confirmed project facts, including requirement versions, interface contracts, data structures, and acceptance criteria.

    Separate contexts do not mean complete isolation. Working processes should be isolated, while important conclusions are shared through controlled artifacts.

    Tool Execution

    Code editing, command execution, test runs, and file access should all pass through controlled tools.

    The tool layer must record the actor, a summary of parameters, execution results, and resource consumption. It must also restrict operations according to the role. A model’s proposed action does not oblige the system to execute it.

    Artifacts and Acceptance

    Requirements, design documents, code changes, test reports, and deployment instructions should be stored as formal artifacts.

    A task is complete when it passes acceptance checks—not when an agent says it is finished.

    Operational Monitoring

    The system needs continuous visibility into task backlogs, execution failures, collection delays, alert delivery, and resource usage.

    Automation without monitoring often turns visible manual work into invisible background activity.

    4. Divide Agent Responsibilities

    More roles do not necessarily produce better results. Start with coordination, development, and validation, then split responsibilities as task complexity grows.

    For the price monitoring project, the following division is suitable:

    Role Primary responsibilities Main deliverables
    Coordinator Clarify requests, split tasks, manage dependencies, and escalate issues Task plan and status summary
    Requirements analyst Define business semantics, scope, and acceptance criteria Requirements specification and acceptance checklist
    Architect Design modules, data structures, and recovery mechanisms Architecture document and interface contracts
    Developer Implement modules, add self-tests, and submit changes Code and change notes
    Tester Independently verify normal and failure paths Test results and defect records
    Operations Check deployment, monitoring, backups, and rollback readiness Runbook and release checklist

    The coordinator should not become a substitute for every other role. It acts as a workflow manager, identifies blockers, evaluates dependencies, and submits high-risk matters for human approval.

    Developers should not independently declare their work to have passed testing. Their output needs an independent validation process to reduce the risk of an author testing an implementation against the same mistaken assumptions used to build it.

    5. Make Structured Tasks the Foundation of Collaboration

    Natural language is useful for expressing intent, but it should not carry workflow control on its own. Tasks need both a natural-language description and structured fields.

    The following illustrative definition does not correspond to any specific product interface:

    1. Task ID: task-017
    2. Project ID: price-watch
    3. Assigned role: Developer
    4. Goal: Implement the price-change detection module
    5. Inputs:
    6. - Confirmed data field specification
    7. - Alert rule version
    8. - Edge-case checklist
    9. Dependencies:
    10. - Requirements accepted
    11. - Data structure confirmed
    12. Outputs:
    13. - Module implementation
    14. - Automated tests
    15. - Change notes
    16. Acceptance criteria:
    17. - Do not calculate a change rate without a valid baseline price
    18. - Reprocessing the same collection event does not create duplicate alerts
    19. - Do not directly compare records with different currencies
    20. Restrictions:
    21. - Do not modify production configuration
    22. - Do not read unrelated directories
    23. - Do not access unauthorized network addresses

    Use an Explicit State Machine

    A task can move through these states:

    1. Pending → Claimed → Running → Awaiting acceptance → Completed
    2. ↓ ↓
    3. Blocked ← Rework required

    Every transition needs explicit conditions. For example, a task entering “Awaiting acceptance” must include artifact locations and verification records. A task entering “Completed” must satisfy its acceptance criteria.

    Control Parallelism with a Dependency Graph

    Requirements analysis and data-source assessment can run in parallel, but interface implementation usually needs to wait until data structures are confirmed.

    Starting every role at once may appear faster initially, yet inconsistent assumptions can create substantial rework later.

    The prerequisite for parallel execution is stable task input—not simply an available agent.

    Bound Collaboration Loops

    Agent discussions can become endless cycles. Set maximum rework counts, task deadlines, and conditions for human escalation.

    If the same issue repeatedly fails to converge, pause the task and summarize the disagreement instead of allowing agents to keep exchanging messages.

    6. Design Context and Project Memory for Long-Running Tasks

    Long context windows are useful, but they do not replace persistent memory. As tasks continue, conversation histories tend to accumulate outdated information, temporary assumptions, and unconfirmed conclusions.

    Organize information into three layers.

    Working Context

    Include only what the current task needs: relevant requirements, file summaries, recent errors, and unresolved questions.

    Do not send the entire project history to every role by default.

    Project Fact Store

    Store confirmed information such as:

    • Current requirement version
    • Data field definitions
    • Module interface contracts
    • Approved technical decisions
    • Known limitations
    • Unresolved risks

    Project facts need versions and update timestamps. When requirements change, tasks depending on older versions must be reviewed.

    Artifact Index

    Record the locations, versions, and summaries of documents, code changes, and test reports.

    When an agent resumes work, it should first read the task state and associated artifacts, then retrieve additional context as needed. Recovery should not require replaying every conversation.

    Summaries can also omit details. Critical business constraints belong in structured records, not only in automatically generated summaries.

    7. Keep Autonomous Coding Within Safe Boundaries

    Developer agents can use coding tools as needed, but their execution environments must provide isolation and least-privilege access.

    Give Each Task an Independent Workspace

    Multiple developers modifying the same directory can overwrite changes, create conflicts, and invalidate test results.

    A safer approach is to create an independent working copy for each task, submit changes when the work is ready, and merge them after review. Before merging, check whether the base version has changed and rerun affected tests.

    Limit Resources and Execution

    Set limits on individual execution duration, total task duration, CPU and memory use, disk writes, and network access.

    A timeout should not simply discard the task as failed. Preserve completed artifacts and error logs to support recovery.

    Apply Risk-Based Authorization

    Operations can be grouped by risk:

    • Low risk: Read permitted files or run local tests.
    • Medium risk: Modify project code or install approved dependencies.
    • High risk: Change production configuration, run data migrations, or open network ports.
    • Critical risk: Delete production data, change access credentials, or perform financial operations.

    High-risk actions require human confirmation. Credentials should be injected by the execution layer when needed, keeping them out of prompts, shared documents, and ordinary logs.

    Guard Against Instructions in External Content

    Product pages, research materials, and logs may contain text such as “ignore previous instructions.” Treat this content as data, not as authority to change permissions or execute commands.

    In particular, avoid directly executing commands extracted from pages, documents, or error messages.

    8. Implement the Core Price Monitoring Workflow

    Data Collection and Normalization

    Each collected record should include at least a product identifier, source identifier, collection timestamp, price, currency, stock status, and data quality status.

    Store monetary values using an exact decimal type or the currency’s smallest unit. Ordinary binary floating-point calculations can introduce precision errors.

    Collection failure, missing price, and out-of-stock status are different events and must be recorded separately. Otherwise, a collection error may be misinterpreted as a zero price or exhausted inventory.

    Product Matching

    Identical names do not guarantee identical products. Differences in specifications, package quantities, capacities, or versions can invalidate comparisons.

    Prefer stable product identifiers from authorized data. If text matching is the only option, retain a matching confidence score and require human confirmation for low-confidence results.

    Price-Change Detection

    Let the current valid price be P and the baseline price be B, where B > 0:

    1. Price change rate = (P - B) / B

    The baseline may be the previous valid record or a statistical value from a defined time window. Choose it according to the business objective and record that choice in the rule version.

    To reduce false alerts, rules can require both a percentage change and an absolute price change to meet configured conditions. Thresholds should reflect product categories, historical volatility, and business tolerance rather than being copied from examples.

    Idempotency and Alert Deduplication

    Queues and network requests may deliver events more than once. Do not assume exactly-once processing.

    Construct a unique event identifier from the task, product, collection batch, and rule version, and enforce uniqueness in storage.

    An illustrative alert workflow is:

    1. Read the collection event
    2. Validate price, currency, and data quality
    3. Load the applicable rule and valid baseline
    4. Determine whether an alert should be triggered
    5. If no alert is triggered:
    6. Mark the event as processed
    7. If an alert is triggered:
    8. Atomically store the deduplication record and pending alert
    9. Let a delivery task send the notification
    10. Save the delivery result

    Keep business evaluation and message delivery sufficiently decoupled. A temporary notification outage should not cause a confirmed alert event to be lost.

    Retries and Degraded Operation

    Temporary timeouts may justify retries. Authentication failures and insufficient permissions usually require human intervention.

    Set a retry limit and use increasing delays with random jitter to prevent many tasks from retrying against a source simultaneously.

    For persistently failing sources, temporarily stop collection and indicate stale data rather than retrying indefinitely.

    9. Validate Results, Not Descriptions

    Testing should operate at multiple levels.

    Unit Testing

    Verify price parsing, time handling, change calculations, stock-status mapping, and deduplication rules.

    Include null values, invalid amounts, zero baselines, currency mismatches, and duplicate events.

    Integration Testing

    Check data transfer between collection, storage, rule evaluation, and notification modules.

    Pay particular attention to partial failures, such as a process exiting after data has been stored but before a notification has been sent.

    End-to-End Testing

    Starting from a submitted monitoring target, verify that the system creates collection tasks, stores records, displays trends, and triggers the correct alerts.

    Use fixed test data where appropriate so that changes in external pages are not mistaken for system defects.

    Recovery Testing

    Deliberately simulate execution interruptions, task timeouts, notification failures, and unavailable data sources. Confirm that the system either recovers or stops explicitly.

    Test reports must reference the code version, test environment, and actual output. A statement that “tests passed” without execution records is not sufficient evidence for delivery.

    10. Engineer for Continuous Operation

    Task Leases and Heartbeats

    When a worker claims a task, it can receive a time-limited execution lease and renew it through periodic heartbeats.

    After the lease expires, the scheduler can reassign the task. However, the system must prevent the old worker from continuing to submit results. Task-version checks or execution-token validation can reject stale submissions.

    Checkpoints and Recovery

    Long-running tasks should save checkpoints at important milestones, such as:

    • Requirements confirmed
    • Design completed
    • Code submitted
    • Tests passed

    Resume from the most recent valid checkpoint instead of repeating the entire workflow.

    Cost Budgets

    Continuous operation requires project-level and task-level budgets covering model calls, tool execution, storage, and network consumption.

    As spending approaches a limit, the system can pause lower-priority work, reduce unnecessary discussion, or request human confirmation. Budget enforcement belongs in the scheduler; it should not depend on a model remembering the limit.

    Observability

    Monitor:

    • Task completion and rework rates
    • Time spent at each stage
    • Number of blocked tasks
    • Collection success and data freshness
    • Alert backlogs and delivery failures
    • Resource consumption per task
    • Frequency and reasons for human intervention

    Use these metrics to identify bottlenecks. Do not compare role performance without accounting for task complexity.

    11. Implement in Phases

    Phase 1: Complete a Single-Task Workflow

    Use only coordinator, developer, and tester roles to deliver a small module. Focus on task state, artifact storage, and acceptance checks.

    Phase 2: Add Persistence and Recovery

    Persist tasks, messages, and artifact indexes. Simulate interruptions and verify that recovery neither duplicates submissions nor skips steps.

    Phase 3: Introduce Controlled Parallelism

    Run independent tasks concurrently. Add isolated workspaces, version checks, and merge controls.

    Phase 4: Deliver the Minimum Business Release

    Complete collection, trend visualization, and alerts for a small set of authorized monitoring targets. Validate business semantics before expanding coverage.

    Phase 5: Establish Continuous Operations

    Add budgets, heartbeats, failure alerts, human approvals, and rollback procedures. Observe the system for a period before increasing its level of automation.

    12. Delivery Checklist and Key Takeaways

    A deliverable multi-agent system should include at least:

    • Versioned requirements and acceptance criteria
    • Defined role responsibilities and permission boundaries
    • Traceable task states and dependencies
    • Recoverable context and artifact storage
    • A controlled code execution environment
    • Independent testing with actual execution records
    • Deployment, backup, rollback, and operating instructions
    • Failure handling, budget limits, and a human takeover interface

    Multi-agent collaboration can reduce repetitive work and automate more of task decomposition and execution. It does not replace engineering management, quality control, or security governance.

    A reliable 24/7 system is not one in which agents never stop working. It is one that executes against clear goals, proceeds when evidence is sufficient, stops when risk exceeds its boundaries, and makes every decision, change, and delivery inspectable and recoverable.