
PageIndex
Lets an AI find answers in long documents by reading a table-of-contents-style tree, not vector search.
- Stars
- 40k
- Forks
- 3.4k
- Licence
- MIT
- Language
- Python
- Last update
- 7 days ago
- Type
- Library
What it is
PageIndex is a Python library that builds a hierarchical tree index of a document, similar to a table of contents, and then uses an LLM to reason through that tree to find the relevant sections. It is aimed at long, complex professional documents such as financial reports, legal filings, and manuals, where the README says vector similarity search often returns the wrong passages. It does not use a vector database or split documents into chunks.
- Ask questions about a long financial filing and get an answer linked to the relevant section
- Index a textbook or technical manual once, then query it repeatedly
- Plug PageIndex retrieval tools into an agent framework such as the OpenAI Agents SDK, per the README
Great for
- Developers building question-answering over long PDFs such as annual reports or manuals
- Teams who want retrieved answers to be traceable to explicit sections of a document
- Projects that already have access to an LLM API key and can afford per-query model calls
- Users with a Claude subscription who want to use Claude Code models through the SDK
Not ideal for
- People who need a fast, very cheap search over huge collections, since the README says each query relies on LLM reasoning over the tree and cost depends on the chosen model
- Users who want a no-code tool; the README centers on a Python SDK and API
- Short or simple documents, where the README's positioning suggests ordinary retrieval is enough
How to get it
- 1
Install with a package manager
You'll need: Python · An LLM API key such as OpenAI, or a Claude subscription via Claude Code
Install the package
pip install -U pageindex - 2
Run it
- Install the package with pip.
- Set your LLM API key as an environment variable.
- Create a PageIndexClient with index and chat model names.
- Submit a PDF with submit_document to get a doc_id.
- Ask a question with client.chat and the doc_id.
- 3
Get the most out of it
- Use a basic model for index= and the strongest affordable model for chat=, as the README recommends
- Use the Claude Code option (pip install -U "pageindex[claude]") if you have a Claude subscription
- Explore multi-document search and citations via the SDK docs linked in the README
- Check the financial QA benchmark repo to compare model cost and accuracy before choosing one
Downloads
Strengths
- The README describes retrieval with explicit, traceable references rather than opaque similarity scores
- No vector database or chunking step is required, according to the README
- Released under the MIT license with a published PyPI package
Trade-offs
- Each query calls an LLM, so answer cost and speed depend on the model you choose; the README reports benchmark figures but your results will vary
- The benchmarks and cost numbers are published by the project itself and rely on its own test setup
- The README is truncated and does not fully document limits or edge cases
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| PageIndex (this) | 40k | Library | intermediate | 7 days ago | Developers building question-answering over long PDFs such as annual reports or manuals |
| llama_index | 52.8k | Library | intermediate | 10 days ago | Python developers building retrieval-augmented generation (RAG) apps over private documents |
| langchain | 149k | Framework | intermediate | 4 days ago | Python developers building LLM-powered applications |
| anything-llm | 67.8k | App | beginner | 6 days ago | People who want a private ChatGPT-style assistant over their own PDFs and text files |
| Prompt-Engineering-Guide | 79.8k | Learning resource | beginner | 8 months ago | People who are new to prompting and want structured lessons with examples |
| serviette | 58.7k | App | intermediate | 21 days ago | Teams that want a chat over internal documents without writing code |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.