LlamaIndex Publishes Two-Pass OCR Workflow for Small Document Data Rooms

The proposed workflow scans every uploaded file cheaply, then reserves more expensive visual parsing for pages an agent identifies as relevant.

By 2 min read
LlamaIndex Publishes Two-Pass OCR Workflow for Small Document Data Rooms
LlamaIndex Publishes Two-Pass OCR Workflow for Small Document Data Rooms

Listen to this story

The audio brief

About 1:32
0:001:32
Read transcript
LlamaIndex has published a two-pass OCR workflow that cuts the expensive visual work down to only the pages an agent actually needs. The idea is simple: scan every uploaded file with a cheap text extractor, search that rough index for likely evidence, and then send the relevant pages to a vision-language model for a more careful read. In LlamaIndex’s example, LiteParse processed 12,013 pages across 84 SEC filings in 32 seconds. For one question, the workflow used VLM OCR on just two pages. LlamaParse then returned the richer details that matter in document analysis, including table structure, bounding boxes, and confidence scores. The demonstration searched for “organic sales” in 3M’s 2022 annual filing, focused on pages 24 and 25, and found that the Consumer segment reported a 0.9 percent organic decline. That is a worked example, not a benchmark of accuracy or cost savings. The tradeoff is recall. A cheap first pass can mishandle tables, miss images, or fail to detect pages without a text layer. In this collection, LiteParse flagged 2,605 pages for OCR, including 253 with embedded images and 75 with no text layer. LlamaIndex positions the shortcut for roughly 10 to 100 ad hoc documents. For repeatedly queried, audit-critical, or much larger collections—from about 1,000 to more than a million documents—it recommends visual OCR on every page. The key constraint is whether the first pass can reliably surface everything worth reading.

Story brief

3 key points

LlamaIndex’s new just-in-time OCR pattern is designed for small, one-off document collections: run inexpensive text extraction across everything, retrieve candidate pages, then use LlamaParse’s visual processing only on the evidence that matters. In its example, LiteParse scanned 12,013 pages from 84 SEC filings in 32 seconds, while VLM OCR handled two pages for one question. The tradeoff is recall: missed tables,...

  1. 01

    LiteParse flagged 2,605 pages for OCR, including 253 with embedded images and 75 lacking a text layer.

  2. 02

    LlamaIndex recommends the two-pass workflow for roughly 10–100 documents, not repeatedly queried or audit-critical datasets.

  3. 03

    For offline indexing of about 1,000 to more than 1 million documents, LlamaIndex recommends VLM OCR on every page.

LlamaIndex has published a two-pass document workflow that performs low-cost extraction across an uploaded collection, retrieves likely source pages, then applies VLM-based OCR only where a closer visual read is needed. Its just-in-time agentic OCR approach is aimed at small, ad-hoc data rooms, where parsing every page with a vision-language model can add cost and delay.

The first pass produces text that is useful for keyword or semantic search, even when it is not a perfect rendering of the original document. After retrieval narrows the search, LlamaParse can take page numbers as input and return table structure, bounding boxes, and confidence scores for the pages selected for deeper processing.

One worked example, two VLM-processed pages
84Filings in the test set

LlamaIndex’s example used 84 SEC filings.

12,013Pages in the collection

LiteParse processed the collection in text mode in 32 seconds, according to LlamaIndex.

2Pages given VLM OCR

For one FinanceBench question, the workflow applied VLM OCR to two pages out of the full collection.

The cheap scan is not the final answer

In LlamaIndex’s demonstration, a grep search for “Organic sales” landed on page 25 of 3M’s 2022 10-K. The workflow then ran its visual parsing step on pages 24 and 25, identifying Consumer as the segment with a 0.9% organic decline. It is a company-reported result from one worked example, not a broad measure of workflow accuracy or savings.

Where the two-pass approach stops fitting

The method relies on the first pass surfacing the right material. LlamaIndex notes that a low-cost scan can mishandle tables or miss scanned pages, which can prevent retrieval from finding relevant evidence. In its filing set, LiteParse marked 2,605 pages as needing OCR, including 253 with embedded images and 75 without a text layer.

LlamaIndex’s workload split

  • For ad-hoc collections of roughly 10 to 100 documents, it recommends cheap extraction, retrieval, then targeted VLM parsing.
  • For offline pipelines indexing roughly 1,000 to more than 1 million documents, it recommends VLM-based OCR on every page before indexing.
  • For accuracy-critical extraction into a system of record, it also favors full-document processing so fields can be audited.

That makes the new workflow a workload-specific shortcut, not a replacement for comprehensive document processing. When a collection will be queried repeatedly, or every extracted field needs verification, LlamaIndex’s guidance is to pay for a visual read before building the index.

Sources

  1. llamaindex.aiJust-in-Time Agentic OCR

Loading discussion...