Tech Arch

Enterprise AI Solution

Chargeback Decision Engine

Retailers claw money back from suppliers with free-text deduction notices — every retailer in a different format, every claim only their side of the story. Deciding whether to fight each one is judgment-shaped, high-volume work where a wrong call in either direction costs real money. This engine makes that call — and shows its evidence.

The core idea: the LLM extracts — deterministic code decides

A model reads the free-text notice and turns it into structured facts under a strict quote-or-null contract — the exact source text, or null, never a plausible guess. Then a deterministic engine renders the verdict by reconciling those facts against the company's own records: ERP purchase orders and invoices, and the signed Bill of Lading — the carrier-signed shipping document proving what physically left the dock and when. The money decision is reproducible, auditable, and identical with or without a model in the loop.

DISPUTE

The records contradict the claim — the Bill of Lading shows shipped quantity meets billed, proof of delivery signed. Fight it, with the evidence attached.

ACCEPT

The records support the claim — a genuine shortfall or late shipment. Don't spend money fighting a deduction you'd lose.

ESCALATE

Missing documents, unmatched orders, contradictory records → route to a human with the reason recorded. Refusing to guess is a feature.

Every verdict cites machine-checked evidence

Each decision names the exact records it rests on — invoice quantities, Bill of Lading ship dates and quantities, proof-of-delivery status — and an automated harness verifies that every cited fact exists in the named source with the exact value. Fabricated evidence fails the eval before it ever ships.

{
  "claim_type": "SHORTAGE",
  "verdict": "DISPUTE",
  "rationale": "PO was billed 1,440 units; the signed shipping record shows 1,440 shipped...",
  "evidence_cited": [
    { "source": "erp:invoices:INV-70210",    "field": "billed_qty",  "value": 1440 },
    { "source": "bill_of_lading:BOL-44120", "field": "shipped_qty", "value": 1440 },
    { "source": "bill_of_lading:BOL-44120", "field": "pod_signed",  "value": true }
  ]
}

Verified behavior

10/10

on an adversarial eval

Labeled cases plus synthetic edge cases built for the paths samples never show: missing documents, unsigned proof of delivery, internal record contradictions, decoy records.

0 keys

required to run

With no API key, a deterministic extractor takes over and the pipeline runs end to end — the verdict logic never depends on a model being available.

100%

reproducible verdicts

Same claim, same records, same verdict — every time. Because the decision is code, not a model's mood.

Python (stdlib decision core) Claude — extraction only SQLite ERP integration Bill of Lading matching Executable eval harness Quote-or-null extraction

System design

One claim in, one auditable verdict out. The model touches exactly one stage — extraction — and even that stage has a deterministic fallback. Everything that decides money is plain code.

Deduction notice free text — any retailer, any format Extractor LLM · quote-or-null contract exact source text or null no key? → regex fallback Structured claim type · PO · quantities dates · case id ERP records purchase orders · invoices Bills of Lading shipped qty · ship date · POD Escalation gate missing BOL? unmatched PO? contradictions? ESCALATE to a human, reason recorded Deterministic rules SHORTAGE: shipped vs billed LATE: ship date vs required pure code — no model VERDICT dispute / accept + cited evidence can't settle records suffice Eval harness wraps the whole pipeline: labeled + synthetic adversarial cases · verdict, claim type, and every cited fact machine-verified against its source · 10/10

Deductions are one instance of a pattern.

Claims, audits, compliance checks, document-driven approvals — anywhere free-text arrives and an auditable yes/no/escalate must leave, this architecture applies.

Start a conversation →