DocuLens AI extracts, compares and checks compliance on invoices and contracts, and every one of those verbs comes with a constraint: the output must be something an auditor can defend. "The AI said so" is not a defence. Schema-first extraction with deterministic scoring is.
Start from the schema, not the prompt
Define the fields you need — vendor, invoice number, dates, line items, totals, tax — with types and rules. The extraction prompt asks for exactly that structure, the response is parsed against it, and anything that fails validation is flagged rather than guessed. The schema is the contract between the model and the rest of the system.
Validate with arithmetic, not vibes
- Line items must sum to the subtotal; subtotal plus tax must equal the total.
- Dates must parse and be in a plausible order — issue before due.
- Identifiers must match the format the vendor actually uses.
- Any field that fails gets a confidence of zero and a visible flag, whatever the model claimed.
Deterministic scoring
Compliance checks — does this contract clause exist, does this invoice match the purchase order — are scored by rules applied to extracted fields, not by asking the model for a verdict. The same document produces the same score every time, which is the property auditors care about most. I made this argument at length in deterministic document extraction.
Compare against the source
Show each extracted value beside the region of the document it came from. Reviewers verify in seconds, corrections become training signal, and trust builds because the system never asks to be believed. This is the document equivalent of citations in RAG answers.
Architecture notes
DocuLens runs as a single Next.js application with no database and no separate backend — intentionally minimal infrastructure with enterprise-grade code. For a document tool handling sensitive files, fewer moving parts is a security feature. A fast LLM provider does the reading; rules do the judging.
— Pranjul Rathour, GenAI Engineer from Kanpur, India. Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at any campus: pranjulrathour41@gmail.com.
