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

    Learn how to build a controlled, continuously operating multi-agent development workflow using a competitor price-monitoring application as a practical example. This guide covers agent responsibilities, task orchestration, shared context, isolated execution, data quality, testing, recovery, and security, with a phased roadmap for expanding automation without losing oversight.

    1. Define the Goal: Always-On Does Not Mean Unlimited Autonomy

    The value of a multi-agent development system is not that several models can answer questions at once. It is that requirements analysis, market research, architecture, development, testing, and delivery can be organized into a workflow that keeps moving forward.

    A typical entry point is an enterprise messaging channel. A user submits a request, a coordinating agent breaks it into tasks, and specialized agents carry out the work. Once the results have been verified, the system delivers working software and supporting documentation.

    However, “24/7 operation” needs a precise definition. It means the system can continuously receive events, execute scheduled tasks, and recover from failures. It does not mean models must generate content continuously, or that agents can make unrestricted changes to production environments.

    A practical system should meet four requirements:

    • Traceable tasks: Every task has an owner, status, inputs, and acceptance criteria.
    • Reproducible results: Code, configuration, tests, and build artifacts can be traced to the same execution.
    • Recoverable failures: Tasks are not silently lost after a process restart or a failed tool call.
    • Controlled risk: Permissions, budgets, execution limits, and human approval boundaries are explicit.

    Start by establishing a controlled, end-to-end workflow. Increase automation gradually rather than prioritizing large numbers of agents working in parallel.

    2. Example Project: Competitor Price Monitoring

    A concrete project makes the architecture easier to evaluate: continuously track competitor prices and notify business users when unusual changes occur.

    The basic requirements are to:

    1. Collect current prices, reference prices, promotion descriptions, and stock status on a schedule.
    2. Store historical snapshots and display price trends.
    3. Detect prices below a threshold, sharp short-term changes, and out-of-stock events.
    4. Send alerts through an enterprise messaging channel.
    5. Export data in a commonly supported spreadsheet format.
    6. Record collection failures, missing fields, and data anomalies.

    The most easily overlooked requirement is the definition of “price.” A listed price, promotional price, member price, and price after applying a coupon may differ. Comparing them indiscriminately produces false alerts.

    Requirements analysis should establish consistent price semantics, for example:

    • The current price is the publicly available selling price that does not require special eligibility.
    • Promotion details are stored separately and are not automatically deducted from the current price.
    • Different product variants are monitored separately.
    • Uncertain stock status is recorded as “unknown,” not treated as out of stock.
    • Collection timestamps and the promotion validity period displayed on the source page are stored separately.

    Data acquisition must also comply with the source’s authorization rules, access restrictions, and applicable laws. Prefer authorized data APIs or files. Bypassing access controls should not be the default technical approach.

    3. Overall Architecture: Models Make Judgments, Systems Enforce Order

    Organize the multi-agent system into six layers:

    1. Requirements intake
    2. ↓
    3. Coordination and task orchestration
    4. ↓
    5. Role-specific agents
    6. ↓
    7. Controlled tool execution
    8. ↓
    9. Persistent task state and artifact storage
    10. ↓
    11. Testing, monitoring, and human approval

    Requirements Intake

    The entry point accepts natural-language requests, but it should not forward raw text directly to a development agent for execution.

    First, convert the request into structured requirements covering business objectives, scope, deliverables, constraints, and unresolved questions. If the user has not specified sampling frequency, the number of monitored products, or notification recipients, ask for clarification or explicitly record provisional defaults for confirmation.

    Coordination and Task Orchestration

    The coordinating agent interprets requirements, proposes plans, and resolves issues across roles. Deterministic orchestration logic should manage dependencies, state transitions, timeouts, and retries.

    This distinction matters. A model may recommend delivery after tests pass, but the system must check actual test results and approval records before allowing delivery. A natural-language claim is not sufficient evidence.

    Role-Specific Agents

    Each agent has defined responsibilities, task context, and tool permissions. Context isolation reduces interference from unrelated information, but it needs an explicit sharing mechanism. Otherwise, agents may develop inconsistent assumptions.

    Tool Execution

    Code editing, test execution, data queries, and message delivery should run through controlled tools. This layer checks permissions, validates parameters, enforces timeouts, and records results. Safety must not depend entirely on the model.

    State and Artifact Storage

    Persist task state, design documents, code changes, test reports, and execution logs. Conversation history can provide background, but it is not a substitute for authoritative project state.

    Supervision

    The supervision layer checks for stalled tasks, excessive costs, tool failures, and conditions requiring human intervention.

    4. Agent Roles: Define Responsibilities Before Adding More Agents

    Start with five roles rather than a large agent fleet.

    Coordinating Agent

    This agent receives requests, breaks down work, manages dependencies, and consolidates deliverables.

    It should not have the highest execution privileges. Permission to assign tasks does not imply permission to read every credential, change production configuration, or execute arbitrary commands.

    Requirements and Research Agent

    This agent defines business workflows, data sources, price semantics, alert rules, and acceptance criteria.

    Its output should be a structured requirements document, not a broad market overview. Unverified information must be marked as “pending confirmation” so that downstream agents do not mistake assumptions for facts.

    Architecture Agent

    This agent defines data models, module boundaries, interface contracts, and nonfunctional requirements.

    For example, the collection module should produce normalized product snapshots. The alerting module should consume those snapshots rather than depend directly on source-page structure. A source change can then be handled without modifying the entire system.

    Development Agent

    This agent implements modules, adds tests, and submits change summaries. It may use local AI coding tools, but execution should take place in an isolated workspace.

    The developer must explain what changed, the affected scope, and any unfinished work—not merely report “development complete.”

    Testing and Acceptance Agent

    This agent derives test scenarios from requirements, executes checks, and verifies delivery criteria.

    It should not simply repeat the developer’s conclusions. Even when both roles use the same model family, they should maintain independent contexts and evaluate requirements, code, and actual test results. High-risk steps still require human review.

    5. Task Decomposition: Turn Natural-Language Plans into Dependency Graphs

    The price-monitoring project can be decomposed as follows:

    1. Requirements confirmation
    2. ├─ Confirm data sources and authorization
    3. ├─ Define price semantics
    4. └─ Establish acceptance criteria
    5. ↓
    6. Architecture design
    7. ├─ Data model
    8. ├─ Collection interface contract
    9. └─ Alert event specification
    10. ↓
    11. Module development
    12. ├─ Collection and normalization
    13. ├─ Historical data storage
    14. ├─ Trend visualization
    15. ├─ Alerts and notifications
    16. └─ Spreadsheet export
    17. ↓
    18. Integration testing
    19. ↓
    20. Delivery approval

    Parallel work requires clear interfaces. Collection, visualization, and alerting can be implemented concurrently, but premature parallelism increases rework if product identifiers, price fields, and time semantics are still unresolved.

    Each task should include at least:

    • A unique identifier
    • An objective and owner
    • Input materials
    • Dependencies
    • Output artifacts
    • Acceptance criteria
    • An execution time limit
    • A retry policy
    • A permission scope

    Possible states include pending, running, waiting for input, awaiting acceptance, completed, failed, and canceled. Record the reason and timestamp for every transition so that bottlenecks can be investigated.

    In particular, distinguish “output generated” from “accepted.” An agent submission should move a task to awaiting acceptance, not directly to completed.

    6. Context Management: Isolate Sessions, Share Verified Facts

    Long-running tasks cannot depend solely on model context capacity. Even a large context window can contain redundant information, outdated assumptions, and contradictory descriptions that undermine execution.

    Use three information spaces.

    Shared Project Facts

    Store information that every role must follow, including business scope, field definitions, interface contracts, security constraints, and confirmed decisions.

    Version this information and update it through an explicit process. One agent should not casually change an interface in a conversation while other agents continue using the old definition.

    Role-Specific Working Context

    Store local reasoning, provisional assumptions, and execution records for each role. This context can be summarized periodically, but summaries should retain references to key evidence and unresolved questions.

    Unconfirmed local assumptions must not automatically become shared project facts.

    Formal Deliverables

    Store design documents, code, test reports, and deployment instructions as identifiable, verifiable files or records.

    A handoff should contain more than “the work is done”:

    1. Task objective: Implement price snapshot normalization
    2. Artifact location: Corresponding record in the project artifact repository
    3. Input version: Price field specification, version 2
    4. Acceptance status: Basic cases passed; anomalous-field cases still required
    5. Open issue: Display behavior when the reference price is missing remains unconfirmed

    Structured handoffs are more reliable than repeatedly copying entire conversation histories.

    7. Communication Protocols: Prevent Message Loops and Duplicate Execution

    The ability to exchange messages does not automatically create effective collaboration. Messages should distinguish task assignments, clarification requests, result submissions, exception escalations, and decision confirmations.

    The following is an illustrative custom message structure, not an interface for any specific product:

    1. Message ID: Unique value
    2. Related task: Task identifier
    3. Sender role: Development
    4. Recipient role: Architecture
    5. Message type: Clarification request
    6. Related artifact version: Field specification, version 2
    7. Content: Should coupon-adjusted prices be included in low-price threshold checks?
    8. Expected response: Define the rule and update the shared requirements document

    Apply three controls:

    Deduplication. Network retries may deliver the same message more than once. Recipients should use message identifiers to avoid creating duplicate tasks.

    Loop limits. Escalate to the coordinating agent or a human when a discussion exceeds a defined number of exchanges, rather than allowing endless debate.

    Permission enforcement. Messages can trigger only authorized actions. A text instruction such as “publish immediately” must not bypass release approval.

    Do not assume messages are delivered exactly once. A more robust approach permits redelivery while making task handling, notification delivery, and state updates idempotent.

    8. Automated Development: Keep Code Execution Under Control

    When development agents use local coding tools, give each task an independent working directory, restrict file access, and use an isolated test environment.

    The execution workflow can follow these stages:

    1. Read requirements and interface contracts.
    2. Inspect existing code and relevant tests.
    3. Propose a change plan.
    4. Implement the changes.
    5. Run checks and tests.
    6. Produce a change summary.
    7. Submit the work for independent acceptance.

    The tool layer should use an allowlist rather than permit arbitrary commands by default. Reading project files, running specified tests, and modifying designated directories can be authorized by role. Broad file deletion, installation of unknown dependencies, access to production credentials, and external publishing require stricter controls.

    Credentials should not appear directly in prompts, code, or logs. Instead, the controlled execution layer should provide short-lived, least-privilege access when needed and redact sensitive output.

    When multiple development tasks modify the same project, establish serialized integration or an explicit merge process. Workspace isolation reduces execution interference; it does not eliminate code conflicts.

    9. Data Design: Reliable Price Monitoring Requires Consistent Semantics

    A price snapshot typically records:

    • Monitored item identifier
    • Data source identifier
    • Product variant
    • Current price and currency
    • Reference price
    • Promotion description
    • Stock status
    • Collection timestamp
    • Data quality flags
    • Location of source evidence

    Represent monetary values with a numeric format that preserves the required business precision, rather than relying on ordinary floating-point arithmetic. Prices in different currencies cannot be compared directly. Cross-currency analysis requires a defined conversion source and time basis.

    Retain source evidence according to business needs, with retention limits, access controls, and redaction rules. Evidence supports verification; it is not a reason to retain all source content indefinitely.

    Do not silently convert invalid fields to zero. A missing price should invalidate the snapshot. Otherwise, a collection failure may be misclassified as a major price drop.

    10. Alert Design: Reduce False Positives Before Optimizing Speed

    The relative price change can be expressed as:

    1. Relative change = (Current price - Previous valid price) / Previous valid price

    Before calculating it, confirm that both records refer to the same product variant, currency, and price definition, and that the previous price is valid and greater than zero.

    Sending a notification after every single change often creates noise. More reliable rules include:

    • Confirm an anomaly through consecutive valid observations before notifying.
    • Suppress repeated notifications for the same event during a cooldown period.
    • Allow a new event of the same type only after the state has returned to normal.
    • Handle unknown stock status separately from confirmed out-of-stock status.
    • Suspend business alerts when observations are too old.

    Notifications should identify the product, triggering rule, previous and current prices, observation time, and data reliability status—not simply say “price anomaly.”

    Failed notifications should enter a retry workflow. A temporary messaging outage should not stop data collection or historical storage.

    11. Acceptance Testing: Use Evidence to Determine Completion

    A common multi-agent failure is mutual agreement between roles without actual verification.

    Acceptance should cover at least four levels.

    Module Tests

    Verify price parsing, field normalization, change calculations, alert deduplication, and export logic.

    Integration Tests

    Check that collected data is stored correctly, alerts consume the intended snapshots, and visualization and export apply the same filtering conditions.

    Failure Tests

    Simulate timeouts, missing fields, duplicate messages, unavailable sources, notification failures, and process restarts.

    Business Acceptance

    Use confirmed examples to verify low-price, volatility, and out-of-stock scenarios. Where tests make real external requests, keep their intensity within authorized limits.

    Acceptance reports should record the execution environment, test scope, failures, and uncovered risks. “All tests passed” must refer to actual results, not model-generated rhetoric.

    12. Around-the-Clock Operation: Recovery Matters More Than Continuous Reasoning

    An unattended system should use event-driven execution or scheduled tasks and wait when idle. Agents should not continually generate questions and answers for themselves.

    Continuous operation depends on the following mechanisms:

    Leases and heartbeats. Executors periodically renew task leases. If a lease expires, the scheduler determines whether the task can be reassigned.

    Checkpoints. Save completed steps, artifact locations, and external side effects so that a restart does not require repeating the entire task.

    Retries and backoff. Temporary network errors may justify limited retries. Permission errors, invalid configuration, and persistent data anomalies should be escalated.

    Circuit breakers. Pause calls to a source or tool after repeated failures to avoid amplifying an outage.

    Budget controls. Limit execution time, model calls, tool calls, and concurrency. When a limit is reached, move the task into an explicit waiting or failed state.

    Idempotent execution. Retries must not send the same alert repeatedly, create duplicate monitored items, or repeatedly overwrite valid artifacts.

    Always-on capability is therefore primarily a matter of scheduling, persistent state, and recovery. Continuous model activity is secondary.

    13. Security Governance: Treat External Content as Data, Not Instructions

    Price monitoring processes untrusted product pages, promotion descriptions, and external documents. These sources may contain text intended to redirect an agent’s behavior.

    The system must establish a clear boundary: external content can supply business data, but it cannot change role permissions, system rules, or execution objectives.

    Practical controls include:

    • Passing source content separately from task instructions
    • Validating extracted data against a defined structure
    • Preventing page text from directly triggering commands
    • Restricting new network destinations and outbound data transfers
    • Requiring human approval for production changes
    • Maintaining audit trails for tool calls, approvals, and sensitive operations

    Reduce agent discretion in higher-risk steps. For example, releases should follow fixed rules rather than letting a model improvise deployment commands and target environments.

    14. Model Selection: Evaluate Task Performance, Not Marketing Claims

    Multi-agent development requires requirements comprehension, structured output, tool use, consistency across long tasks, and error recovery. A single conversation is not enough to evaluate these capabilities.

    Create a common evaluation set and compare models under the same inputs, permissions, and budgets. Assess whether they:

    • Omit important constraints
    • Use tool results correctly
    • Adjust their approach after failures
    • Claim completion without supporting evidence
    • Maintain consistent interface and field definitions
    • Recognize issues that require human confirmation

    Long context helps carry more information, but it does not guarantee perfect recall or an uninterrupted task chain. Persistent state, versioned artifacts, and independent acceptance remain the foundations of reliability.

    Roles also do not need identical configurations. Rules or lightweight processing can handle simple classification and format validation, while complex design and failure analysis receive more reasoning resources.

    15. Implementation Roadmap: Expand from One Verified Workflow

    Build the system in three stages.

    Stage 1: A Minimal End-to-End Workflow

    Use only coordination, development, and acceptance roles. Implement one authorized source, a small set of monitored items, and one alert rule.

    The priority is to verify that requirements become tasks, code runs, and failures are recorded—not to maximize feature count.

    Stage 2: Reliable Collaboration

    Add requirements and architecture roles. Establish a shared fact repository, structured messages, task dependencies, and versioned artifacts.

    Complete deduplication, checkpointing, permission controls, and failure testing so that parallel collaboration does not weaken control.

    Stage 3: Continuous Operations

    Introduce scheduling, operational monitoring, budget limits, and approval workflows. Refine retry policies and role responsibilities using actual failure records, then gradually expand monitoring coverage and task concurrency.

    The final delivery should include code and configuration guidance, requirements documentation, test reports, deployment steps, alert rules, a permission inventory, and procedures for pausing, resuming, and rolling back the system.

    Conclusion

    Multi-agent collaboration is not simply connecting several models or delegating every decision to a single supervisor. A reliable system assigns interpretation and judgment to models, state and dependencies to orchestration, execution boundaries to tools, and completion evidence to testing and approval.

    In price monitoring, business definitions determine whether results are meaningful. Data quality determines whether alerts are trustworthy. Task orchestration determines whether collaboration is stable. Recovery and permission controls determine whether the system can operate safely over time.

    Start with a small, verifiable workflow and expand automation gradually. This is a more practical route to stable, governable engineering capability than building a large agent fleet from the outset.