-
Product website landing page
-
Demo for companies bill payments. Gives a payment a warning and an LLM response explains why as well as provides some possible solutions.
-
Current state of the digital twin
-
14-day cash outlook per account: the expected balance, a range from 200 simulated futures, a worst stress scenario, and minimum reserve line
-
Some example use cases - team purchasing bot, supplier checkout page, and corporate card at point of sale
Inspiration
Fintech has automated most of the money stack:
- Stripe Radar checks every payment for fraud in milliseconds, before it goes through.
- Ramp and Brex automate spend control: card limits, approval chains, budgets.
- QuickBooks tracks bills and pays them on schedule.
- Cash forecasting exists too: QuickBooks' Cash Flow Planner, Ramp (via its Vesto acquisition), Brex's Pry, and Float.
But those forecasts sit in a dashboard someone has to remember to check. They don't approve or block anything. No one runs the check at the moment money moves: can we afford this right now, given everything else that has to happen over the next two weeks?
So a $30k purchase can pass every policy and still leave payroll short four days later, because a big customer paid late and the cash was in the wrong account.
Radar stops fraud before a payment goes through. Buffer stops a cash crunch before a payment goes through.
What it does
Buffer is an API that any spending app calls right before it commits money. It replies in under 100 ms with allow, warn or block, a plain-English explanation written by Claude, and fixes it has already verified.
For example, an employee asks to place a $30,000 supplier order today. Buffer replies:
Warn. If you place this order today and your customer Acme Industrial pays its invoice 3 days late, payroll on Nov 24 will be $23,000 short. Fixes: place the order on Nov 25 instead ($0), or pay today, but first move $23,000 from reserve to operating ($11.50 fee).
Explanations people can trust. Claude Haiku turns the engine's results into a short explanation anyone can act on, with no finance background needed. Every dollar amount and date it writes is checked against the engine's actual numbers before it's shown. If the explanation doesn't match, or the model is slow, Buffer falls back to a template. The LLM explains decisions; it never makes them and never moves money.
The CashGuard engine
Behind the API, the CashGuard engine makes the decision:
- Digital twin. A live model of the company's cash: every account and its minimum reserve, every bill, every expected customer payment (including how late each customer tends to pay), and transfer delays between accounts. It's tracked in exact cents and synced from the bank. In our build that's Capital One's Nessie sandbox.
- Simulation. It replays the next 14 days, day by day, with the proposed payment included, and flags any day an account drops below its reserve or can't cover a bill.
- Adaptive stress search. It hunts for plausible bad weeks: late customers, transfer outages, surprise expenses. At the same budget it found 459 distinct failure scenarios, against 349 for random sampling.
- Robust optimizer. A linear program, solved with HiGHS, finds the cheapest mix of rescheduling and transfers that stays safe in every stress scenario at once. Each fix is then replayed and tested on 100 unseen futures before you see it. If no safe plan exists, the answer is block.
Use cases
| Where it plugs in | What happens |
|---|---|
| Corporate cards (Ramp, Brex) | A charge that would leave payroll short is declined or sent to finance, with the reason. |
| Purchasing bots (Slack, Teams) | Rush order? The bot replies with Buffer's explanation and one-click fixes. |
| Supplier checkouts | "Place order" checks Buffer first; unaffordable orders are stopped inline. |
| Bill pay (AP tools, QuickBooks) | Pick the safe day to pay each bill, or fund it from reserve first. |
| Finance teams | Stress-test the two-week outlook on demand. |
Every app shares one twin, so a purchase committed in Slack changes the card terminal's next answer.
Why companies would use it
- Automatic: a cash check on every payment, in every app, with no spreadsheets.
- Easy to adopt: one REST call, three possible answers, and existing approval flows stay as they are.
- Understandable: a plain-English reason and a ready-made fix, like "not today, but Tuesday works", instead of a bare "denied".
- Safe: audit log, idempotent commits, and bank writes off by default.
How we built it
- Backend: Python and FastAPI with a versioned
/v1API, plus the CashGuard engine: twin, simulator, adaptive search, and a SciPy HiGHS linear program. Data lives in SQLite with an append-only audit log. - LLM layer: Claude Haiku writes grounded explanations, delivered separately so a decision never waits on the model. There's also an optional multi-agent stress-testing mode built with deepagents.
- Bank: a Capital One Nessie connector, plus sandbox execution of approved fixes with reconciliation.
- Frontend: React, TypeScript, Tailwind and Recharts. It includes a product site, a bill-pay demo, and a purchase demo where a Slack-style bot, a checkout and a card terminal all call the same API.
- Evaluation: 11 company scenarios with 200 held-out futures each. Planning against stress scenarios cut reserve breaches from about 37% to about 6%.
- Testing: 162 automated tests.
Challenges we ran into
- Speed. Our first decision with an explanation took 17 seconds. Pre-computing likely payments, caching plans and moving the LLM off the critical path brought decisions down to tens of milliseconds.
- Keeping the LLM honest. Fluent explanations sometimes invented numbers. We now check every figure against the engine's output and fall back to a template on any mismatch.
- Intermittent crashes. The solver crashed the process when its thread exited. One long-lived solver thread fixed it.
- Crying wolf. Early versions warned about wildly unlikely scenarios. Requiring at least 10% plausibility made warnings trustworthy.
- Finding the real story. We realized tools and humans already easily handle existing bills fairly well, so we refocused on stopping new spend before it's committed.
Accomplishments that we're proud of
- Explanations a non-finance employee can act on, with every number verified.
- One API serving cards, chat, checkout and bill pay, all sharing one live view of the company's cash.
- Every fix shown has been replayed and stress-tested, with decisions in under 100 ms.
- An honest benchmark that reports every result, including the ones that don't flatter us.
What we learned
- Cash crunches are timing problems. Each payment looks fine; the danger is how they line up.
- People don't want "denied". They want to know why and what to do instead, and a well-grounded LLM is the right tool for the "why".
- Let each part do what it's good at: the optimizer guarantees correctness, and the LLM makes it understandable.
What's next for Buffer
- Connectors for Ramp, Brex, Stripe and QuickBooks, plus their existing forecasts as inputs to the twin.
- Conversational follow-ups: ask Buffer "what if I wait a week?" or "which bill should move instead?" and get grounded answers.
- Drop-in widgets and webhooks for any checkout or purchasing tool.
- Learning from real history: calibrate customer delays and surprise expenses from each company's own transactions.
- Early-payment discounts and late penalties, and multi-company support.
Built With
- claude
- deepagents
- fastapi
- langchain
- nessie
- sqlite