About this project

PageIndex is an open-source retrieval-augmented generation (RAG) engine that replaces vector similarity search with a hierarchical tree index and LLM reasoning. The project argues that similarity is not the same as relevance, and that relevance on long professional documents requires reasoning rather than embedding lookup. How it works: retrieval happens in two steps. First, an index step generates a tree-structure index for each document. Second, a retrieve step agentically searches that tree using LLM reasoning, similar to how a human expert navigates a long report. The README states the tree structure is extracted from document layout without an LLM, with the index model only summarizing and refining it, so a basic model is said to suffice at index time. The chat model, which searches the tree, is where the README recommends using the best model available. Installation and usage: the SDK is installed with pip install -U pageindex. A PageIndexClient is configured with an index model and a chat model, a document is submitted to obtain a doc_id, and questions are asked via client.chat(). The README notes a local mode that runs indexing, retrieval and chat on the user's machine with their own LLM key, and a cloud mode that points the same client at PageIndex Cloud using an API key. Cloud mode is described as handling parsing, OCR, image understanding, tree-index construction and managed storage, with line-level citations and an MCP server, while local mode is positioned for text-heavy PDFs and local workflows with page-level citations. The README also describes integration with agent frameworks such as the OpenAI Agents SDK and Claude Agent SDK, and a PageIndex File System layer for reasoning over an entire corpus rather than a single document. Reported benchmarks in the README include local indexing cost of roughly $0.001 per page, indexing times of about 13 seconds to 4.5 minutes for documents from 9 to 1,098 pages, a comparison claiming native PDF input costs 2.1x more at 52 pages and 16.6x more at 420 pages, and a reported 98.7% accuracy on FinanceBench. These figures come from the project's own documentation and benchmark repository and are not independently verified here. Target use cases named in the README include financial reports, legal documents, regulatory filings, technical manuals, medical literature and academic textbooks.