DOCUMENT AI / RAG

DocFlow AI — Document Intelligence With Click-To-Source Citations

Turns documents into deadlines, requirements and tasks — and refuses to show a fact it cannot point to. Click any extracted deadline and its exact source sentence highlights on the page, with the normalised date, the time remaining, and the raw text the document actually contained.

Public demo

100% — citation verification, 30 facts checked

The problem

Most document AI stops at summarize and chat, which leaves the reader to work out what the answer means and remember to act on it. Worse, a summary gives you no way to check it: the fact and the page it came from are separated by a model, and a fabricated obligation looks exactly like a real one. For a scholarship circular or a compliance notice, an invented deadline is not a cosmetic error.

The approach

The whole system is built around one provenance chain — document → page → character span → bounding box → fact → task. Every input is normalised to a canonical PDF plus page image and word map, so one viewer and one citation model serve every format. Extracted quotes are then located by fuzzy span alignment against the real page text, widening from the claimed page to its neighbours to the whole document only as needed, and converted into normalised rectangles. Dates are normalised by code rather than the model: 05/09/2026 is flagged ambiguous with both readings offered instead of guessed. Full-document context comes first and RAG second, because a ten-page circular fits in context and retrieval is for corpus scale, not document scale. The extraction call has no tools, no network and no database access.

The results

Citation verification rate is 1.0 end to end on a clean digital PDF, and because a fabricated fact cannot produce a quote that fuzzy-matches real page text at ≥95, that rate doubles as a hallucination metric needing no judge model and no labels. Highlights land on more than 85% of page ink at 0/90/180/270° rotation — rendered to a bitmap and measured, not asserted. Tenant isolation passes 48/48 parameterised over every workspace-scoped table, the authorization matrix 99/99, and real extraction costs $0.00088 per document from the usage ledger. Two design assumptions were measured and found wrong, then corrected in the docs: the native-text-layer gate was specified at ≥40% word-box coverage when a dense A4 page measures 0.309 — wrong by roughly 50× — and text-embedding-3-small scores only 0.297 on the same deadline in English versus Bangla, against a 0.018 noise floor. The prompt-injection suite includes a case asserting a novel paraphrase is not caught, because a security suite that only asserts successes is marketing.

Stack: FastAPI, SQLAlchemy 2, Postgres + pgvector, ARQ, PyMuPDF, Tesseract, rapidfuzz, Next.js, Neon, Render