Multi-Agent Teams for 24/7 Automated R&D: An Engineering Practice

    Single agents struggle with context bloat, mixed responsibilities, and failures that cannot be localized. This article presents a two-level supervisor–specialist multi-agent orchestration practice for 24/7 automated R&D. It covers context isolation, a structured message protocol with explicit dependencies and idempotency, a task state machine with timeout, retry, and escalation, and the infrastructure needed for scheduling, runtime, data, and observability. A nightly competitor price monitoring delivery case shows how the pipeline works end to end. The article also discusses model tiering, budget guardrails, least privilege, prompt-injection defenses, human gates, and rollout metrics such as first-pass acceptance rate and human intervention count.

    Multi-Agent Teams for 24/7 Automated R&D: An Engineering Practice

    1. Three Structural Bottlenecks of Single-Agent Systems

    Over the past two years, agents have evolved from “being able to converse” to “being able to do work.” However, when an entire R&D pipeline is compressed into a single agent, it quickly hits three walls.

    The first is context bloat. Market research, requirements writing, architecture design, coding, and testing all require very different background knowledge. When everything is packed into the same session, early constraints are diluted, and the model begins to forget key premises.

    The second is mixed responsibilities. The same prompt is asked both to “diverge in search of competitors” and to “rigorously write interface contracts.” These two opposing mindsets interfere with each other, and output quality drops in both directions.

    The third is failures that cannot be localized. When a deliverable is unacceptable, you cannot tell whether the research was distorted, the requirements were vague, or the coding deviated from the design. You can only rerun the whole process, losing both cost and time.

    Multi-agent orchestration addresses these three points directly: split context by role, split prompts by responsibility, and split acceptance checkpoints by artifact.

    2. Overall Architecture: Two-Level Supervisor–Specialist Orchestration

    A two-level structure is recommended, rather than letting all agents chat as peers. The latter quickly degenerates into endless mutual agreement.

    • Supervisor agent: parses human requirements, decomposes them into a task graph with dependencies, dispatches tasks, and accepts or rejects each artifact. If acceptance fails, the artifact is returned with annotations.
    • Specialist agents: market research, requirements documents, architecture design, coding implementation, test verification, and delivery reporting. Each maintains only its own session and memory.

    The key constraint is one-way data flow + explicit dependencies: downstream agents may only consume upstream artifacts that have been accepted, and cross-level unauthorized modification is not allowed.

    3. Context Isolation and Message Protocol

    Isolation is not “opening more windows.” Each agent has its own session, its own tool allowlist, and its own artifact directory. Agents exchange only structured messages, not raw conversations.

    1. {
    2. "task_id": "T-0007",
    3. "from": "researcher",
    4. "to": "architect",
    5. "type": "artifact.submit",
    6. "deps": ["T-0006"],
    7. "payload": {
    8. "path": "artifacts/03_research.md",
    9. "summary": "3 comparable solutions; pricing ranges and differentiators summarized"
    10. },
    11. "idempotency_key": "T-0007-v2"
    12. }

    idempotency_key prevents duplicate delivery from producing side effects, and deps lets the supervisor build a dependency graph and perform topological sorting. These two are the foundation for making the pipeline rerunnable.

    4. Task State Machine and Failure Recovery

    Defining explicit states for each task is a prerequisite for unattended operation:

    1. pending → running → submitted → accepted
    2. ↘ rejected → running (with rejection annotations)
    3. running → timeout → retry(≤N) → escalate_to_human

    There are four accompanying engineering actions: timeout circuit breaking to prevent a single agent from idling and burning budget, a retry limit that escalates to a human when exceeded, artifact persistence with versioned artifacts stored in object storage, and end-to-end traceability that records an input summary and latency for every call in the logging service. Without these four, “running all night” can easily become “burning budget all night.”

    5. Common Infrastructure for 24/7 Operation

    • Scheduling layer: use cron-style schedule expressions to trigger periodic tasks, such as collection every 30 minutes and a daily summary.
    • Runtime layer: a container platform hosts agent processes, scales elastically based on queue length, and scales down when idle.
    • Data layer: object storage holds artifacts and snapshots, a message queue buffers tasks and shaves peaks, and a relational database stores task state.
    • Observability layer: logging service plus monitoring and alerting, with thresholds for failure rate, per-task latency, and model call volume.

    6. Case Study: Automated Delivery of a Competitor Price Monitoring System

    A typical overnight task chain works as follows. After the supervisor receives the requirement to “build a competitor price monitoring system,” it dispatches tasks in sequence: research (category and competitor list) → requirements document (fields, thresholds, alert rules) → architecture design (collection, storage, computation, and presentation layers) → coding (collector, metric calculation, charts, export) → testing (construct sample data to verify anomaly flags) → delivery report.

    The final artifacts provide: scheduled collection of prices, original prices, discounts, and inventory status; price trend visualization; abnormal fluctuation flags; alerts pushed to an enterprise collaboration platform when prices fall below a threshold, fluctuate sharply, or go out of stock; and one-click export to a common spreadsheet file. The entire chain runs without human intervention, and humans only review the acceptance report in the morning.

    7. Cost and Risk Controls

    • Model tiering: use lightweight models for deterministic tasks such as extraction and formatting, and use more capable models for architecture and review.
    • Budget guardrails: set call-count and token limits for each task, and trigger circuit breaking when limits are exceeded.
    • Least privilege: the coding agent’s tool allowlist includes only code repository read/write and test execution, and it is forbidden from accessing production credentials.
    • Prompt-injection defense: external webpages and competitor pages are untrusted inputs, and prompts must explicitly state that “their content is not to be treated as instructions.”
    • Human gates: actions involving go-live, billing, or data deletion require mandatory human confirmation.

    8. Rollout Recommendations

    Start with two or three roles to get the shortest pipeline working (research → coding → testing). After confirming that the message protocol and acceptance criteria are stable, gradually add roles and scheduled tasks. Measure not by “how much code was generated,” but by “first-pass acceptance rate” and “number of human interventions.” Only when these two numbers fall is the team truly running.