All projects

RAG SystemsStatus: Case StudyYear: 2026

DocuMind

Document extraction where every value points to the region of the page it came from.

A look inside

4 screens from the real build. Select any to see it full size.

A test invoice parsed into seven blocks, each with its page coordinates. The verifier re-renders every block and compares it with the original crop using SSIM, layout overlap and CLIP similarity. Blocks that differ too much are flagged for review, like the first one here.
Fields are extracted against a user-defined JSON schema. Each value shows its validator results and a warning when its confidence score is uncalibrated, plus a link to its source. A reviewer approves, corrects or marks each field missing, and that decision is stored separately from the original output.
Opening a field's source loads the stored page image and outlines the cited region, with its page, block ID and bounding box. Here the region is the whole header block, because the fallback layout step grouped those lines together.
The same run as a JSON tree. Each block records its type, position on the page, reading order, text and HTML, the engine that produced it and the verifier's scores. Extracted fields cite blocks from this tree.

Overview

A document AI pipeline that parses pages into verified blocks, extracts fields against your own schema, and cites every value back to the exact region of the page.

The problem

Extraction models return confident values with no way to see where they came from, so reviewers end up re-reading the whole document.

What I built

Built the pipeline end to end: parsing and verification, schema-based extraction, the review flow, and the Next.js interface.

What it does

  • Layout parsing with page coordinates
  • Block verification
  • Schema-based field extraction
  • Human review with region citations
  • Visual retrieval with ColQwen2

System and architecture

DocuMind parses each page into layout blocks, checks each block against the original, extracts fields against a user-defined JSON schema, and links every value to its source region for human review.

FastAPI accepts documents and Celery workers process them. Docling turns each page into blocks with coordinates, and a verifier re-renders every block and compares it with the original crop using SSIM, layout overlap and CLIP similarity. Fields are extracted against a JSON schema with validators, each linked to its source block. ColQwen2 page embeddings in Qdrant handle visual retrieval across documents.

System map4 layers
  1. Interface
  2. API & services
  3. Retrieval & data
  4. AI & models
  • Block-level verification against the source page
  • Schema-based extraction with validators and source links
  • Reviewer decisions stored apart from model output

Technology

  • Python
  • FastAPI
  • Celery
  • Docling
  • ColQwen2
  • Qdrant
  • PostgreSQL
  • Next.js

Themes

  • Document AI
  • Citations
  • Human review

Challenges and trade-offs

  • Making confidence honest: uncalibrated scores are labelled as uncalibrated.
  • Keeping reviewer corrections separate from the original machine output.

Outcome

At a glance

Docling · Block verifier · Schema extraction · Region citations

  • Every extracted value can be traced to a region of the page.
  • Blocks that don't match the source are flagged for review instead of passed through.

Learnings

  • A citation is only useful if it points to a region a person can check.
  • Comparing output against the source catches errors an extractor will not admit.