Tool

PageIndex

PageIndex searches long documents through a hierarchical tree index and language-model reasoning without a vector database.


88
Spark score
out of 100
Updated 5 days ago
Source checked Nov 18, 2026
Version 0.7.1

Add to Favorites

Source

Get it from source

Spark does not host a copy of it.

Open source

Reports

Agent outcome reports

No reports yet

Overview

PageIndex builds hierarchical document indexes for reasoning-based retrieval. Its SDK offers local text-PDF workflows and a Cloud option for managed indexing and richer document processing. Use it for questions over long professional documents, choosing local or Cloud mode according to document type, citations, and storage requirements.

What it does

PageIndex retrieves information from long documents by building a hierarchical tree index and letting a language model reason through that structure. It replaces vector similarity search with a document-oriented navigation process, avoiding a vector database and fixed chunking. The result can be traced to explicit references, while retrieval can take conversation history and domain context into account.

Document retrieval workflow

The workflow has two stages: generate a document's tree index, then search the tree through model reasoning. It suits long professional material such as financial reports, legal documents, regulatory filings, technical manuals, medical literature, and academic textbooks. The distinction matters when a relevant passage is contextually connected to a question without being semantically similar to its wording.

The SDK supports indexing, retrieval, and chat in local mode using your own model key. PageIndex Flash is the default local indexing method for text-based PDFs. Document layout supplies the initial tree structure; the index model summarizes and refines it. A basic model can handle that indexing role, while the chat model performs retrieval and reading. The same client can instead address a cloud-hosted index.

Getting started

Install the SDK with:

pip install -U pageindex

PageIndexClient accepts separate index and chat model settings. Submit a PDF to obtain a doc_id, then pass that identifier with a question to chat. The client also supports streaming, multi-document search, and citations. PageIndex tools can be incorporated into the OpenAI Agents SDK, Claude Agent SDK, or another agent framework.

Local and Cloud choices

Local mode handles text-based PDFs and keeps the index in a local directory, with page-level citations. It uses your own model key; running indexing locally does not remove that model-provider requirement. Cloud mode moves parsing, index construction, and managed storage to PageIndex and requires a PageIndex API key configured as PAGEINDEX_API_KEY, with index="cloud" selecting that mode. Its chat and retrieval layer can use a compatible model from the provider your application already uses.

Cloud adds OCR and image understanding for scanned and image-rich documents, block-level citations, metadata, folders, and an MCP server. PageIndex File System is a Cloud-only tree layer across files for corpus-level navigation. These Cloud capabilities should be distinguished from the local text-PDF workflow.

Interpreting the benchmarks

Reported local indexing measurements covered nine PDFs from 9 to 1,098 pages, taking about 13 seconds to 4.5 minutes and approximately $0.001 per page with the named index-model setup. These are measured examples, not fixed pricing or latency guarantees. The local retrieval benchmark covers 62 lookup questions over 34 PDFs totaling 1,945 pages, using Flash indexing without OCR.

A separate FinanceBench result reports 98.7% accuracy. Native-PDF cost comparisons depend on model, document size, and excluded prompt caching; they do not establish universal savings. Choose the deployment mode according to document content and storage needs, and evaluate retrieval on the questions your documents actually require.

Source README
pi_github_banner_low

PageIndex: Vectorless, Reasoning-based RAG

🌐 Website  •   ☁️ Cloud  •   📖 Docs  •   📝 Blog  •   ✉️ Contact 

Updates

  • [Oct '26] 🔥 Page Search API: find the pages that answer each question in about a second, and send your LLM only those. Cut 97% token cost on document question answering; more accurate and faster than vector search (benchmark).
  • [Aug '26] PageIndex SDK: local and cloud modes - one client to index, retrieve, and chat on your machine (with your own LLM API key) or on PageIndex Cloud.
  • [Aug '26] ⚡ PageIndex Flash: fast tree index generation for text-based PDFs, now the default indexing method in PageIndex SDK local mode.
  • Scale PageIndex to Millions of Documents: PageIndex File System is a file-level tree indexing layer that lets PageIndex reason over an entire corpus, not just a single document.
  • PageIndex App: a human-like document analysis agent for long professional documents.

What is PageIndex?

Are you frustrated with vector database retrieval accuracy for long and complex documents? Vector-based RAG retrieves by semantic similarity. But similarity ≠ relevance - what retrieval actually needs is relevance, and relevance requires reasoning. On professional documents that demand contextual understanding, domain expertise, and multi-step reasoning, similarity search misses what is relevant but not similar, and returns what is similar but not relevant.

Inspired by AlphaGo, PageIndex replaces the vector index with a hierarchical tree index and lets an LLM reason its way through it, the way a human expert turns to and reads the right section of a long report. Retrieval happens in two steps:

  1. Index: generate a tree-structure index for each document
  2. Retrieve: agentically search that tree with LLM reasoning
TL;DR
Compare with Vector RAG
Vector RAG PageIndex
Index vector index tree index
Retrieval semantic similarity search LLM reasoning over the tree
Result opaque, “vibe retrieval” traceable to explicit references
Context query embedding only full context: conversation history, domain knowledge, etc.

It is ideal for financial reports, legal documents, regulatory filings, technical manuals, medical literature, academic textbooks, and any other long, complex professional document.

Quickstart

pip install -U pageindex
import os
from pageindex import PageIndexClient

os.environ["OPENAI_API_KEY"] = "your-openai-key"

client = PageIndexClient(
    index="gpt-6-luna",                 # model to build the tree index
    chat="gpt-6-sol",                   # model to search the tree
)
doc_id = client.submit_document("report.pdf")["doc_id"]

answer = client.chat("What was the 2023 operating margin?", doc_id=doc_id)
print(answer)
Model Recommendations
  • index=: a basic model is sufficient. The tree structure itself is extracted from the document layout without an LLM; the index model only summarizes and refines it, which a basic model does well.
  • chat=: use the best model you can afford. The chat model searches the tree to retrieve information. See Query cost and accuracy.

Have a Claude subscription? PageIndex can use your subscription to call Claude models through Claude Code: usage is covered by your plan, no API key needed. Install with pip install -U "pageindex[claude]", then prefix model names with claude-code/, e.g., index="claude-code/haiku", chat="claude-code/opus" (see example).

Use PageIndex through the SDK client →

Configure other models, streaming, multi-document search, citations, and more.

Integrate PageIndex with your own agent →

Drop PageIndex tools into the OpenAI Agents SDK, the Claude Agent SDK, or any other framework.

Benchmarks

Local indexing cost and time

Building a tree locally runs about $0.001 per page with gpt-5.6-luna as the index model, so a 1,000-page textbook costs a little over a dollar and a few minutes, once, and every later question reuses it. PageIndex is designed not to rely heavily on the model used at index time, so in our experiments a basic model does not hurt quality.

Indexing cost against document length, log-log, for nine PDFs from 9 to 1,098 pages. Points track a $0.0011-per-page reference line; the spread around it is text density, not length.

Indexing time also scales predictably with document length. In the same local setup, the benchmark documents (9 to 1,098 pages) finished in roughly 13 seconds to 4.5 minutes.

Indexing time against document length, log-log, for nine PDFs from 9 to 1,098 pages. The measured indexing times range from about 13 seconds to 4.5 minutes and increase predictably with document length.

Query cost and accuracy

PageIndex Financial QA Benchmark compares the accuracy and query cost of 34 configurations of 19 LLMs answering 100 questions over 40 Form 10-K filings from 8 companies, with PageIndex doing the retrieval. Cost is measured per 100-question run and excludes one-time indexing.

PageIndex Financial QA Benchmark: question answering accuracy versus cost per 100-question run across 19 models on 40 Form 10-K filings from 8 companies.

Full results, data, and reproduction instructions are in the benchmark repo.

Cost per query vs. native PDF input

The alternative to retrieval is handing the model the whole PDF on every question. That cost grows with the document; PageIndex's does not, because it reads only the nodes its reasoning reaches. On documents where both routes return the same answer, native PDF input costs 2.1× more at 52 pages and 16.6× more at 420 (gpt-5.6-sol, prompt caching excluded) - and at 805 pages the document no longer fits in the context window at all.

Cost per query relative to PageIndex retrieval, for five PDFs from 52 to 805 pages. Passing the PDF natively costs 2.1x, 3.4x, 7.8x, and 16.6x more at 52, 85, 198, and 420 pages; at 805 pages it exceeds the model's context window.

Leading accuracy on FinanceBench

PageIndex reached a state-of-the-art 98.7% accuracy on FinanceBench (financial document QA benchmark), vastly outperforming vector-based RAG.

FinanceBench accuracy: PageIndex 98.7%, vector RAG 50%.

Explore the full FinanceBench evaluation results and the blog post.

PageIndex Cloud

The open-source version is ideal for text-heavy PDFs and local workflows. With PageIndex Cloud, document indexing and storage run in the cloud: PageIndex handles parsing, OCR, image understanding, tree-index construction, and managed storage for you. The chat and retrieval layer remains compatible with your model, so you can search the cloud-hosted index using the model provider your application already uses.

Moving indexing and storage from Local to Cloud only requires a PageIndex API key:

import os
from pageindex import PageIndexClient

os.environ["PAGEINDEX_API_KEY"] = "your-pageindex-key"
os.environ["OPENAI_API_KEY"] = "your-openai-key"

client = PageIndexClient(
    index="cloud",                       # build and store the index in PageIndex Cloud
    chat="gpt-6-sol",                    # use your preferred compatible model for chat
)
doc_id = client.submit_document("report.pdf", wait=True)["doc_id"]
print(client.chat("What was the 2023 operating margin?", doc_id=doc_id))
Local Cloud
Handles Text-based PDFs Text-based, scanned, and image-rich documents
Indexing On your machine Managed by PageIndex
Storage Local directory Cloud storage
Citations Page-level Block-level
OCR & image understanding - ✓
Metadata - ✓
Folders - ✓
MCP server - ✓
More About PageIndex Cloud
Ready to Try It?

For dedicated deployment (VPC or on-premises), contact us or book a demo.


⭐ Support Us

Leave us a star 🌟 if you like our project. Thank you!

Please cite this work as:

Mingtian Zhang, Yu Tang and PageIndex Team,
"PageIndex: Next-Generation Vectorless, Reasoning-based RAG",
PageIndex Blog, Sep 2025.
@article{zhang2025pageindex,
  author = {Mingtian Zhang and Yu Tang and PageIndex Team},
  title = {PageIndex: Next-Generation Vectorless, Reasoning-based RAG},
  journal = {PageIndex Blog},
  year = {2025},
  month = {September},
  note = {https://pageindex.ai/blog/pageindex-intro},
}

© 2026 PageIndex AI

pageindex-wordmark-animated-288-warm

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.