Revenue Leakage Defender· Open-source prototype
Upload a supplier invoice and its framework contract. You get every discrepancy and a draft dispute email.
Checking every supplier invoice against its framework contract by hand takes too long, so teams check a sample. Rate errors, wrong line totals and non-compliant payment terms slip through as overbilling.
Customer: me. I wanted to see how far GenAI can go in a sales and finance workflow before a human has to step in.
PDFs are parsed in memory. An unreadable file goes straight to the report instead of being guessed at.
Two LLM calls run in parallel and return structured data, validated against Pydantic schemas.
Line totals, VAT, rate caps, payment terms and validity are checked in plain Python with exact decimals. Every amount must appear in the PDF text.
When the invoice breaks a contract term, the LLM weighs whether a clause justifies it. Arithmetic errors never go to the LLM.
Each invoice ends in one of three outcomes: approved, discrepancies found or review required. A dispute email is drafted for a person to review and send.
Uploaded PDFs are read in memory only.
Incomplete or unverifiable data means review required, never approved.
The dispute email is a read-only draft. A person reviews it before anything is sent.
One provider interface: Gemini, a mock for tests, or another model through environment variables.
Live progress for each pipeline step in the UI, plus LangSmith tracing.
51 tests that need no real LLM. Fake models cover the worst cases: one justifies every charge, one times out, one invents amounts.
Runs locally today. The design maps onto AWS: API Gateway and Lambda, Bedrock, S3, DynamoDB and SES.