How it works
From a file in the inbox to checked, searchable data, in six automatic steps. A person only looks at what the system is unsure about.
Check the file
The real type is read from the file's first bytes. Renamed, empty, damaged and locked files are stopped with a clear reason.
Read every page
Text PDFs are read directly. Scans and photos are straightened, cleaned and read with OCR. Every Excel sheet is read.
Find each invoice
A 1,000-page PDF is split into separate invoices by their numbers and page markers like “Page 2 of 3”.
Extract with AI
A language model fills a fixed JSON form and must quote where each value came from. Hard-to-read pages are read from the image.
Prove and check
Code checks every quote is really in the document; unproven values are removed. Then totals, tax, line items, dates, duplicates and other documents are checked.
Make it searchable
Results go into PostgreSQL with full-text search and meaning vectors (pgvector), so staff can search by words or by meaning.
Measured on a labelled test set
Run 2026-11-10 · full report in the repositoryWhat it is built with, and why
Fast, simple screens for upload, review and search.
The best OCR and spreadsheet tools are in Python; FastAPI writes the interactive API documentation itself.
Slow OCR and AI work never blocks the website. Add workers to process more files at once.
Free, local OCR with image clean-up; exact text from digital PDFs; every Excel sheet.
Strict JSON output. The API key stays inside n8n; the gateway allows only two kinds of calls.
One database for records, history, keyword search and meaning search: fewer moving parts.
No made-up values
Language models can sound sure while being wrong. So the model is never trusted on its own: it must quote the document, and plain code checks the quote and the value. Maths is done by code, never by the model. A missing value stays empty and is flagged.
Security
- HTTPS everywhere; an access code can lock the demo, and a daily AI budget caps the cost.
- File type checked from content, size and page limits, rate limits per address.
- Containers run as a normal user with CPU and memory limits, on a private network.
- The AI key is never in the app; document text is not stored by the AI provider (store: false).
- Every manual change is logged: old value, new value, who, when, why.
Scaling up
Each part scales on its own: more workers for more files, more API copies behind the load balancer, a managed PostgreSQL for more data, object storage for originals. The queue absorbs bursts, failed jobs can be retried in one click, and every stage is timed in the processing history.