claudeers.
// Uncategorized / Others

PageIndex

πŸ“‘ PageIndex: Document Index for Vectorless, Reasoning-based RAG

Install with your AI

Paste into Claude Code, Cursor, or any agent β€” it reads the repo and wires the tool into your project.

Install and set up PageIndex (pip project) into my current project.
Found on https://claudeers.com/pageindex
Repo: https://github.com/VectifyAI/PageIndex
Homepage/docs: https://pageindex.ai
Detected install method: pip β†’ pip install pageindex
Category: uncategorized. Platforms: cli, api, web.
Read the repo's README for exact setup and env vars, then install it and wire it into my project.

Claudeers Health Verdict:
unknown; community-verified: false. Confirm the source before running anything.
// or install directly (pip)
pip install pageindex
// or clone
git clone https://github.com/VectifyAI/PageIndex

// compatibility

Platformscli, api, web
Operating systemsβ€”
AI compatibilityclaude
LicenseMIT
Pricingopen-source
LanguagePython
PageIndex Banner

VectifyAI%2FPageIndex | Trendshift

PageIndex: Vectorless, Reasoning-based RAG

Reasoning-based RAGΒ  β—¦ Β No Vector DB, No ChunkingΒ  β—¦ Β Context-Aware RetrievalΒ  β—¦ Β Reads Like a Human

🌐 WebsiteΒ  β€’ Β  πŸ–₯️ Chat PlatformΒ  β€’ Β  πŸ”Œ MCP & APIΒ  β€’ Β  πŸ“– DocsΒ  β€’ Β  πŸ’¬ DiscordΒ  β€’ Β  βœ‰οΈ ContactΒ 

pip install pageindex
export OPENAI_API_KEY=...        # your own LLM key β€” PageIndex runs on it
from pageindex import PageIndexClient

client = PageIndexClient()                                  # local mode
doc_id = client.submit_document("report.pdf")["doc_id"]     # build the tree index
print(client.chat("What was the 2023 operating margin?", doc_id=doc_id))

No vector DB, no chunking, no embedding model β€” the whole thing runs on your machine, calling your own LLM provider. Jump to the quickstart ↓

πŸ“’ Updates

  • πŸ”₯ PageIndex SDK β€” pip install 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.
  • ⚑ PageIndex Flash β€” tree structure generation from PDFs in seconds, with structure extracted heuristically instead of by an LLM.
  • Agentic Vectorless RAG β€” a simple agentic, vectorless RAG example with self-hosted PageIndex, using OpenAI Agents SDK.
  • 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 Chat β€” Human-like document analysis agent platform for professional long documents. Also available via MCP or API.
  • PageIndex Framework β€” Deep dive into PageIndex: an agentic, in-context tree index that enables LLMs to perform reasoning-based, context-aware retrieval over long documents.

πŸ“‘ What is PageIndex?

Are you frustrated with vector database retrieval accuracy for long professional 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 flips to the right section of a long report. Retrieval happens in two steps:

  1. Index β€” turn the document into a β€œtable-of-contents” tree structure
  2. Retrieve β€” search that tree with LLM reasoning, agentically
PageIndex

🎯 Why it works

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

Vector RAGPageIndex
Indexembeddings in a vector DBtree structure of the document itself
Unitfixed-size chunksnatural sections
Retrievalapproximate similarity searchLLM reasoning over the tree
Resultopaque, β€œvibe retrieval”traceable to explicit sections and page numbers
Contextquery embedding onlyfull context: conversation history, domain knowledge

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

PageIndex achieved state-of-the-art 98.7% accuracy on FinanceBench (financial document QA benchmark), vastly outperforming vector-based RAG β€” see Benchmarks.

⚑ Quickstart

1. Install

pip install pageindex

Local mode and the agent surfaces below require pageindex >= 0.2.10. Python 3.10+.

2. Set your LLM key

Local mode needs your own LLM provider key β€” PageIndex calls it both to index (node summaries) and to answer. Export it, or put it in a .env file next to your script:

export OPENAI_API_KEY=your_openai_key_here
# .env
OPENAI_API_KEY=your_openai_key_here

Any provider LiteLLM supports works β€” set that provider's key (ANTHROPIC_API_KEY, …) and pass a provider-prefixed model name (anthropic/claude-sonnet-4-6, bedrock/…). For a self-hosted OpenAI-compatible server (vLLM, TGI, Ollama), point OPENAI_BASE_URL at it and set OPENAI_API_KEY to whatever token it expects.

This is not a PageIndex key β€” local mode never talks to our servers. A PageIndex API key is only for cloud mode, where the managed LLM is included.

3. Index a document, then ask

from pageindex import PageIndexClient

client = PageIndexClient(                     # local mode β€” uses OPENAI_API_KEY
    index_model="gpt-5.6-luna",               # builds the tree: a cheap model is enough
    chat_model="gpt-5.6-sol",                 # answers questions: this is what drives accuracy
)
doc_id = client.submit_document("report.pdf")["doc_id"]

answer = client.chat("What was the 2023 operating margin, and where is it stated?",
                     doc_id=doc_id)
print(answer)

Those two are also the defaults, so PageIndexClient() on its own gives you the same thing β€” but the two roles are worth naming, because the rule of thumb is spend on the chat model, not the index model:

  • index_model β€” a weak model is fine. Flash reads the hierarchy out of the PDF's own layout, so the model is not inventing the structure; it only writes the node summaries. Dropping to a cheaper model barely changes the tree, and it is a one-off cost per document either way.
  • chat_model β€” use the best you can afford. This is the model that reasons over the tree, decides what to open, and reads the pages. It is where accuracy actually comes from, and it is billed per question (see Benchmarks).

What just happened:

  • submit_document parsed the PDF and built its tree index, stored under ./.pageindex. Indexing is synchronous and one-off β€” later questions reuse the same doc_id.
  • chat ran a document-QA agent over that tree: it read the table of contents, reasoned about which sections could hold the answer, opened only those pages, and answered from them.
  • The answer is grounded in real sections and page numbers, so you can check it.

Or use PageIndex Cloud

Same client, same methods β€” pass an API key and the work happens on our servers, with the production OCR, tree-building, and retrieval pipeline behind it:

client = PageIndexClient(api_key="pi-...")
doc_id = client.submit_document("report.pdf", wait=True)["doc_id"]
print(client.chat("What was the 2023 operating margin?", doc_id=doc_id))

πŸ› οΈ Using PageIndex

🌲 Step 1: Build the tree index

submit_document defaults to Flash indexing: the structure is extracted from the PDF's own layout (no LLM), and a model is called only for node summaries and the tree-optimization expansion pass. It takes seconds.

doc_id = client.submit_document("report.pdf")["doc_id"]

Inspect what you got:

tree = client.get_document_structure(doc_id)    # titles, page ranges, summaries β€” no text
client.list_documents()                         # everything you have indexed

A PageIndex tree looks like this β€” a table of contents optimized for LLMs and agents:

{
  "title": "Financial Stability",
  "node_id": "0006",
  "start_index": 21,
  "end_index": 22,
  "summary": "The Federal Reserve ...",
  "nodes": [
    {
      "title": "Monitoring Financial Vulnerabilities",
      "node_id": "0007",
      "start_index": 22,
      "end_index": 28,
      "summary": "The Federal Reserve's monitoring ..."
    },
    {
      "title": "Domestic and International Cooperation and Coordination",
      "node_id": "0008",
      "start_index": 28,
      "end_index": 31,
      "summary": "In 2023, the Federal Reserve collaborated ..."
    }
  ]
}

See more example documents and generated tree structures.

Naming models, and where documents are stored
client = PageIndexClient(
    index_model="gpt-5.6-luna",              # tree: node summaries + expansion pass
    chat_model="anthropic/claude-sonnet-4-6",# answering, on another provider
    storage_path=".pageindex",               # where indexed documents live
)

Model names mean what LiteLLM says they mean: a bare name goes to an OpenAI-compatible backend (selected by OPENAI_API_KEY / OPENAI_BASE_URL), and a provider/model name reaches that provider directly with its own key. Write openai/Qwen/... for a self-hosted server that itself serves slashed ids.

The two roles can sit on different providers. model="..." sets both at once, and a per-call model= on the chat surfaces overrides chat_model for that question.

Just the tree, without the client
from pageindex import page_index_flash, page_index

result = page_index_flash("report.pdf")        # heuristic structure + LLM summaries
result = page_index("report.pdf")              # full LLM-built tree

Or from the command line, in this repo:

python3 run_pageindex.py --pdf_path /path/to/your/document.pdf
python3 run_pageindex.py --md_path  /path/to/your/document.md   # markdown, by "#" heading level
Optional CLI parameters

The structure-tuning flags from --toc-check-pages down require --mode standard; --optimize requires Flash mode.

--mode                  Processing mode: flash (default) or standard
--index-model           LLM model used to index the document (default: gpt-5.6-luna)
--optimize              Tree optimization for retrieval: full (default), merge, or off
--toc-check-pages       Pages to check for table of contents (default: 20)
--max-pages-per-node    Max pages per node (default: 10)
--max-tokens-per-node   Max tokens per node (default: 20000)
--if-add-node-id        Add node ID (yes/no, default: yes)
--if-add-node-summary   Add node summary (yes/no, default: yes)
--if-add-doc-description Add doc description (yes/no, default: yes)

Markdown mode note: headings are read from # levels, so the file must be correctly formatted. If your Markdown was converted from PDF or HTML, most converters destroy the hierarchy β€” use PageIndex OCR, which is built to preserve it.

πŸ’¬ Step 2: Ask questions

chat() is the one-line surface. Underneath it is a document-QA agent, and you can talk to it over whichever protocol your stack already speaks:

client.chat("What changed in the risk factors?", doc_id=doc_id)            # β†’ answer string
client.chat(question, doc_id=doc_id, stream=True)                          # β†’ text chunks
client.chat_completions(messages, doc_id=doc_id)                           # OpenAI Chat Completions envelope
client.responses("...", doc_id=doc_id, reasoning={"effort": "high"})       # OpenAI Responses (agentic)
client.messages("...", model="claude-sonnet-4-6", doc_id=doc_id)           # Anthropic Messages
  • chat β€” sugar over chat_completions: pass a string or a role/content history, get the answer back.
  • chat_completions β€” the same engine with the full envelope: token usage, streaming metadata, finish_reason.
  • responses β€” the agentic surface. The whole process transcript (including tool outputs) rides in items; append it to your next call's input to keep the agent's memory and the provider's prompt cache warm. Local mode, Responses-capable backends.
  • messages β€” Claude-native, via the Anthropic SDK's tool runner (pip install 'pageindex[anthropic]'). Local mode.

Pass a list of ids to doc_id to search several documents at once, and keep it identical across a conversation's calls.

πŸ€– Step 3: Put PageIndex inside your own agent

Instead of calling PageIndex's agent, hand PageIndex's tools to yours. One call fills every slot:

# OpenAI Agents SDK
from agents import Agent, Runner
agent = Agent(**client.openai_agent_config(doc_id=doc_id))
result = Runner.run_sync(agent, "Summarize the auditor's concerns.")

# Anthropic SDK tool runner            (pip install 'pageindex[anthropic]')
runner = anthropic_client.beta.messages.tool_runner(
    **client.anthropic_runner_config(model="claude-sonnet-4-6", doc_id=doc_id),
    messages=[{"role": "user", "content": "Summarize the auditor's concerns."}],
)

# Claude Agent SDK                     (pip install 'pageindex[claude]')
options = ClaudeAgentOptions(**client.claude_agent_config(doc_id=doc_id))

# Anything else β€” plain Python functions for LangChain, PydanticAI, ...
tools = client.agent_tools()

Each *_config helper is sugar over the explicit pieces β€” client.agent_instructions() for the system prompt and client.as_openai_tools() / as_anthropic_tools() / as_claude_mcp() for the tools β€” so you can swap in your own prompt whenever you need to. Locally, doc_id is enforced at the tool layer, not just prompted: out-of-scope lookups return NOT_FOUND.

python3 examples/agentic_vectorless_rag_demo.py

☁️ Local or Cloud

The same PageIndexClient runs both. Omit api_key for local, pass one for cloud.

Local (this repo)Cloud (API key)
Parsingstandard PDF text extractionPageIndex OCR β€” built to preserve document hierarchy
Scanned / image-only PDFsnot supportedsupported
LLMyours β€” bring a provider key (OPENAI_API_KEY, …) and pay that providermanaged, included with your PageIndex key
Storage./.pageindex on diskhosted library, folders, search
Where data goesnever leaves your machinePageIndex Cloud
Image retrieval & understandingnot supported β€” text layer onlysupported
Citations & referencespage-levelline-level
Extrasβ€”folders, hosted search, MCP server

PageIndexCloudClient / PageIndexLocalClient pin the mode explicitly if you would rather not infer it from api_key.

The cloud service is also available as a ChatGPT-style chat platform, or via MCP and API. For dedicated or private deployment (VPC, on-prem), contact us or book a demo.

πŸ“Š Benchmarks

What indexing costs

Building a tree locally runs about $0.001 per page with index_model="gpt-5.6-luna" β€” so a 1,000-page textbook costs a little over a dollar and a few minutes, once, and every later question reuses it. Measured over nine PDFs, from a 9-page whitepaper to a 1,098-page textbook, 2,800 pages in total.

The index model is not the bottleneck. PageIndex is designed not to rely heavily on the model used at index time, so in our experiments a cheap 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.

Open-source PageIndex, running locally

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.

PageIndex leads a finance QA benchmark

Mafin 2.5, a reasoning-based RAG system for financial document analysis powered by PageIndex, reached a state-of-the-art 98.7% accuracy on FinanceBench, far ahead of vector-based RAG systems on SEC filings and earnings disclosures.

PageIndex

Explore the full benchmark results and the blog post.

🧭 Resources

  • πŸ“ Blog: technical articles, research insights, and product updates.
  • πŸ”§ Developer: MCP setup, API docs, and integration guides.
  • πŸ§ͺ Cookbooks: hands-on, runnable examples and advanced use cases β€” try the Vectorless RAG and the OCR-free, vision-based Vision RAG notebooks in Colab.
  • πŸ“– Tutorials: practical guides and strategies, including Document Search and Tree Search.

⭐ Support Us

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

PageIndex

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},
}

🌐 Open-Source Ecosystem

PageIndex anchors a growing open-source ecosystem of long-context AI infra β€” OpenKB is an LLM knowledge base that compiles documents into an interlinked wiki. ChatIndex provides tree indexing and retrieval for long conversational histories and memory. ConDB is a KV-cache native context database for tree-based retrieval at scale. PageIndex MCP is PageIndex's MCP server.

Connect with Us

Β  Β  Β  Β  Β 


Β© 2026 Vectify AI

// faq

What is PageIndex?

πŸ“‘ PageIndex: Document Index for Vectorless, Reasoning-based RAG. It is open-source on GitHub.

Is PageIndex free to use?

PageIndex is open-source under the MIT license, so it is free to use.

What category does PageIndex belong to?

PageIndex is listed under uncategorized in the Claudeers registry of Claude-compatible tools.

1 views
β˜… 35,251 stars
unclaimed
updated 3 days ago

// embed badge

PageIndex on Claudeers
[![Claudeers](https://claudeers.com/api/badge/pageindex.svg)](https://claudeers.com/pageindex)

// retro hit counter

PageIndex hit counter
[![Hits](https://claudeers.com/api/counter/pageindex.svg)](https://claudeers.com/pageindex)

// reviews

// guestbook

0/500

// related in Uncategorized / Others

πŸ”“

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

// uncategorizedn8n-io/⟨TypeScriptβŸ©β˜… 201,386β—· NOASSERTION[ claude ]
πŸ”“

The agent engineering platform.

// uncategorizedlangchain-ai/⟨PythonβŸ©β˜… 144,291β—· MIT[ claude ]
πŸ”“

FULL Augment Code, Claude Code, Cluely, CodeBuddy, Comet, Cursor, Devin AI, Junie, Kiro, Leap.new, Lovable, Manus, NotionAI, Orchids.app, Perplexity, Poke, Q…

// uncategorizedx1xhlol/β˜… 142,855β—· GPL-3.0[ claude ]
πŸ”“

100+ AI Agent & RAG apps you can actually run β€” clone, customize, ship.

// uncategorizedShubhamsaboo/⟨PythonβŸ©β˜… 133,607β—· Apache-2.0[ claude ]

// built by

β†’ see how PageIndex connects across the ecosystem