Work · Applied AI

Merciven: revenue-leakage detection

A live SaaS that reads an SME's own spreadsheets and finds where money is leaking, with an AI layer that can't make up numbers.

Organisation
Merciven (own product)
My role
Founder and lead engineer
When
2024 to present
Stack
React, Vite, Node.js, Express

Problem statement

Nigerian SMEs lose revenue to duplicate receipts, unapproved discounts and under-priced sales, but their records live in messy Excel sheets that no off-the-shelf tool understands.

Objectives & goals

  • Work with the sheets owners already keep
  • Explain findings in plain language
  • Never show a figure the system didn't compute
  • Charge for it with local payments

Process

  1. DiscoverCollected real spreadsheet layouts from SMEs and listed the leaks owners worried about.
  2. DefineTurned each leak into a detection method with the columns it needs.
  3. BuildColumn-role detection, detection methods, a grounded AI narrative, Paystack billing for two products.
  4. ProveA 37-fixture benchmark and 34 HTTP integration tests.

Who it's for

Business owner

Wants to know how much is leaking and where, in naira.

Accountant

Needs to trace every finding back to rows in the sheet.

Challenges

  • Every business names its columns differently
  • LLMs state confident numbers that aren't in the data
  • Uploaded files can carry formulas or prompt-injection text
  • Webhooks and stored tokens must be tamper-proof

What I built

Column-role detection

Maps headers like "Receipt No" or "Disc %" to roles using synonyms and value shape.

Grounding guard

Rejects any AI sentence whose figure isn't a computed result or whose citation doesn't exist.

Untrusted uploads

Formulas neutralised; cell text never treated as instructions.

Security

HMAC webhook verification, AES-256-GCM token encryption and an append-only audit log.

Flow

  1. Upload sheet
  2. Sanitise cells
  3. Detect column roles
  4. Run detection methods
  5. Compute findings
  6. AI explains
  7. Guard checks every figure
  8. Report

Output

Estimated leakage: ₦97,000 across 7 findings.
Invoice INV-1003 recorded twice: ₦51,000 [F1]
25% discount above the 10% policy: ₦10,200 [F2]
25% discount above the 10% policy: ₦10,200 [F3]
15% discount above the 10% policy: ₦3,600 [F4]
Sold below list price: ₦16,000 [F5]
Sold below list price: ₦6,000 [F6]
2 invoice numbers missing from the sequence: ₦0 [F7]
Output of the open-source sample on an invented sales sheet.

Results

91.5%column-role accuracy on 37 fixtures
90%correct method routing
34HTTP integration tests
Soldengineering platform acquired by a private organisation

Tools & languages

  • React
  • Vite
  • Node.js
  • Express
  • Claude tool use
  • Paystack
  • Vercel
  • Railway

The code

Detection methods, column-role detection, formula neutralising and the grounding guard in standard-library Python. 11 tests.

The repository is private. I'm happy to share it with a hiring team or walk you through it on a call.

Request a code walkthrough

Samples are written with synthetic data. No client code or client data is used.