Extract business-document fields with traceable OCR evidence
Combine text recognition and language-model interpretation while preserving source regions for validation and human review.
How this works
Combine text recognition and language-model interpretation while preserving source regions for validation and human review.
Preserve a chain from each extracted field to the source region that supports it. Recognition, interpretation and validation are separate stages: a plausible invoice total does not prove that its account number or tax amount was read correctly.
Before you start
Defined operating scope
Business documents must become structured fields with evidence for each extracted value.
Required source material
Obtain Invoices, receipts, or other business documents; Required output schema; Validation rules. If connectors are unavailable, use authorized files with the same fields.
Decision and exception rules
Two nearby values could populate the same field. Show both source regions and ask the reviewer to select.
Prepare the inputs
- document_id
- Required
File hash, pages and document type
Preserve original bytes and page order.
- ocr_result
- Required
Text blocks with coordinates
Record page, region and extraction confidence if available.
- output_schema
- Required
Field names, types and requiredness
Specify null handling and allowed date formats.
- validation_rules
- Required
Format and arithmetic constraints
Use deterministic checks for amounts and identifiers.
Implementation, step by step
Establish the working record
- Confirm the selected records, effective versions and responsible owner.
- Check document_id, ocr_result, output_schema, validation_rules before beginning. Record the source version and the selected scope; an unavailable value stays unknown rather than becoming an inferred fact.
Checkpoint: The input record identifies the selected document_id and any missing required fields.
Run OCR to capture text and source coordinates
- Run an available OCR tool or inspect the document manually, keeping text coordinates and unreadable regions.
- Recalculate arithmetic independently and validate each field’s source region.
Checkpoint: A saved intermediate result for: Run OCR to capture text and source coordinates.
Use an assistant to map the recognized content into the required fields
- Map recognized text to the required schema with source-region references; do not fill absent fields from similar documents.
- Test decimal separators, negative amounts, page breaks and absent fields using representative documents.
Checkpoint: A saved intermediate result for: Use an assistant to map the recognized content into the required fields.
Validate formats, arithmetic, and links to source regions
- Validate type, date interpretation, checksums where applicable and arithmetic; retain both original text and normalized value.
- Recalculate arithmetic independently and validate each field’s source region.
Checkpoint: A saved intermediate result for: Validate formats, arithmetic, and links to source regions.
Send uncertain or inconsistent records to a reviewer before export
- Queue uncertain or inconsistent fields for review and export only records meeting the defined acceptance rules.
- Test decimal separators, negative amounts, page breaks and absent fields using representative documents.
Checkpoint: A saved intermediate result for: Send uncertain or inconsistent records to a reviewer before export.
Package the result and unresolved work
- Plausible totals can hide recognition errors. Test representative documents and new supplier layouts; never assume a confident response is accurate.
- Preserve originals and distinguish unreadable, missing and zero values.
Checkpoint: Structured records with source-region evidence and validation status. Unresolved items remain visible in the review record.
Decisions along the way
Two nearby values could populate the same field.
Show both source regions and ask the reviewer to select.
The arithmetic is inconsistent despite readable text.
Flag the document discrepancy instead of changing extracted figures to make it balance.
A new layout breaks source-region mapping.
Hold that layout for review and retest representative documents before bulk export.
What you will produce
document-ocr-to-validated-records-result.json
JSONStructured records with source-region evidence and validation status. Label proposed and completed states separately.
Include: document_id · field_values · original_text · source_regions · validation_errors · review_status · status · evidence_reference · review_note
document-ocr-to-validated-records-review.md
MarkdownKeep the evidence and unresolved decisions needed to apply this result, including exceptions involving validation_rules.
Include: source_reference · question · owner · next_action
Check the result
- Recalculate arithmetic independently and validate each field’s source region.
- Test decimal separators, negative amounts, page breaks and absent fields using representative documents.
- Inspect document_id and ocr_result in both the original and output; confirm that record identity and interpretation survived the transformation.
- Plausible totals can hide recognition errors. Test representative documents and new supplier layouts; never assume a confident response is accurate.
When something goes wrong
Two nearby values could populate the same field.
Show both source regions and ask the reviewer to select. Retain the affected evidence and recovery status.
The arithmetic is inconsistent despite readable text.
Flag the document discrepancy instead of changing extracted figures to make it balance. Retain the affected evidence and recovery status.
A new layout breaks source-region mapping.
Hold that layout for review and retest representative documents before bulk export. Retain the affected evidence and recovery status.
A worked example
SYNTHETIC EXAMPLE · NOT A REPORTED BUSINESS RESULT
Request
Extract business-document fields with traceable OCR evidence for the following bounded example; prepare the result for review.
Inputs
Synthetic example: Receipt D-6 shows subtotal 100.00, tax 20.00 and total 128.00. OCR clearly reads all three.
Expected result
Synthetic expected result: Extract the three values with coordinates and flag an 8.00 arithmetic discrepancy. Do not replace the total with 120.00 or invent a fee.
Run a small pilot
Start small
Trial a representative batch containing the ordinary case and the exception demonstrated above.
Record the baseline
Record current preparation time, review effort and correction types for the same records.
Agree success criteria
Agree acceptable review and error limits; measure verified field accuracy; exception recall and reviewer minutes per document.
Stop or revise
A new layout breaks source-region mapping. Pause affected records and apply this recovery: Hold that layout for review and retest representative documents before bulk export.
Keep the scope clear
- Preserve originals and distinguish unreadable, missing and zero values.
- Do not authorize payments or overwrite source documents as part of extraction.
Check before using
Plausible totals can hide recognition errors. Test representative documents and new supplier layouts; never assume a confident response is accurate.
Business activities
- Manage finances and accounting
- Maintain shared company knowledge
FROM A RECIPE TO YOUR WORKFLOW
Bring the company context together.
This workflow needs reliable inputs before it needs a better prompt. Moat8 Vault brings working information into a readable archive for the AI tools you use.
For this recipe: Invoices, receipts, or other business documents · Required output schema · Validation rules
Start with one recurring task, agree which sources to use, and review the first result with your team.
Discuss this workflow