1. Aggregator rating drop → root-cause across four evidence streams (supervisor + 3 specialists)
Today: the brand owner has the aggregator partner dashboard open in six tabs — one per outlet — scrolling reviews on a phone at 11pm and copying the bad ones into a WhatsApp note. The account manager's advice is 'improve quality and packaging'. The order-timing export is a CSV nobody opens because it's 40 columns wide, the menu change log is whatever the ops WhatsApp group remembers, and the packaging switch three weeks ago has already been forgotten. So the fortnight's rating slide gets diagnosed by vibes, and the fix is usually 'tell the kitchen to be careful'.
Trigger: Webhook (scheduled rating/review pull from the aggregator partner portal)
How the workflow runs
- Trigger
Rating window closes. A scheduled Webhook delivers the review and rating export plus the order-timing export for the period. The aggregator partner portal has no first-party connector — data arrives via Webhook and is read back via a Tool (MCP) node.
- Supervisor
Supervisor frames the question. A Supervisor node scopes the investigation to the brand, the outlet and the window, then delegates the SAME period to three specialists so their findings are directly comparable rather than each analysing a different slice.
- Parallel
Three specialists, same window. A Parallel node runs the review-text specialist, the timing specialist and the menu/change-log specialist concurrently — one wall-clock pass instead of three sequential ones, and none of them can see the others' evidence.
- Agent
Review-text specialist. Reads only the free-text reviews and low-star comments for the window, extracting recurring complaint themes with verbatim quotes and counts — food, packaging/spill, missing item, portion, temperature. It is blind to timing data by design.
- Agent
Timing specialist. Reads only the order-timing export — accept-to-ready, ready-to-pickup, pickup-to-delivery — and reports which leg moved during the window and on which day-parts. It never sees a review, so it cannot be led into agreeing with one.
- Agent
Menu & change specialist. Reads only the menu, price and packaging change log (via a Tool (MCP) node) and returns the dated timeline any proposed cause has to line up with. If the packaging switch post-dates the decline, this is what catches it.
- Agent
Synthesis: one ranked cause list. A synthesis agent correlates the three streams into ranked hypotheses, each stated with the evidence it rests on, explicitly labelled correlation, capped at LOW confidence when only one stream supports it — and each with the test that would confirm or kill it.
- Approval
Owner approves any action. An Approval node holds every action the report implies — re-listing or delisting an item, a price or portion change, a packaging switch, a prep-time commitment change on the aggregator. The report is free; the actions are human.
Channels & connectors
- Webhook
- Slack
- Tool (MCP → aggregator partner portal / menu + change log)
- Knowledge base
- Approval / HITL
Outcome
A rating slide becomes a ranked, evidence-cited cause list within one run — six dashboard tabs and a WhatsApp note replaced by one report — with the actions it implies queued for the owner rather than executed.
Why it helps
The mechanism is stream isolation: each specialist sees only its own evidence, so the timing analysis cannot be talked into agreeing with the review themes. The synthesis then has to show where INDEPENDENT streams line up, which is what separates a real cause from a plausible story — and the change-log timeline is what stops a fix being aimed at something that happened after the decline started.
Build spec
4 agents — 1 supervisor-scoped synthesis agent + 3 evidence specialists (review text / timing / menu-and-change log). The Parallel fan-out, the reportability threshold (a SpEL tool) and the action Approval are workflow nodes. · Pattern: Supervisor → parallel specialists on isolated evidence streams → synthesis → human-approved actions
System prompt (paste-ready)
(Synthesis) You are investigating a rating decline for {{brand}} at {{outlet}} over {{window}}. You receive three INDEPENDENT specialist reports (review themes with counts and quotes; order-timing leg movements by day-part; the menu/price/packaging change log). Produce a ranked list of at most 5 hypotheses. For each: {hypothesis, supporting_evidence[] (cite the specialist and the exact figure or quote), contradicting_evidence[], confidence (LOW|MED|HIGH), confirming_test}. RULES: (a) label every relationship as correlation, never causation; (b) a hypothesis supported by only ONE stream is capped at LOW confidence; (c) if a change in the change log post-dates the decline, say so and drop it; (d) never invent a percentage, a rating delta or a count that a specialist did not report; (e) propose actions as RECOMMENDATIONS ONLY — delisting an item, changing a price or portion, switching packaging and changing the committed prep time all require human approval.Agent roles & model tiers
Review-text specialist — Economy tier — volume work (every review in the window) and the task is theme extraction with quotes, not judgement
Read ONLY the free-text reviews for the window. Return recurring themes with exact counts and verbatim supporting quotes, keeping only those the `theme_threshold` tool marks REPORTABLE. No causes, no recommendations, no reading of timing data.
Timing specialist — Economy tier — bounded arithmetic over an export; deliberately blind to review text so it cannot be led
Read ONLY the order-timing export. Report which leg (accept→ready, ready→pickup, pickup→delivery) moved during the window, by day-part, with real figures. State 'no material movement' when that is what the data shows.
Menu & change-log specialist — Economy tier — a small, factual timeline extraction
Read ONLY the menu/price/packaging change log. Return a dated timeline of what changed. Do not speculate about effects; the timeline is the deliverable.
Synthesis (once per investigation) — Premium tier — the single hard step: correlating three independent streams, resisting the obvious story, and being explicit about what would disprove each hypothesis. One call per investigation, so the cost is bounded; a standard-tier fallback model is configured so an outage delays the report rather than losing the run.
Correlate the three specialist reports into at most 5 ranked hypotheses with cited evidence, contradicting evidence, a LOW-confidence cap for single-stream support, and a confirming test for each. Correlation language only. Recommendations, never actions.
MCP connectors
- Aggregator partner portal — reviews/ratings export inbound via Webhook; via Tool (MCP): fetch reviews, star distribution and the order-timing export for the brand/outlet/window (no first-party connector)
- Menu / price / packaging change log — via Tool (MCP): list dated menu, price and packaging changes for the outlet in the window
- Email / Slack — where the ranked cause report lands
Built-in tools
- knowledge_search (scoped collection: brand standards, packaging spec, committed prep times per brand)
- http_request (pull reviews, timings and the change log for the window)
- user-defined tool `theme_threshold` (SpEL): input.mentions >= input.minOccurrences ? 'REPORTABLE' : 'INSUFFICIENT' — a sandboxed expression the brand owner tunes per outlet, so a small outlet isn't held to a big outlet's evidence bar and nobody has to argue about it in a meeting
- web_search (optional: check whether a rating dip coincides with a publicly reported aggregator-wide outage or city-wide delivery disruption, so an external cause isn't misattributed to the kitchen)
- send_email (the ranked cause report to the brand owner and kitchen operator)
Guardrails
- Every action the report implies — delist/re-list an item, change a price or portion, switch packaging, change the committed prep time — passes the Approval node; the workflow ships a report, not a change
- Specialists are evidence-isolated by design: the timing specialist never sees review text and vice versa, so agreement between streams is real rather than induced
- A hypothesis supported by a single stream is capped at LOW confidence, and every relationship is stated as correlation with a named confirming test
- Theme reportability is decided by the tenant's SpEL threshold, not by the model deciding what feels significant
- No invented ratings, deltas or counts — the synthesis may only cite figures a specialist actually reported
- Reviews are customer content: quotes are carried verbatim for evidence and never rewritten to make a point
Cost strategy
Three economy specialists (the volume readers) plus ONE premium synthesis per investigation — cheap where the work is reading, expensive exactly once where the work is thinking. The Parallel node cuts wall-clock without changing spend. This runs per brand per window, not per order, so absolute cost is small; do not upgrade the specialists, because a premium model reading reviews adds cost proportional to review volume and buys nothing the synthesis doesn't already do.
Output & delivery
The supervisor scopes brand/outlet/window → three evidence-isolated specialists run in Parallel, with theme reportability gated by the tenant's SpEL threshold → the premium synthesis returns at most five ranked hypotheses, each with cited evidence, contradicting evidence and a confirming test → the report goes to the owner on Email/Slack, and every action it recommends waits at the Approval node.