MarginChef — AI Agent That Finds a Restaurant's Margin Leaks
Problem
Restaurants run on 3-5% net margins while food costs are up roughly 35% since 2019, and most owners never see per-dish economics. The leaks — a bestseller that bleeds, a price that never moved when its ingredients did — hide inside a POS export nobody reads.
Business Impact
An independent restaurant losing two points of margin to unrepriced dishes is losing real money every month it goes unnoticed. MarginChef converts a POS export into a ranked list of fixes with a rupee or dollar figure attached to each — the difference between knowing food costs are up and knowing which three dishes to reprice on Monday.
System Approach
- Plate costing: recipe times current ingredient prices gives true cost per dish
- Five leak detectors, each with an explicit monthly impact formula in leaks.py
- Menu engineering quadrants from popularity against margin
- Reprice suggestions snapped to .49 or .99 price points, capped at +15%, with projected monthly gain
- Local LLM writes a five-move action plan ranked by money at stake, with rule-based fallback
- CLI with analyze, report (shareable HTML), prices, and ask subcommands
Key Decisions & Trade-offs
- One leak per dish — overlapping detectors share a root cause, so the monthly total stays honest
- Keyless local LLM over a cloud API; a restaurant's cost sheet is not third-party data
- Rule-based fallback so a missing Ollama degrades the answer instead of breaking the tool
- Cap reprices at +15% and snap to familiar price points — advice a kitchen will actually run
- Plain CSVs as the interface so any POS export works without an integration
Current Status
Public and open source (MIT) at v0.2.0, installable with pip install -e . and runnable against the bundled sample_data in one command. All five detectors, menu quadrants, reprice suggestions, HTML report, and the ask subcommand ship working; pytest suite green.
Roadmap
- Direct POS connectors so the CSV step disappears
- Multi-period trend view to catch slow cost drift
- Supplier substitution suggestions for the worst-offending ingredients
What I'd Improve Next
- Currency and tax handling for multi-region kitchens
- A small web UI for owners who will not open a terminal
Explore More
- Quorum — Deep-Research Agent Swarm with a Shared GraphRAG Brain — Most AI research tools are one model in a loop.
- RegexForge — Plain English to a Regex You Can Trust — Regex is not hard because the syntax is exotic.
- Skillet — Turn Any Docs Page Into an Installable Claude Code Skill — Agent skills are the fastest way to teach a coding agent a new tool, but writing a good SKILL.
- Ladle — Open-Source Prep Forecasting and Food-Cost Leak Detection — Restaurants throw away 4-10% of the food they buy before it reaches a plate, and most owners find out at month end from a food-cost percentage that moved the wrong way, with no idea which ingredient did it.
- All 47 projects — the full catalogue, with live links and repos.