The Problem: Intelligence Teams Restaurant Owners Can't Afford
The US has over 500,000 independent restaurants. The National Restaurant Association reports the industry employs 14.2 million people and accounts for $1.1 trillion in annual sales.[1]
But independent operators — the pizza shops, the family-run diners — are closing at an accelerating rate. In 2025, independent restaurant closures exceeded openings for the third consecutive year.[2] The margin pressure is relentless: food costs, labor, rent, delivery platform fees.
What's missing: large restaurant chains have revenue management teams. They have analysts running weekly promotion analyses, comparing competitor pricing, tracking ingredient cost fluctuations, optimizing staffing by shift. A Domino's franchise benefits from a national intelligence infrastructure that a local pizza shop will never have access to.[3]
The question Mise asks: can a small AI system — running nightly on real data — provide something close to that intelligence layer for an operator who can't afford the team?
The Architecture: Four Agents, One Supervisor
Before describing what the agents do, it's worth explaining why multi-agent instead of one big prompt.
The single-prompt failure mode. Feeding raw HTML, invoices, POS data, and census reports into a single LLM prompt creates three problems: debugging is impossible (you can't isolate which data caused a bad output), cascading failures (if web scraping times out, the whole generation fails), and bloated context (raw data with no preprocessing wastes tokens on irrelevant content).
The solution: specialized agents that each preprocess their domain into structured summaries, then a supervisor that synthesizes. Each agent can fail independently without collapsing the entire run. Each agent's output is inspectable in isolation.
Each agent is implemented as a LangGraph state machine[4] — a directed graph where nodes are processing steps and edges are conditional transitions. The competitor scanner, for example, follows the path: find_competitors → scrape_ubereats (parallel) → scrape_doordash (parallel) → compile_results. Parallel execution means both platforms are scraped simultaneously. Graceful degradation means that if one scrape fails, the agent returns partial data rather than nothing. Anthropic's guidance on building effective agents informed this design: discrete, composable, independently testable steps.[5]
Agentic Scraping: Natural Language Instead of CSS Selectors
UberEats and DoorDash are JavaScript-heavy single-page applications. The traditional approach requires a headless browser with stealth patches, platform-specific CSS selectors that break on every redesign, and per-platform maintenance. For monitoring 10–15 competitors across two platforms, that's a full-time maintenance job.
The agentic alternative: TinyFish accepts a natural language goal and navigates like a human. No selectors. No DOM parsing. When a platform redesigns, the instruction still works because it describes the goal, not the DOM path to get there.
The location verification step is critical. Searching "Tony's Pizza" on UberEats returns results from multiple cities. Without an explicit verification step in the prompt, you'd end up comparing your restaurant against a competitor 400 miles away. Build verification into the prompt, not into post-processing.
A typical scan launches 28 TinyFish browser sessions in parallel (14 competitors × 2 platforms). Completion time: 2–4 minutes. Cost: approximately $0.02/session, or $0.56 per full competitive scan. The cost is higher than brittle selector-based scraping — but so is the robustness. A selector-based scraper that fails silently and returns stale data has a much higher real cost.
The Learning System
Three mechanisms work together to make the system incrementally smarter with every operator interaction.
5a. Temporal Memory Decay
Every accepted or rejected recommendation outcome gets written to a memory store keyed by recommendation type, context tags, and restaurant metadata. Before each new synthesis run, the supervisor retrieves relevant memories and uses them to inform ranking and framing. But here's the key design decision: old memories decay.
The decay function is simple:
| Age | Effective Confidence |
|---|---|
| 1 day | 97% |
| 7 days | 81% |
| 30 days | 40% |
| 90 days | 6% |
The 0.97 daily rate yields approximately a 30-day half-life. Restaurant patterns are seasonal and local. Summer promotions behave differently in winter. Without decay, a successful July BOGO dominates recommendations in December. With too aggressive a decay, the system forgets too fast to learn. 30 days felt right for business intelligence — recent enough to matter, long enough to accumulate signal. Note that confirmed patterns reset confidence to 1.0, giving the system a mechanism to anchor well-validated knowledge.
5b. Agent Reliability Scoring
Each agent maintains a numeric trust score starting at 100.0. When a recommendation is marked accurate by the operator, the agents whose data contributed receive +10 to +25 points, scaled by estimated revenue impact. When marked inaccurate, each contributing agent loses 5 to 10 points.
| Agent | Starting Score | After 30 Days (example) |
|---|---|---|
| competitor_scanner | 100.0 | 128.0 |
| demographic_agent | 100.0 | 91.0 |
| vendor_intel | 100.0 | 115.0 |
| customer_intel | 100.0 | 106.0 |
The supervisor weights data from higher-scoring agents more heavily in synthesis. This is a simple form of multi-agent credit assignment. Agents that consistently contribute to accurate recommendations score higher over time — and their data carries more weight in the next synthesis cycle. Agents providing consistently wrong signal are down-weighted automatically, without requiring explicit configuration.
5c. Preference Learning
User rejections are stored as persistent preferences — not subject to decay. If the owner rejects a discount recommendation twice, the system records this as a hard constraint and injects it into every future synthesis prompt:
This prevents the most frustrating failure mode of AI assistants: repeatedly suggesting things the user has already said no to. Unlike outcome memories, preferences don't decay — they stay until explicitly changed. The operator has full visibility into stored preferences and can clear or modify them at any time.
Closing the Feedback Loop: Auto-Measurement
Memory is only useful if outcomes are measured. The feedback loop has four steps:
Baseline capture. When a recommendation is accepted, the system records the last 7 days of POS revenue as the baseline. This snapshot is timestamped and associated with the specific recommendation.
Continuous monitoring. Every 24 hours, a background task pulls fresh Clover POS data and compares rolling revenue against the baseline.[6] The comparison is surfaced in the operator dashboard as a simple trend line.
Anomaly detection. If rolling revenue drops more than 10% for two or more consecutive days, the system fires an early warning. Not a judgment — an early warning. The system does not declare that the recommendation caused the drop.
Human-in-the-loop outcome marking. The system never auto-declares success or failure. The operator decides when they have enough signal and marks the outcome. Revenue is noisy: a bad storm tanks sales regardless of promotions. A competitor closing temporarily spikes revenue. Only the operator has the context to attribute causation. The system provides data; the human provides judgment.
Evaluation: How We Test an AI That Doesn't Return the Same Output Twice
You can't unit test an LLM. Outputs vary. Quality is subjective. A recommendation can be grammatically correct, factually grounded, and still completely wrong for the specific operator context it's meant to serve.
The eval system uses four levels: deterministic data validation, structural output checks, LLM-as-judge scoring on specificity and grounding dimensions, and regression testing against a set of golden reference outputs. The key result from the first two weeks: a prompt change dropped our quality score from 2.4 to 1.8 on the LLM-as-judge eval. We caught it in 5 seconds. Without a systematic eval harness, that degradation would have shipped undetected.
The full eval suite runs in approximately 5 seconds at a cost under $0.08, using Claude Haiku as the judge model. The evaluation methodology deserves its own post — a companion piece covering the full framework is in progress.
→ Companion post: Evaluating LLM Outputs Without Ground TruthTechnical Decisions
SQLite over Postgres
Each service maintains its own SQLite database file. No shared state, no migration coordination, no Docker orchestration for local development. For a single-operator system, simplicity is a feature. Isolated temp databases for evals spin up in milliseconds — that matters when the eval suite needs to run 100 times a day during active development.
SSE for Real-Time Progress
Competitor scans launch 28 browser sessions in parallel. The frontend receives Server-Sent Events streaming progress updates as each competitor completes. No polling, no WebSocket complexity. Single HTTP connection, chunked responses. Every competitor card in the UI updates in real time as data arrives.
Claude Primary, GPT-4o Fallback
The supervisor uses Claude Sonnet 4.6 as primary with automatic fallback to GPT-4o on error or timeout. The operator never sees a failure — the fallback is fully transparent. The LLM-as-judge eval uses Claude Haiku: $0.80/1M input tokens versus $3.00/1M for Sonnet. The grading task is narrow and well-defined; the cheaper model is appropriate and well-validated for it.[5]
LangGraph for Orchestration
LangGraph provides built-in parallel node execution and conditional edges without requiring custom orchestration logic.[4] The state machine model maps naturally onto the agent pipeline: each processing step is a node, each transition condition is an edge. State is explicit and inspectable at every step, which makes debugging possible in a way that monolithic prompt chains are not.
The System in Numbers
What's Next
Four enhancements are in progress for the next build cycle:
- Automatic outcome inference. Statistical methods to detect recommendation impact directly from POS data, reducing reliance on manual outcome marking. The current blocker: POS revenue is noisy enough that confident causal inference requires more data than a single-operator deployment generates in a reasonable window.
- A/B recommendation testing. Generate two recommendation variants, randomly assign which gets shown, and measure which performs better over time. Requires enough operator volume to generate meaningful signal per variant.
- Cross-operator learning. Anonymized patterns from one deployment informing others — "Tuesday BOGO deals work for 73% of similar restaurants in college towns." Requires strict privacy boundaries and a minimum operator count to be meaningful rather than misleading.
- Multi-vertical expansion. The supervisor architecture is domain-agnostic. The agents are domain-specific. Swapping in a set of agents for a different vertical (retail, fitness, services) is a configuration change, not a rewrite. The memory, scoring, and eval infrastructure transfers unchanged.
The Takeaway
Building AI systems that actually learn from their outputs is harder than building static prompt pipelines. You need measurement infrastructure, memory systems, decay mechanisms, and eval harnesses — none of which are visible to the user.
The payoff is a system that remembers what worked, forgets what didn't, holds its data sources accountable, and gates quality before every deploy. Two weeks in, the architecture is working. Evals passing. Learning loop closing. Every run is incrementally smarter than the last.
The fundamental question — whether a small AI system running nightly can provide something close to an enterprise intelligence layer for a local restaurant — remains open. The architecture is credible. The next step is operator feedback on real deployments.
References
[1] National Restaurant Association. "2025 State of the Restaurant Industry." restaurant.org
[2] Datassential. "Restaurant Failure Rate Report 2025." datassential.com
[3] Restroworks. "Restaurant Technology Industry Statistics." restroworks.com
[4] LangChain Blog. "LangGraph: Multi-Agent Workflows." blog.langchain.dev
[5] Anthropic Engineering. "Building Effective Agents." anthropic.com
[6] Databricks. "Real-Time Point-of-Sale Analytics with a Data Lakehouse." databricks.com