Inspiration
I talked to a few small restaurant owners, near Princeton and in Parsippany. Playa Bowls told me the same thing almost every delivery-heavy restaurant says once you ask: DoorDash and Uber Eats refund customers for "missing item" claims instantly, no proof needed, then pull that amount straight from the restaurant's next payout. The owner finds out days later, buried in a report. I heard a similar story secondhand from a relative who runs a restaurant in Montclair, and that's why one of my demo samples, built on fully synthetic data, is modeled on a restaurant like that. A franchisee I read about disputes around $500 a month per location and usually wins. An independent restaurant has no finance team to do that. So most of them just eat the loss, week after week.
The fraud isn't really the problem. Nobody fighting it because nobody has the time is the problem. That's what I built Reclaim to close.
What it does
Reclaim reads a restaurant's weekly payout CSV and finds every refund deduction tied to a "missing item" or "wrong item" claim. For each one, it checks the order ticket against the claim, checks pickup timestamps, and checks whether the same customer has filed repeat claims. It ranks cases by what's actually worth fighting, drafts a short, factual dispute for the strong ones, and waits.
Nothing gets sent without the owner's approval. Once approved, Reclaim prepares a filing packet: the dispute text, the correct merchant portal link, and the deadline. Neither platform offers a public API to file a dispute automatically, so the owner submits it themselves and records whether it won or lost. That outcome feeds back into memory. The next run's scoring explains itself: "starting win rate raised from 55% to 60% because 2 of 3 past missing-item disputes won."
How we built it
Reclaim runs on LangChain's Deep Agents, on top of LangGraph. An orchestrator agent plans with a visible to-do list and hands work off to two subagents: an evidence subagent that investigates one case at a time in its own clean context, and a dispute-writer subagent that drafts the dispute and can only cite evidence that actually supports the restaurant. The orchestrator gets paused by a framework-level interrupt on the one tool that would file a dispute. Approval isn't a prompt instruction here, the graph itself enforces it.
Anything touching money, dates, or scoring is plain, tested Python, not the model's guess. The model only reasons about evidence and wording. Outcomes persist to SQLite and a lessons file the agent reads on every run, and the whole demo replays offline from a cache of real recorded model runs, so it still works without a live API call.
Challenges we ran into
The hardest bug wasn't in the agent logic. It was in my own assumptions. I had a ticket listing the claimed item scored as proof against a "missing item" claim, but a ticket only proves the item was ordered, not that it was packed into the bag. For a "wrong item" claim, that same evidence is genuinely strong, since it shows the kitchen made the right thing. I had to split the scoring rule by claim type and add a hard check so the dispute-writer can't cite non-supporting evidence as support anymore. Not a polite instruction asking it to avoid that. A rule it can't get past.
Cost was the other real problem, and it caught me off guard. One run of my own test harness burned 576,337 input tokens. I assumed Deep Agents handled prompt caching automatically, and it does, but only for a raw ChatAnthropic instance. I'd wrapped the model in my own class to support offline replay, and that wrapper didn't match the check Deep Agents uses to decide whether to attach cache headers. So every call was resending the full system prompt and the growing conversation history from scratch, no caching at all.
I fixed it by hand, adding cache_control breakpoints on the system prompt and the history myself, inside my wrapper, instead of relying on the framework to detect it. Checking the fix turned up a second bug underneath the first. The Anthropic API reports cache writes under keys like ephemeral_5m_input_tokens, not under cache_creation like I expected, so my usage counter had been silently reading zero the whole time. Once I fixed the counter and reran it live, 89.6% of that run's input came back as cache reads instead of full-price tokens. I also noticed my max_tokens cap was set to 2048 when the longest real response I'd ever seen was 889 tokens, so I dropped the default to 1200 with an environment override for anyone who needs more.
Both fixes meant re-recording parts of my offline demo cache under real time pressure, without breaking the eight sample paths I'd already tested and verified worked with the network blocked.
Accomplishments that we're proud of
I built this solo. It has 241 backend tests, including edge cases I went looking for on purpose: malformed CSVs, expired deadlines, a server killed mid-run, two processes writing memory at the same time, a code edit that restarts the agent cleanly mid-demo instead of corrupting it. The offline demo replays all 8 sample paths with the network blocked.
What I'm proudest of is the honesty built into the product. The UI says "estimates, not guarantees." It never hides that filing is manual. When I found my own scoring bug, I fixed the rule instead of covering up the symptom, and I built the fix as a real constraint in the code, not a request I hoped the model would follow.
What we learned
A framework handing you planning and subagents for free isn't the same as understanding what it's doing underneath. I only caught the caching bug because I went and looked at the raw token numbers instead of trusting that caching just works by default.
I also learned the honest version of a product tends to land better than the impressive-sounding one.
What's next for ReClaim
Auto-detecting whether a filed dispute actually won, by matching credits in the next payout CSV, instead of the owner entering it by hand. Accepting a photo or PDF of a payout report, not just a CSV. A live text-approval channel, so an owner can approve a dispute by replying to a text instead of opening the app. And a subagent that flags a customer filing repeat claims across cases, a signal independent restaurants have no way to see today.
Built With
- anthropic-claude
- caching
- claude-api
- deepagents
- fastapi
- langchain
- langgraph
- langsmith
- next.js
- prompt
- pydantic
- pytest
- python
- react
- sqlite
- typescript