Skip to main content
Built-in extractor names are a deprecated alias. Collections are now created by picking features. This pipeline is selected with features: ["document_layout"] (layout/structure extraction on top of the document_search base). Existing feature_extractor configs keep working; see the migration guide.

View on GitHub

Runnable reference for this extractor: inputs, parameters, output fields, embedding models, and copy-paste examples. Auto-generated from the live registry.
Document graph extractor pipeline showing PDF parsing, layout detection, and block extraction
The document graph extractor decomposes PDFs into spatial blocks (paragraphs, tables, forms, lists, headers, footers, figures, and handwritten content), each with a bounding box, a layout class, and a confidence score. Low-confidence blocks can be corrected by a vision language model (Gemini, GPT-4V, or Claude). Block text is optionally embedded with E5-Large (1024-d) for semantic search. It is the right tool for archival documents, scanned files, and anything that needs spatial understanding rather than a flat text dump.
View extractor details at api.mixpeek.com/v1/collections/features/extractors/document_graph_extractor_v1 or fetch programmatically with GET /v1/collections/features/extractors/{feature_extractor_id}.

Pipeline Steps

  1. Layout detection (if use_layout_detection, the default): find all document elements with layout_detector (pymupdf fast rule-based, or docling SOTA ML/DiT). Detects text regions and non-text elements (scanned images, figures, charts) as separate blocks.
  2. Block grouping: when layout detection is off, group text spans into blocks using vertical_threshold / horizontal_threshold; drop blocks shorter than min_text_length.
  3. Confidence scoring: assign base_confidence to native text (penalties for OCR artifacts / encoding issues), then tag each block A/B/C/D.
  4. VLM correction (if use_vlm_correction and confidence < min_confidence_for_vlm): re-read low-confidence blocks with vlm_provider/vlm_model. Skipped entirely in fast_mode.
  5. Text embedding (if run_text_embedding): embed block text with E5-Large (1024-d).
  6. Thumbnails (if generate_thumbnails): render full-page and/or per-block thumbnails per thumbnail_mode.
  7. Output: one document per block with layout class, bbox, text, confidence, and optional embedding/thumbnails.

When to Use

When NOT to Use

Input Schema

Input Examples: Supported input types: PDF only (max 1 PDF per object). Max file size 100MB. For scanned documents, 150–300 DPI originals give the best OCR.

Output Schema

One document per detected block:

Parameters

Layout Detection

Spatial Clustering (text-only fallback)

Only used when use_layout_detection=false.

Confidence & VLM Correction

Embedding & Thumbnails

Configuration Examples

Layout Types

The extractor classifies blocks into these object_type values:

Confidence Tags

Extraction quality is graded with confidence tags (thresholds on overall_confidence):

Performance & Costs

Vector Index

The embedding is optional. Set run_text_embedding: false for a layout-only extraction with no vector index.

Limitations

  • PDF only: Accepts a single PDF per object; does not process Word docs, images, or other formats.
  • VLM cost: Each correction adds cost (see Billing & Pricing); gate it with min_confidence_for_vlm or disable via fast_mode.
  • Layout-detector tradeoff: docling is more accurate but markedly slower than pymupdf.
  • Memory: Large PDFs (100+ pages) may require increased memory.
  • Language / handwriting: OCR works best with Latin scripts; handwriting detection is experimental and less reliable.
  • External dependency: VLM correction depends on the selected provider’s availability.

Search the Extracted Text

Extracted block text (native or OCR/VLM-corrected) is embedded into the document_graph_extractor_v1_text_embedding index, so you search it with a feature_search stage against mixpeek://document_graph_extractor@v1/intfloat__multilingual_e5_large_instruct (input_mode: "text"). For a ready-to-copy retriever (including confidence and layout-type filtering), see Cookbook → Search OCR Text from Scanned PDFs.