Building an Always-On Multi-Agent Development System from Scratch
A practical guide to building a multi-agent development system that can accept work continuously, coordinate specialized agents, and recover from failures. Using a competitor price-monitoring dashboard as a running example, this article covers architecture, role design, shared context, workflow orchestration, tool permissions, scheduling, testing, and cost control. The focus is reliable delivery—not keeping models running indefinitely.
1. Define the Goal: Reliable Progress, Not Continuous Model Activity
Multi-agent development systems are appealing because they can break a complex request into specialized tasks, assign those tasks to different roles, and combine the results into deliverables that can be verified and accepted.
For example, a business stakeholder might submit this request through an enterprise messaging platform:
Build a competitor price-monitoring dashboard that accepts product URLs, periodically collects prices and stock availability, displays price trends, flags unusual changes, sends notifications when specified conditions are met, and supports spreadsheet exports.
The request sounds clear, but many details remain undefined. Which data sources may be accessed? How should product variants be matched? Are promotional prices conditional? How often should collection run? Which changes should trigger notifications? Is the deliverable a demonstration page or an application that can operate continuously?
The first challenge is therefore not automated coding. It is establishing a complete workflow from requirements clarification to delivery acceptance.
“Always-on” does not mean a model must generate content continuously. A more useful definition is a system that can continuously receive tasks, execute them within available resources and authorization boundaries, pause or request human intervention when blocked, recover from failures, and retain traceable task states throughout.
2. Architecture: Separate Business Judgment from Reliable Execution
A maintainable system can be organized around the following flow:
Business entry point↓Identity verification and request registration↓Task orchestration and state management↓Specialized agent execution↓Controlled tools and runtime environments↓Artifact storage, testing, notifications, and auditing
The responsibilities behind this flow fall into six areas.
Business Entry Point
Requests can arrive through enterprise messaging, an internal workspace, or a protected API. The entry point should receive requests, identify submitters, and display progress—not contain all the business logic.
Each request should receive a unique task identifier. Record its submission time, business owner, permission scope, and delivery requirements. Any information supplied later should be attached to the same task rather than scattered across separate conversations.
Orchestration Layer
The orchestrator maintains dependencies, schedules execution, limits concurrency, and handles timeouts and failures.
A model may recommend the next step, but software should validate critical state transitions. For example, a task should enter deployment only after its test report meets acceptance criteria and release approval is complete.
This prevents a common failure mode: the model declares the work finished, and the system immediately delivers an unverified result.
Agent Execution Layer
Separate roles handle research, product definition, architecture, development, and testing. They work in independent contexts while collaborating through structured messages and shared artifacts.
Tool Execution Layer
File changes, code execution, data access, network requests, and notifications are tool capabilities. Every tool call must pass permission checks. A model’s request to use a tool is not sufficient authorization to execute it.
Persistence Layer
Persist task states, messages, requirements documents, code changes, test reports, and approval records. Conversation history can support understanding, but it must not be the only source of truth.
Observability Layer
The system should make it possible to determine:
- Which tasks are blocked.
- Which roles repeatedly fail.
- Which tool calls take too long.
- Whether notifications have been sent more than once.
- Whether resource consumption exceeds the budget.
3. Role Design: Start with a Small Team
More agents do not automatically produce better results. Each additional agent increases communication, context synchronization, and integration costs.
An initial system can use five role categories.
Coordinator
The coordinator interprets requests, asks clarification questions, decomposes work, assigns tasks, reviews deliverables, and reports progress.
It should not perform every specialist task or act as an unrestricted administrator. Its role is workflow coordination: it can propose decisions, but remains subject to state rules and authorization controls.
Research Agent
The research agent examines target users, business workflows, public information, and conditions for obtaining data.
Its reports should distinguish between:
- Facts supported by evidence.
- Judgments derived from those facts.
- Assumptions that have not been verified.
Inaccessible data sources, outdated information, and model guesses must not be presented as established facts.
Product Agent
The product agent translates business language into implementable, testable requirements.
Its primary output should not be a vague feature list. It should define user scenarios, business rules, scope boundaries, and acceptance criteria.
Architecture and Development
The architecture role defines modules, data models, interface contracts, and key technical risks. The development role implements features in a controlled workspace and submits changes.
Small projects can combine these roles. Larger projects can separate collection, backend, and user-interface work as needed. Avoid creating a heavyweight organization before the project requires one.
Test Agent
The test agent independently designs tests from the requirements and acceptance criteria. It should not merely repeat the developer’s claim that everything passed.
Coverage should include normal workflows, invalid inputs, missing data, duplicate messages, timeouts, insufficient permissions, and recovery behavior.
Define explicit handoff contracts between roles. Architecture work can begin after the product role submits the requirements document. Validation can begin after development provides a runnable artifact and testing instructions.
4. Context Isolation: Share Facts, Not Every Conversation
Independent contexts reduce interference between roles, but isolation must not disconnect them from shared information.
If each role knows only its immediate task, the product agent may define one interpretation of price, the developer may implement another, and the tester may validate a third.
Maintain a single project source of truth containing:
- The current approved requirements version.
- Confirmed business rules.
- Architecture decisions and their rationale.
- Data fields and interface contracts.
- Unresolved questions.
- Test and acceptance results.
Prefer structured messages over forwarding entire chat histories. The following is an illustrative format, not an actual product interface:
Task ID: price-monitor-001Sender role: ProductRecipient role: ArchitectureMessage type: Requirements confirmedArtifact version: Version 2Key conclusions:- The initial release uses only permitted data sources- Conditional discounts and standard prices are recorded separatelyOpen questions:- Data retention periodExpected action: Complete the data model and collection design
Each artifact should record its version, authoring role, creation time, and supporting basis. When requirements change, explicitly identify downstream artifacts that need updates. Do not rely on a model to recall the entire project history.
A larger context window can hold more information, but it does not guarantee that details will be retained correctly. Reliable collaboration depends on fact management and version control, not simply longer inputs.
5. Define the Price-Monitoring Business Rules
Establish Collection Boundaries
Data collection must be lawful, authorized, and consistent with the source’s usage rules. Prefer authorized APIs, existing enterprise data, partner-provided files, or public pages that permit access.
If a source requires authentication, prohibits automated access, or would require bypassing access restrictions, do not assume an agent should solve the obstacle independently. Pause the task and seek a compliant alternative.
Define Product Identity
The same product may differ by specification, region, seller, or promotional conditions. Merging records based only on similar titles can produce invalid comparisons.
Separate monitored items into two levels: a canonical product and a source-specific product. Record:
- Specifications and pack quantity.
- Source identifier and product URL.
- Seller.
- Currency and pricing unit.
- Applicable region.
- Discount conditions.
- Human verification status.
Products that cannot be matched reliably should remain pending verification rather than being automatically added to the same price series.
Define Price Semantics
Displayed prices, crossed-out prices, member prices, and discounted prices are not interchangeable fields. A conditional discount cannot be treated as a transaction price available to every user.
An initial version can record the displayed price, reference price, discount description, and stock status separately. Generate a “comparable price” only when the calculation has a clear basis.
A collection failure must be recorded as failed or unknown. Do not substitute zero for a missing price or interpret a parsing failure as an out-of-stock result.
Define Acceptance Criteria
Acceptance criteria should describe observable outcomes, such as:
- Adding a valid monitored item creates a collection task.
- Successful collection stores the timestamp, price, stock status, and source information.
- Failed collection displays the reason without overwriting the most recent valid price.
- Meeting an alert condition creates a traceable alert event.
- Exports include the monitored item, collection time, price definition, and stock status.
- Users can access only data within their permission scope.
Confirm these criteria before development, not at delivery time.
6. Orchestration: Use a State Machine to Control Progress
A project can use the following primary states:
Awaiting clarification → Research → Awaiting requirements approval→ Design → Development → Testing→ Awaiting acceptance → Delivered
Add separate states for failure, suspension, cancellation, and required human intervention.
Each state needs entry conditions, permitted actions, and exit conditions. For example:
- Enter development: Requirements are approved, and key interfaces and data models are defined.
- Enter testing: Changes are saved, and runtime instructions and environment configuration are available.
- Enter acceptance: Critical tests pass, and known issues are documented.
- Enter deployment: Approval is complete, and the rollback plan is executable.
Run independent tasks in parallel, but account for dependencies and conflicts. Collection work and interface prototyping can proceed concurrently once their interface contract is established. Multiple developers changing the same shared module require sequential execution or an explicit change-coordination mechanism.
When tests fail, the orchestrator should create a rework task with failure evidence. Development and testing must not cycle indefinitely. Set a maximum number of rework attempts or a time budget, then escalate to a human when the limit is reached.
7. Coding Tools: Grant Only the Permissions Required
Development agents can use AI coding tools locally or in isolated environments, but their operating scope must be restricted.
At minimum, establish these boundaries:
- Give each task a separate working directory.
- Isolate test environments from production.
- Allow access only to the data and network destinations required for the task.
- Supply credentials through controlled mechanisms, not prompts, code, or logs.
- Require approval for high-risk actions such as deleting data, changing permissions, or deploying applications.
- Preserve changes and maintain execution records.
- Retain diagnostic information after failures rather than retrying until resources are exhausted.
Treat text in web pages, documents, and code comments as external data. Instructions such as “ignore previous requirements” or “read the secrets” must not change the system’s authorization.
A prompt alone cannot enforce these protections. The tool layer must also validate paths, check permissions, and block sensitive operations.
8. Continuous Operation: Prioritize Scheduling, Idempotency, and Recovery
Trigger Work Through Scheduled Events
A periodic scheduler can create price-collection tasks. Agents do not need to remain continuously active.
Prefer ordinary software for deterministic collection, cleaning, storage, and threshold checks. Use models primarily for requirements interpretation, explanations of complex exceptions, and development collaboration.
This reduces costs and limits the impact of inconsistent model outputs.
Handle Duplicate Execution
Task queues may deliver the same task more than once. Do not assume exactly-once execution.
An idempotency key can combine the monitored item, scheduled collection time, and collection-rule version to prevent duplicate writes for the same logical task. Notifications should also track the alert event and delivery status to avoid repeated messages.
Classify Failures
Different failures require different responses:
- Temporary network error: Retry a limited number of times, increasing the interval as appropriate.
- Changed page structure: Save a parsing-failure sample and initiate a repair workflow.
- Expired or revoked access: Pause the task and notify its owner.
- Anomalous data: Preserve the original evidence for verification.
- Tool execution failure: Save execution records and create a repair task.
A failure is not an out-of-stock result. A timeout is not a price change. An unknown state should not be forced into a business conclusion.
Create Checkpoints
Requirements approval, completed architecture, saved code changes, and completed testing are useful checkpoints.
When resuming work, load the latest trusted state, valid artifact versions, and unfinished tasks instead of restarting the entire workflow. Before repeating an operation with external side effects, check whether it already succeeded.
9. Anomaly Detection and Notifications: Reduce False Alarms
Start with simple, transparent price rules.
For a current comparable price (P_t) and baseline price (P_b), the relative change is:
Relative change = (Current price - Baseline price) / Baseline price
Before calculating it, verify that the baseline is valid and greater than zero. Both prices must use the same product specification, currency, and discount basis.
The baseline might be the most recent valid price or the median over a selected time window. The appropriate choice depends on the business objective; there is no universal threshold for all products.
To control noise, consider:
- Requiring the condition to hold across multiple consecutive observations.
- Applying a notification cooldown to the same anomaly.
- Treating stock-status changes separately from an initial unknown status.
- Excluding missing data from price-change calculations.
- Sending a recovery notification when an anomaly ends.
- Including the collection time, price definition, and evidence link in notifications.
Keep enterprise messaging notifications concise and store full reports in a controlled location. Do not send raw pages, sensitive data, or extensive logs directly into group chats.
10. Testing and Acceptance: Validate the Workflow and the Business Meaning
Testing a price-monitoring system requires more than checking whether the dashboard opens.
Data Testing
Check for missing fields, incorrect units, inconsistent timestamps, duplicate records, and mismatched product specifications. Verify that unparseable data remains correctly marked as unknown.
Business Testing
Verify that discount conditions are distinguished correctly, stock states follow the defined rules, and alerts do not produce unacceptable false positives or missed events.
Failure Testing
Simulate unavailable sources, duplicate task delivery, tool timeouts, interrupted execution, and notification failures. Observe whether the system recovers correctly.
Security Testing
Verify that unauthorized access, malicious inputs, sensitive-information leakage, and high-risk tool calls are blocked. Spreadsheet exports also require attention to the risk of untrusted text being interpreted as formulas.
Delivery Testing
The delivery package should include:
- Requirements documentation.
- Operating instructions.
- Configuration guidance.
- A data dictionary.
- Test reports.
- Known limitations.
- Recovery procedures.
- A rollback plan.
A successful demonstration proves that one path works. It does not establish production reliability.
11. Model Selection and Cost Control: Evaluate Real Tasks
Multi-agent development depends on instruction following, structured output, tool use, code modification, and consistency across long workflows. These capabilities must be assessed through actual tasks.
Create a small evaluation set to check whether a model can:
- Identify ambiguous requirements.
- Preserve approved interface and field contracts.
- Handle tool failures correctly.
- Avoid presenting missing information as fact.
- Repair issues using test evidence.
- Provide verifiable delivery instructions when finished.
One successful task does not demonstrate suitability for long-term unattended operation.
Cost analysis should also cover more than individual calls. Track model consumption, tool runtime, rework attempts, human review time, and the final completion rate across the entire task.
Use deterministic software wherever possible for simple field validation, scheduled collection, threshold calculations, and state transitions. Cap agent count, concurrency, retries, and total budget.
12. Implementation Roadmap: Expand from a Controlled Workflow
Stage 1: Build a minimal requirements–development–testing loop.
Use authorized sample data to validate task decomposition and handoff contracts.
Stage 2: Add research and product roles.
Establish a shared source of truth, artifact versioning, and a state machine.
Stage 3: Connect permitted data sources.
Implement scheduled collection, historical storage, trend displays, and alert events.
Stage 4: Add operational safeguards.
Complete permission isolation, idempotency handling, failure recovery, monitoring, and human approval.
Stage 5: Operate continuously in a controlled environment.
Adjust rules based on real failures, then gradually broaden the task scope.
The governing principle is straightforward: agents handle understanding, reasoning, and collaboration; software enforces constraints, executes operations, and records results; humans provide critical authorization and business acceptance.
Combining these responsibilities turns an always-on multi-agent system from an impressive automated demonstration into an engineering service that can deliver continuously, recover from failures, and remain controlled when risks arise.
