Blueprints BP-03

Document intelligence pipeline

Facts are locked in PDFs, scans and email attachments.

Data pipelinesLogisticsSupply chainFinanceLast reviewed · November 2026

01 / Fit

Use it when

  • The same kinds of document arrive in volume, in many layouts.
  • People currently re-key fields from documents into another system.
  • Each field has a business rule or a cross-check that can confirm it.
  • Downstream systems need rows and lineage, not summaries.

Avoid it when

  • The source can send structured data instead. Ask for the feed before parsing the PDF.
  • There are only a few layouts and they never change. Templates are cheaper and exact.
  • Nobody is available to review flagged documents. Without review the errors accumulate unseen.

02 / The diagram

Run it. Then run the failure path.

Select a node to see what it does, how it fails and what we measure.

Idle
check failedcorrectedcorrectionsreplayed per releaseINGESTFiles inCLASSIFYDocument typePARSELayout and OCREXTRACTTyped fieldsVALIDATEBusiness rulesSTORERows, lineageREVIEW QUEUECorrect fieldsGOLDEN SETChecked cases
  1. Ingest (Files in). Collects files from inboxes, portals and shared drives, and fingerprints each one. Fails when: The same document arrives twice, or a new source format appears. Safeguard: Content-hash de-duplication. Unknown formats are quarantined, not dropped.
  2. Classify (Document type). Decides what the document is, so the right schema applies. Fails when: A new layout looks like an old type. Safeguard: A confidence threshold. Uncertain documents go to review with the top two guesses.
  3. Parse (Layout and OCR). Recovers reading order, tables and key-value pairs from layout and OCR. Fails when: Scans are skewed, stamped or handwritten. Safeguard: A second parser for low-quality pages, and a quality score per page.
  4. Extract (Typed fields). Fills a typed schema from the parsed document, with a source span for every field. Fails when: The model returns a plausible value that is not in the document. Safeguard: Every field must cite its span. A field without one is left empty.
  5. Validate (Business rules). Checks extracted fields against business rules and against each other. Fails when: Totals do not add up, or a date is out of range. Safeguard: A failed check sends the document to review. Nothing partial is stored.
  6. Store (Rows, lineage). Writes validated rows to the warehouse with lineage back to the source page. Fails when: A schema change breaks a downstream consumer. Safeguard: Versioned schemas and contract tests.
  7. Review queue (Correct fields). A person corrects flagged fields with the source page beside them. Fails when: The queue grows faster than it is cleared. Safeguard: Alert on queue age. Corrections feed the golden set.
  8. Golden set (Checked cases). Holds reviewed documents with known-correct fields, replayed before each release. Fails when: It stops reflecting the documents that arrive today. Safeguard: Refreshed from reviewed cases on a schedule.
Tuned for · Field-level accuracy, cost per documentReference design
DataModelGuardHumanActive pathFallback path
Read the diagram as text
  1. Ingest (Files in). Collects files from inboxes, portals and shared drives, and fingerprints each one. Fails when: The same document arrives twice, or a new source format appears. Safeguard: Content-hash de-duplication. Unknown formats are quarantined, not dropped.
  2. Classify (Document type). Decides what the document is, so the right schema applies. Fails when: A new layout looks like an old type. Safeguard: A confidence threshold. Uncertain documents go to review with the top two guesses.
  3. Parse (Layout and OCR). Recovers reading order, tables and key-value pairs from layout and OCR. Fails when: Scans are skewed, stamped or handwritten. Safeguard: A second parser for low-quality pages, and a quality score per page.
  4. Extract (Typed fields). Fills a typed schema from the parsed document, with a source span for every field. Fails when: The model returns a plausible value that is not in the document. Safeguard: Every field must cite its span. A field without one is left empty.
  5. Validate (Business rules). Checks extracted fields against business rules and against each other. Fails when: Totals do not add up, or a date is out of range. Safeguard: A failed check sends the document to review. Nothing partial is stored.
  6. Store (Rows, lineage). Writes validated rows to the warehouse with lineage back to the source page. Fails when: A schema change breaks a downstream consumer. Safeguard: Versioned schemas and contract tests.
  7. Review queue (Correct fields). A person corrects flagged fields with the source page beside them. Fails when: The queue grows faster than it is cleared. Safeguard: Alert on queue age. Corrections feed the golden set.
  8. Golden set (Checked cases). Holds reviewed documents with known-correct fields, replayed before each release. Fails when: It stops reflecting the documents that arrive today. Safeguard: Refreshed from reviewed cases on a schedule.

03 / Components

Every component, and how it fails.

ComponentJobTypical choicesFails whenSafeguard
IngestCollects files from inboxes, portals and shared drives, and fingerprints each one.Connectors for mailboxes, portals and shared drives, with content hashingThe same document arrives twice, or a new source format appears.Content-hash de-duplication. Unknown formats are quarantined, not dropped.
ClassifyDecides what the document is, so the right schema applies.Document classifier with a confidence thresholdA new layout looks like an old type.A confidence threshold. Uncertain documents go to review with the top two guesses.
ParseRecovers reading order, tables and key-value pairs from layout and OCR.Layout-aware parser and OCR engine, with a second parser for poor scansScans are skewed, stamped or handwritten.A second parser for low-quality pages, and a quality score per page.
ExtractFills a typed schema from the parsed document, with a source span for every field.Language model with schema-constrained output and source spansThe model returns a plausible value that is not in the document.Every field must cite its span. A field without one is left empty.
ValidateChecks extracted fields against business rules and against each other.Rule engine for field checks and cross-field checksTotals do not add up, or a date is out of range.A failed check sends the document to review. Nothing partial is stored.
StoreWrites validated rows to the warehouse with lineage back to the source page.Data warehouse with versioned schemas and lineage columnsA schema change breaks a downstream consumer.Versioned schemas and contract tests.
Review queueA person corrects flagged fields with the source page beside them.Review interface with the source page beside the extracted fieldsThe queue grows faster than it is cleared.Alert on queue age. Corrections feed the golden set.
Golden setHolds reviewed documents with known-correct fields, replayed before each release.Versioned set of reviewed documents and a replay harnessIt stops reflecting the documents that arrive today.Refreshed from reviewed cases on a schedule.

04 / Budgets and evals

What the design is tuned for.

Field-level accuracy, cost per document. These are design targets, not results.

StageDesign target
ParseThe low-cost parser handles clean pages. The heavier one is kept for pages below the quality score.
ExtractCost per document. One schema-constrained call per document type where possible.
ValidateRule-based, so every failure can be explained and repeated.
ReviewTime per document. Only flagged fields are shown, with the source beside them.

Eval plan 01

Golden set

Reviewed documents with known-correct fields, spread across document types, layouts and scan quality. It includes handwritten, stamped and multi-page table cases.

Eval plan 02

Release gates

Field-level accuracy per field, not one average. Share of fields with a valid source span, and review rate at the current thresholds.

Eval plan 03

Catching regressions

The golden set is replayed before each release and compared field by field with the last one. Corrections from the review queue are added on a schedule.

05 / Design notes

Where the whiteboard and production differ.

  1. Document-level accuracy hides the problem. One field in a new layout can fail every time while the average stays high.
  2. Tables that span pages, and totals that depend on them, cause more errors than free text.
  3. A new layout usually arrives without notice and is classified as an old type. Confidence thresholds catch this only if they are tuned per type.
  4. Scan quality varies more by source than by document type. A quality score per page is worth storing.
  5. Review effort is the cost that decides whether the pipeline pays for itself, so the review screen needs as much design as the model prompt.

06 / Deploy

Deploy this with us.

A pod can take BP-03 from this page to your stack. Tell us the workflow and we will tell you what changes for your systems.

You will talk to an engineer

Book a scoping call

Start with one workflow.

Tell us where the work piles up. You will talk to an engineer, not a salesperson.

What do you need?

After the call you get a one-page scoping note: what we would build first, how we would measure it, and what it takes.