This commit is contained in:
windyboy
2026-01-21 08:46:13 +08:00
parent 20d354d97d
commit 4add1512a9
43 changed files with 32064 additions and 33516 deletions
@@ -0,0 +1,164 @@
---
title: "VectifyAI/PageIndex: 📑 PageIndex: Document Index for Vectorless, Reasoning-based RAG"
source: "https://github.com/VectifyAI/PageIndex"
author:
- "[[rejojer]]"
published:
created: 2026-01-20
description: "📑 PageIndex: Document Index for Vectorless, Reasoning-based RAG - VectifyAI/PageIndex"
tags:
- "clippings"
- "webclipper"
---
> [!info] Source
> URL: https://github.com/VectifyAI/PageIndex
> Title: VectifyAI/PageIndex: 📑 PageIndex: Document Index for Vectorless, Reasoning-based RAG
> Clipped:
**[PageIndex](https://github.com/VectifyAI/PageIndex)** Public
📑 PageIndex: Document Index for Vectorless, Reasoning-based RAG
[pageindex.ai](https://pageindex.ai/ "https://pageindex.ai")
[MIT license](https://github.com/VectifyAI/PageIndex/blob/main/LICENSE)
[Open in github.dev](https://github.dev/) [Open in a new github.dev tab](https://github.dev/) [Open in codespace](https://github.com/codespaces/new/VectifyAI/PageIndex?resume=1)
[![PageIndex Banner](https://private-user-images.githubusercontent.com/13518252/474974981-46201e72-675b-43bc-bfbd-081cc6b65a1d.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Njg4NzI2MzYsIm5iZiI6MTc2ODg3MjMzNiwicGF0aCI6Ii8xMzUxODI1Mi80NzQ5NzQ5ODEtNDYyMDFlNzItNjc1Yi00M2JjLWJmYmQtMDgxY2M2YjY1YTFkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAxMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMTIwVDAxMjUzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA2OTBlNGQ5OTY3NjljYzQ0MTZiZjA1NTA1ZTVlMjE3NWM5NDdjZTgwZGRhMDMzMDcyYzQ1OTBhY2E5ZTZlNGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.MYpYzCx3WDx7RmyRYnT9k62hAj0j4zutV7Yfz8t25x0)](https://vectify.ai/pageindex)
[![VectifyAI%2FPageIndex | Trendshift](https://camo.githubusercontent.com/62b2c1c71f903121cb378334c98ab301cc540e0f76cdcd64497b4d2367fcaf07/68747470733a2f2f7472656e6473686966742e696f2f6170692f62616467652f7265706f7369746f726965732f3134373336)](https://trendshift.io/repositories/14736)
**Reasoning-based RAG ◦ No Vector DB ◦ No Chunking ◦ Human-like Retrieval**
**🔥 Releases:**
- [**PageIndex Chat**](https://chat.pageindex.ai/): The first human-like document-analysis agent [platform](https://chat.pageindex.ai/) built for professional long documents. Can also be integrated via [MCP](https://pageindex.ai/mcp) or [API](https://docs.pageindex.ai/quickstart) (beta).
**📝 Articles:**
- [**PageIndex Framework**](https://pageindex.ai/blog/pageindex-intro): Introduces the PageIndex framework — an *agentic, in-context* *tree index* that enables LLMs to perform *reasoning-based*, *human-like retrieval* over long documents, without vector DB or chunking.
**🧪 Cookbooks:**
- [Vectorless RAG](https://docs.pageindex.ai/cookbook/vectorless-rag-pageindex): A minimal, hands-on example of reasoning-based RAG using PageIndex. No vectors, no chunking, and human-like retrieval.
- [Vision-based Vectorless RAG](https://docs.pageindex.ai/cookbook/vision-rag-pageindex): OCR-free, vision-only RAG with PageIndex's reasoning-native retrieval workflow that works directly over PDF page images.
---
Are you frustrated with vector database retrieval accuracy for long professional documents? Traditional vector-based RAG relies on semantic *similarity* rather than true *relevance*. But **similarity ≠ relevance** — what we truly need in retrieval is **relevance**, and that requires **reasoning**. When working with professional documents that demand domain expertise and multi-step reasoning, similarity search often falls short.
Inspired by AlphaGo, we propose **[PageIndex](https://vectify.ai/pageindex)** — a **vectorless**, **reasoning-based RAG** system that builds a **hierarchical tree index** from long documents and uses LLMs to **reason** *over that index* for **agentic, context-aware retrieval**. It simulates how *human experts* navigate and extract knowledge from complex documents through *tree search*, enabling LLMs to *think* and *reason* their way to the most relevant document sections. PageIndex performs retrieval in two steps:
1. Generate a “Table-of-Contents” **tree structure index** of documents
2. Perform reasoning-based retrieval through **tree search**
[![](https://camo.githubusercontent.com/e9c3f93a4039fa4743b0655dc7a08eddd0eeb24ed1bfddfb03b6a0bf3c87cbdc/68747470733a2f2f646f63732e70616765696e6465782e61692f696d616765732f636f6f6b626f6f6b2f766563746f726c6573732d7261672e706e67)](https://pageindex.ai/blog/pageindex-intro "The PageIndex Framework")
### 🎯 Features
Compared to traditional vector-based RAG, **PageIndex** features:
- **No Vector DB**: Uses document structure and LLM reasoning for retrieval, instead of vector similarity search.
- **No Chunking**: Documents are organized into natural sections, not artificial chunks.
- **Human-like Retrieval**: Simulates how human experts navigate and extract knowledge from complex documents.
- **Better Explainability and Traceability**: Retrieval is based on reasoning — traceable and interpretable, with page and section references. No more opaque, approximate vector search (“vibe retrieval”).
PageIndex powers a reasoning-based RAG system that achieved **state-of-the-art** [98.7% accuracy](https://github.com/VectifyAI/Mafin2.5-FinanceBench) on FinanceBench, demonstrating superior performance over vector-based RAG solutions in professional document analysis (see our [blog post](https://vectify.ai/blog/Mafin2.5) for details).
To learn more, please see a detailed introduction of the [PageIndex framework](https://pageindex.ai/blog/pageindex-intro). Check out this GitHub repo for open-source code, and the [cookbooks](https://docs.pageindex.ai/cookbook), [tutorials](https://docs.pageindex.ai/tutorials), and [blog](https://pageindex.ai/blog) for additional usage guides and examples.
The PageIndex service is available as a ChatGPT-style [chat platform](https://chat.pageindex.ai/), or can be integrated via [MCP](https://pageindex.ai/mcp) or [API](https://docs.pageindex.ai/quickstart).
- Self-host — run locally with this open-source repo.
- Cloud Service — try instantly with our [Chat Platform](https://chat.pageindex.ai/), or integrate with [MCP](https://pageindex.ai/mcp) or [API](https://docs.pageindex.ai/quickstart).
- *Enterprise* — private or on-prem deployment. [Contact us](https://ii2abc2jejf.typeform.com/to/tK3AXl8T) or [book a demo](https://calendly.com/pageindex/meet) for more details.
- Try the [**Vectorless RAG**](https://github.com/VectifyAI/PageIndex/blob/main/cookbook/pageindex_RAG_simple.ipynb) notebook — a *minimal*, hands-on example of reasoning-based RAG using PageIndex.
- Experiment with [*Vision-based Vectorless RAG*](https://github.com/VectifyAI/PageIndex/blob/main/cookbook/vision_RAG_pageindex.ipynb) — no OCR; a minimal, reasoning-native RAG pipeline that works directly over page images.
---
PageIndex can transform lengthy PDF documents into a semantic **tree structure**, similar to a *"table of contents"* but optimized for use with Large Language Models (LLMs). It's ideal for: financial reports, regulatory filings, academic textbooks, legal or technical manuals, and any document that exceeds LLM context limits.
Below is an example PageIndex tree structure. Also see more example [documents](https://github.com/VectifyAI/PageIndex/tree/main/tests/pdfs) and generated [tree structures](https://github.com/VectifyAI/PageIndex/tree/main/tests/results).
You can generate the PageIndex tree structure with this open-source repo, or use our [API](https://docs.pageindex.ai/quickstart)
---
You can follow these steps to generate a PageIndex tree from a PDF document.
```
pip3 install --upgrade -r requirements.txt
```
Create a `.env` file in the root directory and add your API key:
```
CHATGPT_API_KEY=your_openai_key_here
```
```
python3 run_pageindex.py --pdf_path /path/to/your/document.pdf
```
**Optional parameters**
You can customize the processing with additional optional arguments:
```
--model OpenAI model to use (default: gpt-4o-2024-11-20)
--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 support**
We also provide markdown support for PageIndex. You can use the \`-md\_path\` flag to generate a tree structure for a markdown file.
```
python3 run_pageindex.py --md_path /path/to/your/document.md
```
> Note: in this function, we use "#" to determine node heading and their levels. For example, "##" is level 2, "###" is level 3, etc. Make sure your markdown file is formatted correctly. If your Markdown file was converted from a PDF or HTML, we don't recommend using this function, since most existing conversion tools cannot preserve the original hierarchy. Instead, use our [PageIndex OCR](https://pageindex.ai/blog/ocr), which is designed to preserve the original hierarchy, to convert the PDF to a markdown file and then use this function.
---
[Mafin 2.5](https://vectify.ai/mafin) is a reasoning-based RAG system for financial document analysis, powered by **PageIndex**. It achieved a state-of-the-art [**98.7% accuracy**](https://vectify.ai/blog/Mafin2.5) on the [FinanceBench](https://arxiv.org/abs/2311.11944) benchmark, significantly outperforming traditional vector-based RAG systems.
PageIndex's hierarchical indexing and reasoning-driven retrieval enable precise navigation and extraction of relevant context from complex financial reports, such as SEC filings and earnings disclosures.
Explore the full [benchmark results](https://github.com/VectifyAI/Mafin2.5-FinanceBench) and our [blog post](https://vectify.ai/blog/Mafin2.5) for detailed comparisons and performance metrics.
[![](https://private-user-images.githubusercontent.com/8255061/440120069-571aa074-d803-43c7-80c4-a04254b782a3.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Njg4NzI2MzYsIm5iZiI6MTc2ODg3MjMzNiwicGF0aCI6Ii84MjU1MDYxLzQ0MDEyMDA2OS01NzFhYTA3NC1kODAzLTQzYzctODBjNC1hMDQyNTRiNzgyYTMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDEyMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjAxMjBUMDEyNTM2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MDFiMzJiMzgxYWU5NjhkZmQzOTVlMzkzN2I1ZmRlMWQxOGQ2ZDlmYjJjYjBmZDA2NDQ4NDc4YjMyOTU3Yjk3NiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.oiuAlY5zkAAemIDf-jl1jf89HL7uW6YBvZQHn-i-8VI)](https://github.com/VectifyAI/Mafin2.5-FinanceBench)
---
## 🧭 Resources
- 🧪 [Cookbooks](https://docs.pageindex.ai/cookbook/vectorless-rag-pageindex): hands-on, runnable examples and advanced use cases.
- 📖 [Tutorials](https://docs.pageindex.ai/doc-search): practical guides and strategies, including *Document Search* and *Tree Search*.
- 📝 [Blog](https://pageindex.ai/blog): technical articles, research insights, and product updates.
- 🔌 [MCP setup](https://pageindex.ai/mcp#quick-setup) & [API docs](https://docs.pageindex.ai/quickstart): integration details and configuration options.
---
Leave us a star 🌟 if you like our project. Thank you!
[![](https://private-user-images.githubusercontent.com/13518252/481667856-eae4ff38-48ae-4a7c-b19f-eab81201d794.gif?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Njg4NzI2MzYsIm5iZiI6MTc2ODg3MjMzNiwicGF0aCI6Ii8xMzUxODI1Mi80ODE2Njc4NTYtZWFlNGZmMzgtNDhhZS00YTdjLWIxOWYtZWFiODEyMDFkNzk0LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAxMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMTIwVDAxMjUzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEyNzA4ZDQxMmI2MjhiOGVkODU3MTMxOWFhNTE0Mjg4MzdkOWI3N2Q4ZmY4MTY2MDk3NDZlZjE1YzcwNWJlZjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pSfTU0Lp63eIF6U3IbkEbdIwr2_U4ZL708xLqslt8uQ)](https://private-user-images.githubusercontent.com/13518252/481667856-eae4ff38-48ae-4a7c-b19f-eab81201d794.gif?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Njg4NzI2MzYsIm5iZiI6MTc2ODg3MjMzNiwicGF0aCI6Ii8xMzUxODI1Mi80ODE2Njc4NTYtZWFlNGZmMzgtNDhhZS00YTdjLWIxOWYtZWFiODEyMDFkNzk0LmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjAxMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYwMTIwVDAxMjUzNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWEyNzA4ZDQxMmI2MjhiOGVkODU3MTMxOWFhNTE0Mjg4MzdkOWI3N2Q4ZmY4MTY2MDk3NDZlZjE1YzcwNWJlZjkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.pSfTU0Lp63eIF6U3IbkEbdIwr2_U4ZL708xLqslt8uQ)
---
© 2025 [Vectify AI](https://vectify.ai/)
## Releases
No releases published
## Packages
No packages published
## Languages
- [Python 100.0%](https://github.com/VectifyAI/PageIndex/search?l=python)