← Back to case studies
Case study — AI document analysis Proof of concept

AI that reads credit agreements — and shows its work.

A financial law firm assesses client credit agreements by hand — scanned contracts, schedules, annexes and BIK reports. I built a proof of concept that reads a test file in under a minute and traces every extracted number back to the exact page it came from. It is a PoC, not a rolled-out system; its code became the base of Kruczek.

  • 17 of 17 key loan parameters matched a manual read on the test set.

  • 120 of 120 payment-schedule rows passed the arithmetic check.

  • Analysis time per agreement dropped from about 10 minutes to 52 seconds, at roughly 0.05 zł per agreement.

The problem

Assessing one client meant reading a stack of scans by hand: the loan agreement, payment schedules, annexes, a BIK report — mixed formats, mixed scan quality. Pulling out the numbers, reconstructing the schedule and estimating what the client could gain took hours per case and gated how fast an offer went out.

Plain AI wasn't an answer the firm could accept — a lawyer can't put an unverifiable number in front of a client.

What I built

A hybrid OCR (EasyOCR/Tesseract) + LLM pipeline (Gemini) extracts the parameters of a loan with a full audit trail. Each field carries its value, source document, page number, exact text snippet and confidence score, so a human verifies any number in seconds instead of re-reading the file.

The proof of concept was run on 11 test agreements (128 pages). I delivered the client a report from the PoC and an implementation plan with a quote. The AI extracts and checks; a lawyer makes the call.

The documents are sensitive financial data and this PoC calls a cloud model, so a production version needs an anonymisation gate before the model and a data-processing agreement — which is what I then built into Kruczek.

Stack

Python · EasyOCR · Tesseract · Gemini · OCR pipeline

Book a free 30-min call