Inspiration

Every company that buys anything creates three documents that are supposed to agree with each other: a purchase order, a receipt, and an invoice. Right now, checking that they actually match is manual, and it's exactly the kind of exception-heavy, rule-plus-judgment work that most "AI does everything" demos skip past. Syndicate's CFO track named invoice processing as a real example workflow, and we wanted to build something that could actually be handed to an AP team, not a toy.

What it does

Matchbook takes a batch of transactions — each with a purchase order, a receiving record, and a vendor invoice — and decides, per transaction, whether to auto-approve it or send it to a human with a plain-English reason. It catches price variances outside a tolerance band, quantity over-billing, missing purchase orders, duplicate invoice numbers, and vendor mismatches. Deterministic logic handles the actual comparisons — that's just math, and it needs to be exactly right every time. Gemini does two things a script can't: it writes the reviewer-facing explanation for each exception, and when you click "Improve agent," it looks at every transaction the agent got wrong against a known-correct answer, and proposes a revised tolerance threshold with its own reasoning — which is what makes it an agent that improves itself, not a static rule engine.

How we built it

Built with Next.js (App Router) and TypeScript, styled with Tailwind, using the Gemini API for exception explanations and the self-improvement pass, with localStorage persisting agent state across sessions.

Challenges we ran into

Getting a single tolerance threshold to behave sensibly was harder than it looked — set it too tight and normal rounding/freight adjustments get wrongly flagged; set it too loose and real overcharges slip through, which is exactly the trade-off the self-improvement loop exists to manage. Getting Gemini to return clean, parseable JSON for the tolerance-tuning step (instead of prose wrapped around it) took some prompt tightening. We also hit a Tailwind version mismatch mid-build — an edit introduced v4 import syntax while the project was still on v3 — which broke both local styling and the Vercel deploy until we traced it back to the actual root cause instead of guessing.

Accomplishments that we're proud of

An agent that doesn't just call an LLM for everything — it draws a real line between deterministic logic (matching, tolerance math) and model judgment (explanations, self-tuning), and can prove its own accuracy against a known-correct answer set rather than asserting it.

What we learned

That accounts payable is a genuinely good testbed for agentic behavior — it has clear ground truth, real exception cases, and a natural human-in-the-loop escalation path, which made "measurable improvement" provable instead of just claimed. We also learned to keep AI out of the parts of a workflow where a deterministic answer already exists, and reserve it for judgment calls and self-correction, where it actually earns its place.

What's next for Matchbook — AP Matching Agent

Real ERP connectors instead of a synthetic dataset, OCR support for scanned/PDF invoices, multi-currency handling, role-based approval routing for larger flagged amounts, and extending the same matching-and-escalation pattern to adjacent CFO workflows like bank reconciliation and close support.

Built With

Share this project:

Updates

Submission history