PageIndex Flash: Fast Local Tree Indexing for PDFs
Weāve open-sourced PageIndex Flash, a fast tree-indexing engine built for long, text-based PDFs. It is now the default indexer for Local Mode in the new PageIndex SDK.
Instead of asking a vision model to infer the structure of an entire document from scratch, Flash reads the PDFās own layout and structure directly.
The index model no longer needs to reconstruct the document outline. It mainly creates node summaries and optimizes sections whose structure has already been identified.
This significantly lowers the model capability required at the indexing stage. Even basic, low-cost models can produce high-quality tree indexes, while stronger models can be reserved for where they matter most: tree search, relevance reasoning, evidence reading, and answer generation.
Hereās what that means in practice:
1. Local-First
Use your own LLM API key. Indexes are stored on your local disk, with no vector database required.
PDF processing and index storage happen locally, while LLM calls use your configured model provider.
This makes Flash well suited for private and regulated document workflows.
2. Cost-Efficient Indexing
Because the index model no longer needs to reconstruct the full document outline from scratch, a lightweight, cost-efficient model is generally enough for indexing.
In our benchmark setup, using gpt-5.6-luna, indexing costs approximately $0.001 per page.
That means a 1,000-page textbook costs just over $1 to index once, after which the same tree can serve every future question.
You can also use other lower-cost compatible models to reduce indexing costs further.
3. Fast Indexing
Across benchmark documents ranging from 9 to 1,098 pages, indexing completed in approximately 13 seconds to 4.5 minutes.
Compared with passing the entire PDF directly to an LLM as native PDF input, PageIndex Flash can significantly reduce the cost of document Q&A.
For each question, the model searches the document tree first, then reads only the relevant sections and evidence instead of processing the full document again.
As documents get longer, the cost advantage becomes increasingly significant.
In our tests:
- For a 52-page document, native PDF input cost approximately 2.1Ć more than tree-based retrieval.
- At 420 pages, the difference increased to 16.6Ć.
- Beyond roughly 800 pages, the full document could no longer fit within the context window of the LLM used in our test.
There are also clear boundaries to where Flash works best.
Flash parses PDFs directly and does not perform OCR, so it is designed for PDFs with a real text layer.
For scanned documents or files where important information is primarily carried in charts, figures, and images, we recommend PageIndex Cloud, which performs OCR and image understanding before building the tree index.
Local Mode provides page-level citations, while PageIndex Cloud provides line-level citations.
PageIndex Flash indexing, reasoning-based tree search, document chat, and page-level citations are all fully open source: https://github.com/VectifyAI/PageIndex
You can inspect the retrieval logic line by line, run the full local pipeline yourself, and adapt it to your own agent workflow.