Multi-Agent Development Guide: Running a 24/7 AI Engineering Team
This article presents a reproducible engineering approach to building a multi-agent system that can deliver software work unattended around the clock. It covers a three-layer architecture with context isolation, role and prompt design, an end-to-end delivery walkthrough, stability practices such as state machines and message buses, and common pitfalls with their mitigations. Readers will learn how to structure agent roles, pass structured messages, and keep acceptance criteria consistent across long-running tasks.
1. Background: From a Chat Model to a Delivery Team
Single-turn conversational LLM applications can no longer handle the complexity of real development work. A complete requirement often spans market research, requirements definition, architecture design, coding, testing, and operations alerting. If information is lost at any step, every downstream step inherits the error.
The value of a multi-agent system is that it breaks “one answer from one model” into a collaboration network of multiple roles, multiple contexts, and multiple message chains, so long tasks can keep moving without human supervision.
The underlying model must do more than understand a single request correctly. It must deliver three things: long-task stability (staying on track for dozens of turns), long-context retention (not forgetting key constraints), and cross-turn task consistency (not drifting away from goals and acceptance criteria). This article uses an open-source LLM as the foundation and provides a reproducible engineering blueprint.
2. Overall Architecture: Role Layers and Context Isolation
Use a three-layer structure: orchestrator, functional agents, and execution tools.
- Orchestrator agent: the only external entry point. It clarifies requirements, decomposes tasks, assigns work, and consolidates acceptance results.
- Functional agents: market research, product manager, architect, development lead, testing, and operations alerting, each with its own isolated context.
- Execution layer: local coding tools, code repositories, message queues, scheduled jobs, monitoring and alerting, object storage, and other shared capabilities.
The core design principle is context isolation plus message passing. Each agent keeps only the context required by its own role. Information crossing roles travels as structured messages, which prevents context pollution and instruction bleed.
{"task_id": "price-monitor-001","from": "orchestrator","to": "architect","type": "handoff","payload": {"goal": "Competitor price monitoring dashboard","constraints": ["Scheduled collection", "Anomaly flagging", "Message alerts", "Table export"],"acceptance": ["Links can be entered", "Trend charts work", "Out-of-stock triggers alerts"]},"trace_id": "9f2c"}
3. Roles and Responsibilities (with Prompt Essentials)
- Orchestrator: only decomposes and accepts work; never writes code. Its output must be executable task cards containing goal, constraints, acceptance criteria, and dependencies.
- Market research: produces a competitor and solution comparison matrix, marking information sources and uncertainty.
- Product manager: converts research conclusions into a prioritized requirements list, marking items as “must-have” or “optional”.
- Architect: defines module boundaries, data flow, retry-on-failure strategy, and idempotency strategy.
- Development lead: autonomously invokes local coding tools, implements task cards one by one, and self-tests while coding.
- Testing: generates test cases from acceptance criteria, covering normal, boundary, and failure paths.
- Operations alerting: configures scheduled jobs, threshold rules, and notification channels, and produces an on-call handbook.
Each role’s system prompt should fix three things: role boundaries, output format, and prohibited actions. For example, the development lead must not change acceptance criteria, and testing must not skip failing cases.
4. Walkthrough of a Complete Delivery
Take a “competitor price monitoring dashboard” as the example. The end-to-end flow is:
- The orchestrator receives the requirement: enter competitor links, periodically collect price, original price, discount, and stock status, provide trend charts and anomaly markers, push alerts on low prices, sharp fluctuations, and out-of-stock, and support table export.
- The research agent recommends collection frequency and anti-scraping compliance practices, and marks the legal and compliance boundaries of data acquisition.
- The product agent outputs requirement cards and an acceptance checklist, stating that out-of-stock must trigger an alert.
- The architect agent designs six modules (collection, cleaning, storage, computation, presentation, alerting) and defines retry-on-failure and deduplication keys.
- The development lead loops through “implement, self-test, commit” and reports back after each task card.
- The testing agent runs the full flow against the acceptance criteria and rolls back to the corresponding task card on failure.
- The operations agent configures scheduled jobs and threshold alerts and delivers the runbook.
# Pseudocode: collection and anomaly detectiondef collect(url):raw = fetch(url) # Compliant fetchingitem = parse(raw) # Price/original price/discount/stocksave(item, dedup_key=hash(url+item.ts))if item.stock == 0 or item.price < item.history_min * 0.8:alert("Anomaly", item)
5. Stability Engineering: Keeping the Team Running All Night
- Task cards and state machine: every task has a unique ID and a state (todo, in progress, blocked, done). The orchestrator advances work based on state only.
- Message bus: use a message queue for asynchronous decoupling, guaranteeing order and replayability. Failed messages go to a retry queue.
- Idempotency and deduplication: both collection and alerting need idempotency keys to avoid duplicate notifications.
- Context compression: use rolling “summary plus key points” compression for long conversations, keeping the goal, constraints, and acceptance criteria intact.
- Observability: one trace_id spans the whole chain, logs are collected centrally, and monitoring covers stalled tasks and failure rates.
- Human fallback: force human confirmation when compliance, accounts, or external dependencies change.
6. Common Pitfalls and How to Avoid Them
- Role overreach: development changes requirements directly. Fix: lock boundaries in prompts and have the orchestrator run consistency checks.
- Goal drift: acceptance criteria are abandoned after many turns. Fix: every report must cite acceptance item numbers.
- Alert storms: thresholds are too sensitive. Fix: add silence windows and aggregation policies.
- Data compliance: collection frequency and source legality. Fix: produce a compliance conclusion during the research phase.
- Cost overrun: unlimited loop calls. Fix: set a maximum number of turns and a budget cap.
7. Conclusion
A multi-agent development team is essentially about making the development process protocol-driven, state-driven, and observable. When role boundaries are clear, message chains are reliable, and acceptance criteria are machine-readable, 24/7 unattended delivery becomes engineering-feasible. Start with a single-role pilot, expand to the full chain step by step, and keep a human review gate at every step.
