Discrepancy

Checks the paperwork a bank receives when it pays for goods under a letter of credit, a common way to pay in international trade, and decides whether the documents can be accepted or must be refused.

When a business buys goods from another country, its bank often promises to pay the seller once the seller hands over the right paperwork: an invoice, a bill of lading from the shipping company, and so on. That promise is called a letter of credit. Before the bank pays, someone has to check that every document agrees with the others and with the terms of the credit.

This checking is slow, specialist work, and the deadline is strict. If the documents are wrong, the bank has five banking days to refuse them, in a single notice that lists every problem. Miss the deadline and it loses the right to refuse; leave a problem off the notice and it cannot add it later. Discrepancy does the checking, drafts the notice and keeps track of the deadline.

What is finished and what is not

The checking, the refusal notice, the deadline and the record it keeps are complete and heavily tested. The part that reads the documents is a simple stand-in that only handles clean PDFs this project generated itself. So this is a working demonstration of how to build a tool like this, not something ready for real paperwork. The sections below say exactly what has and has not been shown.

What it does

It is built to help a bank's document checkers. You give it the terms of the credit and the documents that were presented, and it:

Here is a notice it drafted for one of its test cases:

NOTICE OF REFUSAL
Credit: LC-EC-002
Presentation: EC-002
Date of presentation: 2026-09-07
Date of this notice: 2026-09-09
Examination period expires: 2026-09-14 (UCP 600 art. 14(b))

We refuse to honour or negotiate.

We are holding the documents pending your further instructions. [UCP 600 art. 16(c)(iii)(a), MT734 77B/HOLD]

The discrepancies are, in full (2):
1. bill of lading, port of discharge: shows 'Singapore'; the credit requires 'Port Klang'. [UCP 600 art. 14(d)]
2. bill of lading, goods claims: shows 'colour: red'; the commercial invoice shows goods claims 'colour: green'. [UCP 600 art. 14(d)]

SCOPE OF EXAMINATION
Examined against UCP 600 art. 14(d) using rule model 0.7.0.
Exactly what the code produces for test case EC-002 after the port on the bill of lading is changed to Singapore. The references in square brackets name the rule behind each line. A test regenerates this notice on every build and checks it still matches, so the example stays true to the real output. You can produce it yourself on the demo page.

Why it is built this way

A bank has to be able to defend a refusal, sometimes in a formal dispute. So the aim was not only to get the answer right, but to make every answer easy to check.

Why letters of credit

Many demos of software that reads documents pick a task with no clear right answer, which makes them hard to test. Letters of credit (also called documentary credits) have unusually solid ground truth:

How well it works

It was tested on 20 cases, each based on a published dispute, using made-up documents. The table covers the fourteen used during development; the other six were held back as a separate test.

What it read Cases right Problems found Score if it found nothing
The case data, read directly14 / 147 / 77 / 14
A generated PDF, labels above values13 / 146 / 77 / 14
A generated PDF, label and value on one line13 / 146 / 77 / 14
A generated PDF, a printed form with no labels7 / 140 / 77 / 14

Half of the fourteen cases have nothing wrong with them, so a checker that found nothing at all would still get 7 right. That is the last column, and it is why the problems-found column matters more. Reading the case data directly, it finds all 7 problems. Reading the generated PDFs, it finds 6: the one it misses is a changed model number, printed under a heading the reader does not recognise.

On the printed form with no labels, it cannot tell which value is which. It places no fields, flags the documents for a person to review, and does not report them as clean. That is the right behaviour, and it scores the same as finding nothing.

What the PDF results do not show

The PDFs were drawn by this project, and the reader was built to recognise the labels they use. It finds each field by looking for known label words, and not one of the 20 keyword groups it uses contains a word that the generated documents do not already use. So these rows show that the reader works on clean documents of the kind it was built with. They do not show that it can read paperwork written by someone else.

What it does not do yet

How it was checked

Besides several hundred automated tests, a separate AI agent reviewed the latest changes eight times during the build and tried to find what was wrong. Between them, the eight reviewer passes found 97 defects, all in code that was passing its tests at the time. The counts per pass were 11, 12, 8, 11, 13, 5, 8 and 29. The last of them reviewed this website and the demo before they went live.

What is real and what is made up

Try it

The demo page runs the real checker. Pick a test case, change a value on one of the documents so it no longer matches the credit, and press Check documents. You can also have it read a generated PDF instead of the raw data, give it the form with no labels and watch it hand the case to a person, move the notice date past the deadline, or alter one entry in the record and watch the check catch it.

If you do this work for a living and something here is wrong, I would like to know which part.