PageIndex README

The project's README from github.com/VectifyAI/PageIndex. As one markdown file: README.md.

pi_github_banner_low

VectifyAI%2FPageIndex | Trendshift

PageIndex: Vectorless, Reasoning-based RAG

Reasoning-based RAG  ◦  No Vector DB, No Chunking  ◦  Context-Aware Retrieval  ◦  Reads Like a Human

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

Updates

  • [Aug '26] 🔥 PageIndex SDK: pip install -U pageindex now ships local mode: index, retrieve, and chat entirely on your machine with your own LLM key, or point the same client at PageIndex Cloud with an API key.
  • [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

PageIndex is a vectorless, reasoning-based RAG engine that mirrors how humans read, delivering traceable, explainable, and context-aware retrieval, with no vector DBs or chunking.

Compare with Vector RAG

Vector RAG PageIndex
Index vector index tree index
Unit fixed-size chunks natural sections
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-5.6-luna",               # model to build the tree index
    chat="gpt-5.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

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-OSS-Benchmark measures exactly the setup in the quickstart above (PageIndexClient() in local mode, flash indexing, no OCR) on 62 lookup questions over 34 PDFs (1,945 pages) drawn from MMLongBench-Doc-V2. Every question's answer is a fact stated in running text, so a wrong answer is a retrieval or reading failure, not a reasoning one.

Accuracy against average cost per question. Each model forms a near-vertical reasoning-effort ladder; moving between models costs an order of magnitude a step.

Full results, data, and the runner 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-5.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))
Capability Local (this repo) Cloud (get an API key)
Best for text-heavy PDFs and local workflows scanned, image-heavy, and large document collections
Indexing runs locally runs in PageIndex Cloud, with production OCR and image understanding
Storage local managed in PageIndex Cloud
Chat model your model your model, or the managed chat included with your key
Citations page-level line-level
Image understanding — ✅
Multi-document scale manual PageIndex File System
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.
Or use the BibTeX citation.
@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

PageIndex (VectifyAI/PageIndex)

Searching Database…

39.3K ·GitHub
这是什么?PageIndex 是一个无向量、基于推理的 RAG(检索增强生成)引擎。它不使用向量数据库,也不做文本分块,而是构建一个层级树状索引来映射文档的结构,然后让大语言模型沿着这棵树推理,找到相关章节,就像人类专家翻到报告中的正确部分一样。
这是独立应用,还是我可以集成到自己代码里的东西?它是一个用 pip 安装、在你自己的智能体或应用中调用的 Python SDK/库。它附带的工具可以直接接入 OpenAI Agents SDK、Claude Agent SDK 等框架,而不是作为独立的聊天应用运行。
我该怎么把它跑起来?用 'pip install -U pageindex' 安装,然后使用 SDK 客户端为文档建立索引(构建树),并对其运行 retrieve/chat。你可以完全在本地使用自己的大模型密钥运行,也可以使用 API 密钥连接 PageIndex Cloud。
使用它需要大模型 API 密钥吗?需要。建索引和对话都要由你提供自己的大模型密钥。构建树状索引时基础模型就够用,但 README 建议在对话/检索环节使用你负担得起的最好模型,因为真正在树上进行推理的是这一步。
它能处理扫描件或图片较多的 PDF 吗?不能,至少在开源的本地模式下不能。它是为以文字为主的 PDF 设计的。扫描件、OCR 和图像理解需要付费的 PageIndex Cloud 版本。
这东西适合处理哪类文档?篇幅长、结构复杂的专业文档,这类文档中上下文和多步推理比关键词相似度更重要。
和基于向量的 RAG 相比,PageIndex 准确率如何?在 FinanceBench(一个金融文档问答基准测试)上,PageIndex 达到了 98.7% 的准确率,远超基于向量的 RAG 方法。
给文档建索引要花多少钱?使用基础模型在本地构建树状索引,大约每页 0.001 美元,因此一本 1000 页的教科书只需略超一美元、几分钟时间,而且之后每个问题都可以复用这份索引。
我能把 PageIndex 接入现有的智能体框架吗?可以。它提供了可以直接接入 OpenAI Agents SDK、Claude Agent SDK 或你已在使用的其他任何智能体框架的工具。
PageIndex Cloud 相比开源版多了什么?PageIndex Cloud 为你代管索引和存储,并新增了生产级 OCR、图像理解、行级引用、MCP 服务器,以及用于在数百万份文档间扩展检索的 PageIndex File System。
Creator
VectifyAI
Size
28.8 MB
Stars
39.3K
Age
1y
Commits · 90 Days