Fifty-plus document types walk in as messy PDFs and scans. Structured, validated JSON walks out, at 95% accuracy and 10,000 documents a day.
Textract is great at seeing, it reliably lifts text, tables, and key-value pairs off a noisy scan. It is not great at understanding what the document is or what each field means. The OpenAI layer does that reasoning: it classifies the type and maps raw spans to a normalized schema.
Splitting perception from cognition means adding a 51st document type is a prompt and a schema, not a model retrain. New formats ship in hours instead of weeks.
At 10K docs/day, 95% accuracy still leaves 500 documents that need a second look. The confidence gate makes that tractable: every extraction carries a score and the model's rationale, so low-confidence items route straight to a focused human-review queue.
Reviewers correct only the fields that are flagged, and those corrections feed back into the few-shot examples, accuracy compounds without a training pipeline.
| Component | Technology | Why |
|---|---|---|
| OCR / layout extraction | AWS Textract | Handles tables, forms, and rotated scans without per-template tuning. |
| Classification & extraction | OpenAI | Generalizes to new document types from a few examples, no retraining. |
| API & orchestration | FastAPI (Python) | Async I/O keeps thousands of concurrent jobs from blocking on Textract. |
| System of record | PostgreSQL | JSONB plus relational columns store flexible fields with queryable provenance. |
| Confidence routing | Custom thresholds | Auto-passes safe results, escalates only the ambiguous 5% to humans. |
Reads scanned PDFs, photos, and digital files regardless of template or orientation.
New document types added via prompt and schema, with no model retraining.
Coerces dates, currencies, and IDs into canonical formats per document type.
Auto-clears high-certainty results and escalates only ambiguous extractions to humans.
Every field links back to its source span and the model decision that produced it.
Emits validated, structured payloads to downstream systems the moment a doc clears.
“"Textract sees the page. OpenAI understands it. Postgres remembers it, 10,000 times a day."”
The result is a document pipeline that scales like infrastructure, not like a back office. By separating OCR perception from LLM reasoning and gating output on confidence, the system absorbs 50+ document types at 95% accuracy and 10K+ documents per day, cutting processing time by 85% while keeping a human in the loop exactly where it matters. Adding the next document type is a configuration change, not an engineering project, so the platform gets cheaper to extend the more it handles.