Teams usually treat document extraction as a prompt problem: find the right instruction and the invoices read themselves. In practice it is a pipeline problem. Accuracy is not one number but a spread across field types. Dates and totals are easy, payment terms are not. The economics are decided by which documents go to a person, not by chasing the last few points with a bigger model.

The five-stage pipeline

The systems we have built and reviewed run the same five stages. Where one stage ends and the next begins varies; what each stage is responsible for does not. The model call sits in stage three, and the other four are what make it shippable.

  1. Stage 01IngestEmail, upload forms, storage buckets, partner SFTP.

    Broken whenFiles arrive in formats nobody planned for, or signature blocks end up in the text.

  2. Stage 02ClassifyWhat kind of document is this?

    Broken whenContracts get processed as invoices, or low-confidence labels move on anyway.

  3. Stage 03ExtractTyped fields against a declared schema.

    Broken whenOutput fails to parse, or required fields come back empty.

  4. Stage 04ValidateSchema checks plus a faithfulness grader per field.

    Broken whenValues pass the schema but cannot be traced back to the source text.

  5. Stage 05RouteThe typed record goes to the next system.

    Broken whenSomeone still opens every source document to check the record by hand.

Figure 1. The five stages of a document pipeline. A file comes in, gets a type, becomes a typed record, is checked twice, and only then reaches the next system.

Stage 01Ingest

Pulls documents in from email forwards, upload forms, storage buckets and partner SFTPs, normalises the format, strips noise such as quoted replies, and emits one stable representation for everything downstream.

Stage 02Classify

Decides what the document is: invoice, contract, intake form, compliance attachment. The output is a label and a confidence. Below the threshold the document stops and goes to a person.

Stage 03Extract

Turns the text into a typed object that matches a schema declared up front: required fields, optional fields, types, rules. The model writes under structured-output constraints, and the result is parsed before it may continue.

Stage 04Validate

Two checks. A deterministic one (does it parse, are the required fields there, do the types match) and a graded one: can each value be traced back to the source text? Both must pass before the record leaves without a person.

Stage 05Route

Hands the record to the next system: accounting, the CRM, the contract repository, an inbox. Routing rules are typed and every decision is written to the trace.

Who reviews what

The pipeline earns its keep at the line between “automate” and “send to a person”. We start from three confidence tiers and then set the line per field type, tighter for a payment recipient than for a free-text note. These are our starting thresholds, tuned against a labelled sample for each document class.

  • 0.97 and above. Routed automatically, no review.
  • 0.85 to 0.97. Routed automatically, with a sample checked by a person.
  • Below 0.85. Held in the review queue and never processed automatically.

Three scales, one table

The five stages stay the same from one document type to a regulated pipeline. What grows is the number of classes, and the evidence an auditor will ask for.

Document pipeline at three scales
LayerOne team, one document typeScale 01Several teams and typesScale 02Regulated pipelineScale 03
IngestOne channel: an email forward or an upload formShared intake, normalised per classEncrypted channels plus personal data redaction
ClassifyA shortcut: one type onlySeveral classes, a threshold per classSeveral classes plus jurisdiction tags
ExtractOne schema, one extraction promptAn extractor and schema per classPer class and per jurisdiction
ValidateSchema check plus a faithfulness graderShared validator, rubric per classDeterministic, graded and sampled human review
RouteOne downstream systemRules per class, an audit trail per recordSigned audit trail per record
Cost bandCHF 12,000 to 18,000CHF 15,000 to 25,000Scoped per case
Build timeA focused MVP can be ready in two weeks. A scoped product can launch in around two months. We agree the timeline after reviewing your requirements.A focused MVP can be ready in two weeks. A scoped product can launch in around two months. We agree the timeline after reviewing your requirements.Scoped per case, plus the audit cycle
Live exampleNo named engagement yetNo named engagement yetNot built yet

Document pipeline at three scales

Scale 01One team, one document type

Ingest
One channel: an email forward or an upload form
Classify
A shortcut: one type only
Extract
One schema, one extraction prompt
Validate
Schema check plus a faithfulness grader
Route
One downstream system
Cost band
CHF 12,000 to 18,000
Build time
A focused MVP can be ready in two weeks. A scoped product can launch in around two months. We agree the timeline after reviewing your requirements.
Live example
No named engagement yet

Scale 02Several teams and types

Ingest
Shared intake, normalised per class
Classify
Several classes, a threshold per class
Extract
An extractor and schema per class
Validate
Shared validator, rubric per class
Route
Rules per class, an audit trail per record
Cost band
CHF 15,000 to 25,000
Build time
A focused MVP can be ready in two weeks. A scoped product can launch in around two months. We agree the timeline after reviewing your requirements.
Live example
No named engagement yet

Scale 03Regulated pipeline

Ingest
Encrypted channels plus personal data redaction
Classify
Several classes plus jurisdiction tags
Extract
Per class and per jurisdiction
Validate
Deterministic, graded and sampled human review
Route
Signed audit trail per record
Cost band
Scoped per case
Build time
Scoped per case, plus the audit cycle
Live example
Not built yet
Cost bands are our quoting bands for audit, design, engineering and launch, excluding model API spend, which grows with volume. How to read them.

What not to build

Each of these saves a few weeks at the start and costs months once the pipeline carries real volume.

  • OCR and hope. Text from OCR is not extracted data. It is stage one of five.
  • One prompt for every document type. It drifts with every model update, cannot be tested per class, and loses to a dedicated extractor on each one.
  • No review queue. Sending uncertain extractions straight through saves money for a quarter and produces incidents nobody sees until month end.
  • Accuracy claims without fixtures. “The model is 95% accurate” with no labelled set, no rubric and no baseline is a sales line.
  • A schema that lives in the vendor's portal. Keep it in your own version control, or the day you switch vendors the pipeline is a rewrite.

Where we stand

We have no named, live document intelligence engagement to show on this page. The five stages are the shape we build to, and the eval method behind them is public in the Eval Spec.

Illustrative example, not a client

Picture a finance team that keys supplier invoices by hand and finds its errors at month-end reconciliation. With the pipeline in place, most invoices go straight to accounting, the uncertain ones wait in a review queue, and mistakes surface the day the invoice arrives. The team's time moves from typing to checking the queue.

The place to start is a two-week Discovery Sprint: we map the manual flow, pick the document class that costs the most time, and fix the schema and the accuracy targets before anything is built.

Self-audit

Twelve questions for the way documents are processed today. The score updates as you tick; what the bands mean is explained once on the stacks index.

Tick every statement that is true today

Score 0 of 12. People are the integration layerMost of the work between the tools is done by hand. Start with the lowest-numbered question you answered no to; the early questions are the foundations.

Method and pricing

The layer model, how to read the cost bands, the notes on data residency, multilingual documents and the EU AI Act, and how these reports are versioned are shared across all five stack reports: how we write the stack reports.

Questions

Where does a document pipeline break once it is live?
Three places. A source changes its format and nobody tells the pipeline. Confidence thresholds drift, so either the review queue floods or bad extractions slip through. Or the model behind the extractor is updated and accuracy drops quietly. A weekly run of the harness on a fresh labelled sample catches all three.
What does each document cost to process?
Model spend depends on document length and the model chosen. We measure it per document during the Discovery Sprint and, once the pipeline is live, track the cost per correct extraction rather than the cost per call.