Building an Always-On Multi-Agent Collaboration and Price Monitoring System
A practical guide to turning multi-agent collaboration into an engineering system for competitor price monitoring: clear ownership, verifiable deliverables, task state machines, data collection and alerting architecture, recovery, security boundaries, and staged rollout.
1. Start with the goal: build a collaboration system, not more chat windows
Assigning requirements analysis, product design, architecture planning, development, and testing to different agents can reduce the amount of information a single context has to carry. More roles, however, do not automatically produce better delivery.
Without clear task dependencies, deliverable formats, and acceptance criteria, a multi-agent system easily falls into repeated discussion, overlapping responsibilities, and error propagation. A requirements agent produces a vague description, a development agent implements from that description, and a test agent inherits the same understanding. Every role then considers the work complete, while the business goal remains unmet.
An always-on collaboration system therefore has to solve three problems at the same time:
- Who owns what. Each role needs explicit inputs, outputs, and permission boundaries.
- How completion is confirmed. Completion must rest on inspectable deliverables and test results, not on a natural-language claim.
- What happens when something fails. The system must be able to pause, retry, recover, or hand work to a person. It cannot depend on the model remaining correct forever.
This article uses an e-commerce competitor price monitoring system as the running example and shows how agent collaboration can be grounded in a runnable engineering architecture. Always-on operation here means the service can continuously schedule and process tasks. It does not mean the model must reason continuously, and it does not mean the system may run indefinitely without supervision.
2. Turn business needs into a verifiable delivery scope
Suppose a business user submits the following request through an enterprise messaging channel:
Periodically monitor the transaction price, list price, promotion information, and stock status of specified products; show price trends; send notifications for low prices, significant changes, or stockouts; and support data export.
That statement is suitable for expressing a goal, but it is not enough to guide development directly. The requirements agent first needs to fill in the key constraints.
1. Define the monitoring target
A monitoring target should at least include the product source, product identifier, specification, collection region, and expected collection frequency.
Different capacities, colors, bundles, and sales channels for the same product may have different prices. Aggregating only by product name can mix prices from different specifications and create false “price drops” or “price increases.”
Create a stable identifier for each monitoring target and record how it maps to the source page and specification. When comparing across sources, also state the basis for product matching. Matches with insufficient evidence should enter a human confirmation queue.
2. Define the price basis
A number on a page is not necessarily the amount a customer can actually pay. The displayed price may depend on membership status, coupons, purchase quantity, or region.
Store these items separately:
- the price shown on the page;
- the strikethrough price and what it means at the source;
- the discount amount or discount description;
- the conditions under which the discount applies;
- a payable price calculated only when those conditions are clear;
- currency, pricing unit, and collection time.
Discounts that cannot be calculated reliably should keep their original description rather than being forced into a single number that only looks precise. A strikethrough price should not be treated as a historical transaction price unless that meaning has been verified.
3. Define acceptance criteria
Acceptance conditions should describe concrete behavior. For example:
- legally authorized data sources can be collected on schedule;
- submitting the same collection result again does not create duplicate records;
- missing data is not falsely reported as a price of zero;
- trend charts distinguish real observations from missing intervals;
- alerts explain the triggering rule and the data source;
- exported data includes the time range, price basis, and required fields.
When a requirement is ambiguous, the orchestrating agent should ask a question first rather than write an unconfirmed assumption directly into the implementation.
3. Design role boundaries and context isolation
A practical starting design can use six roles:
| Role | Main responsibility | Key deliverable |
|---|---|---|
| Orchestrator agent | Break down tasks, maintain dependencies, and coordinate exceptions | Task graph, progress summary, and delivery checklist |
| Research agent | Analyze the business scenario and data-acquisition constraints | Research notes and feasibility conclusions |
| Requirements agent | Define scope, rules, and acceptance criteria | Requirements specification and acceptance cases |
| Architecture agent | Design modules, data structures, and security boundaries | Architecture description and interface contracts |
| Development agent | Implement confirmed functionality | Code changes and implementation notes |
| Test agent | Independently verify functionality and exception handling | Test report and defect list |
Roles can change with the size of the work. A small project does not need an agent for every detail; coordination cost can exceed the benefit.
Separate contexts do not mean total isolation
The purpose of a separate context is to reduce irrelevant noise and let each role reason within its own responsibility. It does not mean agents cannot share results.
A more practical arrangement is:
- each role has its own workspace;
- the shared area stores only confirmed requirements, interface contracts, and deliverables;
- temporary reasoning and unverified guesses do not automatically become shared facts;
- key deliverables record their version and review status.
For example, the development agent needs the confirmed requirements and architecture, but it does not need every option rejected during research. The test agent should validate independently against the acceptance criteria rather than merely repeating the development agent’s success statement.
Context isolation is also not security isolation. Real permission control still has to be enforced by the runtime environment, identity credentials, and tool access policies.
4. Manage collaboration with a task state machine
Multi-agent collaboration should not rely entirely on free-form conversation. Organize the work as a task graph with dependencies and control execution with a state machine.
Typical task states are:
pending → ready → running → awaiting acceptance → completed
Also keep states such as “waiting for clarification,” “failed,” and “cancelled.” A task can enter the ready state only when its prerequisites are complete, its input materials are available, and its execution permissions are satisfied.
Each task should at least record:
- task identifier and project;
- responsible role;
- prerequisites;
- versions of input deliverables;
- expected output;
- acceptance criteria;
- timeout limit and retry budget;
- current state and failure reason.
The execution flow can be described schematically as follows:
Select a pending task whose dependencies are satisfiedAcquire an execution leaseLoad the confirmed input materialsExecute the task within limited permissions and budgetSave the deliverable and execution recordRun automated checksIf checks pass: move to awaiting acceptanceIf checks fail: classify the failure and decide whether to retry, return the task, or involve a human
An execution lease reduces the chance that multiple workers claim the same task. A lease alone does not eliminate duplicate operations. Writes, notifications, and similar actions also need idempotency controls.
Different failures need different retry strategies
A brief network failure can be retried with backoff. Unclear requirements should trigger a clarification request. Insufficient permissions should stop execution. A code defect should be returned for revision.
If every error is simply handled as “try again,” the system may keep consuming inference resources and may also resend messages or modify files repeatedly. Retries therefore need limits on count, time, and cost, and the full failure record must be retained.
5. Organize message intake and agent communication
An enterprise messaging channel is a good place for incoming requests and outgoing notifications, but it should not be the only task database.
Messages may be delivered more than once, arrive out of order, or be delayed by network failures. The system should first verify the sender’s identity and project permissions, persist the valid request, and then let the scheduler start the collaboration workflow.
Communication between agents should also be structured. A message should include the sending role, receiving role, task identifier, message type, deliverable reference, and the action the recipient is expected to take.
Message types can be separated into:
- informational notices;
- clarification requests;
- review requests;
- defect reports;
- task blockers;
- completion notices.
A “task completed” message should not by itself change the final acceptance state. The recipient still needs to check that the deliverable exists, that the version matches, and that the verification result is valid.
For large documents or code, do not keep placing the full content back into the conversation. Passing a controlled deliverable reference reduces context load and makes change history easier to trace.
6. Core architecture of the price monitoring system
At the business layer, the system can be split into this pipeline:
monitoring configuration → scheduled dispatch → data collection → field normalization → observation storage → rule evaluation → notification delivery → trend display and export
These modules should be separate from the agent orchestration layer. Agents handle analysis, development, inspection, and assisted maintenance. Stable collection, storage, and alerting should preferably be executed by deterministic programs.
1. Data collection: lawful, restrained, and traceable
Prefer authorized data interfaces, partner-provided data, or sources that permit automated access. Before collecting, verify access rules, usage permission, and rate limits.
Do not treat bypassing access controls, CAPTCHAs, or anti-automation mechanisms as a default system capability.
Each collection should record the source, collection time, result status, and the raw evidence that is necessary. Parsing failures, page changes, and restricted access should produce explicit error types rather than a guessed price.
2. Data normalization: preserve business differences
The goal of normalization is a consistent structure, not the removal of meaningful differences.
Store price observations, promotion descriptions, stock status, and source information separately. Stock status should at least distinguish “in stock,” “out of stock,” and “unknown.” “Unknown” must not be mapped directly to “out of stock.”
Price amounts should use a representation suitable for exact monetary calculation so that binary floating-point error does not affect threshold decisions. Different currencies and pricing units should not be compared directly without an explicit conversion rule.
3. Storage: separate configuration, facts, and derived results
Monitoring configuration describes what the system intends to monitor. Price observations describe what was actually collected. Alert events describe which facts triggered which rule.
Storing the three separately supports tracing and recalculation. For example, after a price-drop threshold changes, historical data can be re-evaluated without altering the original observations.
Duplicate-write control can be designed around the monitoring target, collection batch, and source record identifier. The exact uniqueness rule must match the characteristics of the data source so that several genuine changes within the same period are not deleted by mistake.
7. Anomaly detection cannot rely on a single percentage
Common price-monitoring rules include a low-price threshold, the magnitude of change between adjacent valid observations, and changes in stock status.
The rate of change between adjacent prices can be expressed as:
change rate = (current valid price − previous valid price) ÷ previous valid price
Before calculating, confirm that the previous price is greater than zero, the currency is the same, the specification is the same, and the price basis of the two observations is comparable.
Fixed thresholds suit cases with clear rules. Rules based on a sliding-window median and a volatility range can reduce interference from a small number of abnormal observations. Either method still has to account for these issues:
- when observations are far apart, the business meaning of the change rate changes;
- a change in promotion conditions can create an apparent price jump;
- a change in page structure can cause a parsing error;
- a new monitoring target lacks historical samples and should not immediately use historical statistical rules.
Data-quality checks should therefore come before anomaly detection. When a price looks abnormal but the evidence is insufficient, raise a “needs review” event rather than directly concluding that the price has definitely fallen.
Alerts also need deduplication and recovery notices
The notification system should define event deduplication, cooldown periods, and recovery rules. For example, a product that remains out of stock should not generate the same notice on every collection. When it is back in stock, a recovery message can be sent.
Each alert should at least state:
- product and specification;
- current value and comparison baseline;
- triggering rule;
- observation time;
- data source;
- data confidence or a review prompt.
Notification delivery should have its own state so that “an alert was generated” is not mistaken for “the user received it.” When a retry has an uncertain delivery result, the system also has to accept that an external channel may produce duplicate messages.
8. Make continuous operation reliable
The key to always-on operation is not continuous content generation. It is reliable recovery for scheduling, storage, workers, and the notification path.
1. Separate scheduling from execution
The scheduler creates collection tasks, and workers consume them. If collection temporarily slows down, the backlog can be observed without blocking all scheduling.
Sources that fail continuously should be accessed less often or paused so that failing tasks do not crowd out healthy work.
2. Checkpoints and version retention
Requirements confirmation, architecture review, code inspection, and test completion should each save a checkpoint. After a process restart, resume from the latest valid state rather than repeating every step.
External actions such as sending a notification or performing a release cannot be blindly replayed from a checkpoint alone. Operation records and idempotency conditions must also be checked.
3. Monitor business health
In addition to compute resources and process status, watch:
- the time of the most recent successful collection;
- collection success rate and the distribution of parsing failures;
- task backlog size and wait time;
- notification delivery failures;
- agent call count and budget consumption;
- the number of tasks waiting for human review.
A running process does not mean the business is still healthy. If price data has not been updated for a long time, the interface should explicitly mark the data as stale, and alert calculations should avoid treating old data as the current state.
4. Control inference and operating cost
Scheduled collection, rule calculation, and data export usually do not need a model call every time. Models are better suited to requirements understanding, complex analysis, coding assistance, and exception explanation.
Cost can be controlled by narrowing context, reusing confirmed deliverables, and setting call budgets and stop conditions. Do not replace all deterministic logic with a model merely to appear “intelligent.”
9. Security boundaries and human approval cannot be omitted
Agents may simultaneously see external web pages, business messages, code, and execution tools. Malicious instructions embedded in external content can therefore interfere with their judgment.
Collected pages and user-uploaded material should be treated as data to be analyzed, not as trusted system instructions. Content on a page that asks the system to read secrets, change permissions, or send internal files must not be eligible for execution.
Permission design should follow least privilege:
- the research role cannot read production secrets;
- the development role cannot modify production data by default;
- the test role can run verification only in an isolated environment;
- releases require explicit approval;
- notification channels expose only the necessary sending scope.
High-risk actions such as requirement changes, data deletion, privilege escalation, and production releases should retain human approval. A model’s natural-language promise cannot replace access control enforced by the environment.
10. Testing and launch: validate the loop before scaling
Tests should cover normal behavior as well as errors and boundary cases.
Important cases include source timeouts, missing promotion fields, specification changes, a price of zero, unknown stock, duplicate message delivery, repeated execution of a collection task, notification failure, process restart, and malicious instructions embedded in external content.
The agent collaboration itself also needs testing. For example: can the development role incorrectly mark a task as accepted; can an expired requirements version continue to be used; and if one role becomes unavailable, can the other tasks still proceed.
Use a staged implementation path:
- Run one data source first. Validate the price basis, storage structure, and evidence retention.
- Then complete the monitoring loop. Add trends, alerts, deduplication, and export.
- Next connect role collaboration. Use fixed deliverable templates and an acceptance process.
- Finally expand concurrency and continuous operation. Finish failure recovery, permission auditing, and budget control.
Early in production, shadow mode is useful: the system generates alerts but does not send them directly to business users. Human review can observe false positives and missed alerts. After the rules match actual needs, automatic notification can be opened gradually.
Conclusion
The real value of a multi-agent system is breaking complex work into a collaboration process with responsibility boundaries, an evidence chain, and independent verification—not letting multiple roles discuss without limit.
In price monitoring, business results come from a reliable price basis, lawful data acquisition, stable task execution, and traceable alerting. Agents take on requirements analysis, solution design, implementation assistance, and quality checks.
Only by combining model capability with deterministic programs, permission control, state management, and human approval can a one-off automation demo become an engineering system that can run for the long term.
