Document Processing
When a document is uploaded to Talonic, it flows through a multi-stage processing pipeline that transforms raw files into structured, queryable data. Each stage runs automatically and its progress is visible in the document's processing log. The pipeline handles everything from OCR conversion to AI-powered field extraction, with built-in retry logic for resilience.
Document — Processing Log
Every document shows a structured processing log with per-stage timing.
Processing Stages
- Document AI OCR — Converts files to Markdown and produces structured annotations (type, sensitivity, PII categories, jurisdiction) in a single pass.
- Classification — Verifies the annotation against the 529-type document ontology. If the label and content disagree, AI resolves the correct type from the actual text.
- Triage — Tags the document with sensitivity level, department, jurisdiction, and compliance signals derived from the OCR annotations.
- AI Data Field Capture — Extracts every data point from the document content using Claude, producing fields with confidence scores and source text provenance.
Document AI OCR converts files to Markdown and produces structured annotations (type, sensitivity, PII categories, jurisdiction) in a single pass. Classification verifies the annotation against the 529-type document ontology — if the label and content disagree, AI resolves the correct type from the actual text. AI Data Field Capture extracts every data point. Large documents (PDFs exceeding 25 pages) are automatically split into page chunks, processed in parallel, and merged — so even lengthy documents complete efficiently without timeouts.
The extraction stage uses a chunk-first approach by default: document sections are labelled inline and sent to Claude in a single call. The response combines JSON metadata with CSV-formatted fields, capturing confidence scores, source text, and chunk coverage for every extracted value. Optional quality passes — field count estimation, verification, and cross-reference enrichment — run as lightweight Haiku calls to catch extraction gaps. Six quality metrics are computed post-extraction: confidence per chunk, noise detection, semantic dissimilarity, text coverage, connection awareness, and consistency awareness.
After AI extraction, the platform injects synthetic metadata fields into the result so that file-level context is available alongside extracted content:
| Parameter | Type | Description |
|---|---|---|
| filename | string | The original uploaded filename. Always present on every document. |
| source_file_path | string | The original file path from the uploaded archive or folder (e.g. contracts/2026/lease.pdf). Only present when the document was uploaded inside a ZIP archive or folder — reflects the internal directory structure. |
Both fields appear in the Raw Extraction tab with full confidence (1.0) and are available for schema mapping, job resolution, filtering, and export — just like any AI-extracted field.
If OCR or extraction fails, the platform automatically retries using a fallback chain. OCR failures cascade from Document AI to the Talonic API to local parsers. Extraction parse failures retry in realtime mode (never as new batches). Each retry stage is logged in the processing log so you can see exactly what happened. Documents that exhaust all retries are marked with a terminal status (extraction_failed or ocr_failed) and remain visible in the source for manual review.
Monitoring Processing via API
You can monitor document processing programmatically by polling the document detail endpoint. The response includes the current status (pending, processing, completed, or error), the document type assigned during classification, and the number of extractions produced. For high-volume pipelines, configure a webhook with the document.extracted signal to receive push notifications instead of polling, which reduces API calls and provides faster response times.
curl https://api.talonic.com/v1/documents/doc_7f3a1b2c \
-H "Authorization: Bearer $TALONIC_API_KEY"{
"id": "doc_7f3a1b2c",
"filename": "invoice.pdf",
"status": "completed",
"type_detected": "Invoice",
"extraction_count": 1,
"created_at": "2026-05-07T10:30:00Z"
}For documents that fail processing, the API reports an error status, and the Processing Log tab in the web interface shows the diagnostic detail: how many retries were attempted and whether the failure happened during OCR (ocr_failed) or extraction (extraction_failed). This information helps you decide whether to resubmit the document, try a different file format, or investigate the source document for quality issues like low-resolution scans or corrupted files.
The processing pipeline also supports include_markdown=true on extraction requests, which returns the OCR-generated markdown alongside the extraction results. This is useful for debugging and quality assurance workflows where you need to verify what the AI model saw before extracting fields. You can also retrieve the markdown separately at any time using the dedicated markdown endpoint, which returns the full structured markdown representation of the document including preserved tables, headings, and layout information.
curl https://api.talonic.com/v1/documents/doc_7f3a1b2c/markdown \
-H "Authorization: Bearer $TALONIC_API_KEY"