Zero Labs
Industry News / AI

PageIndex: The RAG Framework That Threw Out Vector Databases and Still Hit 98.7% Accuracy

Source · Towards AI By Akshay Kalane

From the publisher’s feed, collected in the ZeroLabs newsroom.

How VectifyAI’s reasoning-based retrieval is quietly dismantling the most deep-rooted assumption in production RAGI’ve spent the better part of two years building and debugging RAG pipelines. Chunking strategies, embedding models, rerankers, hybrid search, I’ve tried most of the tricks in the book. So when I first heard about a framework that ditches vector databases entirely and still manages to outperform everything on a serious benchmark, my initial reaction was skepticism.Then I looked at the numbers.Traditional vector-based RAG scores roughly 30–50% on FinanceBench, the industry-standard benchmark for financial document QA. PageIndex, an open-source framework from VectifyAI, scores 98.7%. Not by finding a better embedding model. By throwing embeddings out entirely.Let that sit for a second. Financial QA on SEC filings is one of the hardest retrieval problems in production AI. Multi-step reasoning, cross-section references, exact numerical answers. And the system that came closest to perfection used zero vectors, zero chunking, and no vector database whatsoever.I went deep into PageIndex over the past week, the official blog, the GitHub repo, the cookbooks, the VentureBeat interview with the co-founder, and a few critical takes on Medium. This article is everything I found: what PageIndex actually does, the architecture under the hood, working Python code, where it genuinely shines, and where it falls flat.The Problem We Keep Papering OverIf you’ve built RAG systems for anything longer than a blog post, you’ve hit this wall. A user asks a system grounded on a 200-page annual report: “What was total net revenue in FY2024 compared to FY2023?”Your standard vector pipeline does its thing:Splits the document into fixed-size chunks (usually 300–500 tokens).Embeds each chunk using something like text-embedding-3-large.Stores the vectors in Pinecone, Weaviate, Milvus, Chroma, pgvector, pick your poison.At query time, embeds the question, fetches the top-k nearest vectors by cosine similarity.Feeds those chunks into the LLM for answer generation.This works great for short, unstructured content. Blog posts, support tickets, product docs. But throw a 10-K filing at it and things start falling apart in predictable ways. I’ve seen these failure modes over and over again in production:The query doesn’t look like the answer. Vector retrieval assumes that the text most semantically similar to the query is also the most relevant. But queries express intent, not content. Asking about revenue trends doesn’t surface the specific table row buried on page 47, it surfaces every paragraph that talks about revenue.“Operating income” appears 60 times. In a 200-page annual report, a term like “operating income” shows up dozens of times across different contexts. Vector similarity ranks them all roughly the same. The one that actually answers the question might never crack the top-3.Chunking butchers tables. This one drives me crazy. A financial table header ends up in chunk 14, the data row the user needs is in chunk 15. Neither chunk alone makes any sense. I’ve tried overlapping windows, semantic chunking, even table-aware parsers. They help, but they don’t solve the fundamental issue.No memory between turns. If a user asked about assets in the last message and now asks “what about liabilities?”, the retriever treats it as a brand new query. There’s no awareness that the user probably wants the same section of the same report.Cross-references are invisible. Page 12 says “see Appendix G for details.” Appendix G is on page 87. The text in the appendix has zero semantic similarity to the original query. Vector RAG will never, ever follow that reference. I’ve tried injecting cross-reference metadata into chunks as a workaround. It’s brittle and doesn’t scale.These aren’t edge cases. They’re baked into the architecture. Mingtian Zhang, co-founder of VectifyAI, put it bluntly in the project’s introductory blog post: what retrieval actually needs is relevance, and relevance requires reasoning.What PageIndex Actually IsPageIndex is a vectorless, reasoning-based RAG framework that came out of VectifyAI in September 2025, built by Mingtian Zhang (founder of VectifyAI, UCL alumnus) and Yu Tang. It’s open source under the MIT license, and the GitHub repo has exploded, over 23,000 stars and nearly 2,000 forks as of late March 2026.The core idea borrows from an unlikely place: AlphaGo. Instead of searching a space exhaustively (the way vector similarity scans all chunks), use a learned strategy to navigate it intelligently. PageIndex takes that principle and applies it to document retrieval.Three things make it different from anything else I’ve seen in the RAG space:No Vector DB. Document structure and LLM reasoning replace vector similarity search entirely. No Pinecone, no Chroma, no embeddings.No Chunking. Documents are organized into their natural sections, chapters, paragraphs, tables, not arbitrary 500-token windows.Human-like Navigation. The system works the way I’d work if I were manually searching a document: check the table of contents, find the section that probably has my answer, read it.The whole thing boils down to two steps.Step 1: Build a Hierarchical Tree IndexWhen you feed a document into PageIndex, it doesn’t embed anything. Instead, it analyzes the document’s structure and generates a hierarchical tree, think of it as a smart, LLM-optimized table of contents. Each node in the tree carries:A title (the section name)A summary (a short description of what the section covers)A page rangeChild nodes (subsections, nested recursively)A 50-page SEC filing might produce a tree with 30–50 nodes. The whole thing is stored as a JSON object. Not in a vector database. Just JSON. It fits inside a single LLM context window, and you can inspect every node directly.Here’s what a single node looks like:{ "node_id": "0006", "title": "Financial Stability", "start_index": 21, "end_index": 22, "summary": "Covers the Federal Reserve's financial stability oversight...", "sub_nodes": [ { "node_id": "0007", "title": "Monitoring Financial Vulnerabilities", "start_index": 22, "end_index": 28, "summary": "Describes the Fed's vulnerability monitoring framework..." }, { "node_id": "0008", "title": "Domestic and International Cooperation", "start_index": 28, "end_index": 31, "summary": "Federal Reserve collaboration with international bodies..." } ]}Each node_id maps to the actual raw content, text, tables, images, of that section. The LLM can grab the content of any node on demand.Here’s the key architectural insight that makes this work: unlike a vector database that stores a separate, static index of embeddings outside the model, this JSON tree lives inside the LLM’s active context during inference. VectifyAI calls it an in-context index. The model doesn’t just query it; it reasons over it in real time.Step 2: Reasoning-Based Tree SearchWhen a question comes in, PageIndex hands the tree structure (without the raw text, just titles and summaries) to the LLM and essentially asks: “Given this document structure and this question, where should we look?”The LLM reads through the node titles and summaries, thinks about which sections are likely to contain the answer, and returns a list of node IDs. Then the system fetches the actual content from those nodes.The retrieval follows a loop:Scan the ToC. Understand the document layout, identify candidate sections.Pick a section. Choose the node most likely to have what we need.Read it. Pull the raw text from that node.Enough? If yes, generate the answer. If not, go back to step 1 and try another section.This is a completely different paradigm from vector search. A vector DB computes cosine similarity for every chunk in parallel, fast but dumb. PageIndex asks the LLM to think about where the answer lives. The model can follow cross-references (“see Appendix G”), recognize that a question about appendix data should go to the appendix node, and figure out that a multi-part question needs content from two different sections.And every step leaves a reasoning trace. You can see exactly which nodes were visited and why. No more black-box retrieval.Why This Actually Works: The Appendix G ExampleThis is the example that convinced me. It comes from a real demo VectifyAI built using their MCP integration.Imagine someone asks about “total deferred assets” in a Federal Reserve annual report. The main body of the report (pages 75–82) discusses the change in deferred assets but never actually states the total. However, page 77 contains this sentence: “Table 5.3 summarizes the income, expenses, and distributions… Appendix G of this report provides more detailed information.”With vector RAG, you’re stuck. Appendix G is a table of numbers. It shares no semantic similarity with the query about deferred assets. The vector database ignores it completely.PageIndex handles it differently. The LLM reads the tree, navigates to the financial section, encounters the cross-reference to Appendix G, follows it through the tree structure, retrieves the relevant table from the appendix, and returns the exact number. The reasoning trace shows every hop.That’s the kind of thing that makes you rethink your entire retrieval stack.Python Implementation: End-to-End Vectorless RAGEnough theory. Here’s working code, adapted from the official PageIndex cookbook. I’ve added comments to make the flow clear.Installationpip install pageindex openaiSetupimport osimport jsonimport asynciofrom pageindex import PageIndexClientfrom openai import AsyncOpenAI# Grab an API key from https://dash.pageindex.ai/api-keysPAGEINDEX_API_KEY = os.environ["PAGEINDEX_API_KEY"]OPENAI_API_KEY = os.environ["OPENAI_API_KEY"]pi_client = PageIndexClient(api_key=PAGEINDEX_API_KEY)openai_client = AsyncOpenAI(api_key=OPENAI_API_KEY)Ingest a Document and Build the Treeimport pageindex.utils as utils# Upload a PDF; PageIndex handles the tree generationdoc = pi_client.upload("annual_report_2024.pdf")doc_id = doc["doc_id"]# Tree generation takes a bit, so we pollwhile not pi_client.is_retrieval_ready(doc_id): print("Still indexing...") import time; time.sleep(5)# Grab the tree and take a looktree = pi_client.get_tree(doc_id, node_summary=True)["result"]print("Document Tree:")utils.print_tree(tree)This prints the full nested structure, every section, subsection, and page range. It’s immediately obvious whether the tree captured the document’s layout correctly.The Core: LLM-Driven Tree SearchThis is where the magic happens. The LLM reads the tree and decides where to look.async def find_relevant_nodes(tree: dict, query: str) -> list: """LLM reasons over tree structure to identify relevant nodes.""" # Strip raw text to save tokens; the LLM only needs titles and summaries tree_without_text = utils.remove_fields( tree.copy(), fields=["text"] ) search_prompt = f""" You are a document retrieval expert. Given a question and a hierarchical tree structure of a document, identify all nodes likely to contain the answer. Each node has a node_id, title, and summary. Follow cross-references if a section mentions another. Question: {query} Document tree structure: {json.dumps(tree_without_text, indent=2)} Reply in this JSON format only: {{ "thinking": "", "node_list": ["node_id_1", "node_id_2"] }} """ response = await openai_client.chat.completions.create( model="gpt-4.1", messages=[{"role": "user", "content": search_prompt}], temperature=0, response_format={"type": "json_object"}, ) result = json.loads(response.choices[0].message.content) print(f"LLM reasoning: {result['thinking']}") return result["node_list"]Retrieve Content and Generate the Answerdef collect_node_content(tree: dict, node_ids: list) -> str: """Pull raw text from the nodes the LLM selected.""" all_nodes = utils.flatten_tree(tree) context_parts = [] for node in all_nodes: if node["node_id"] in node_ids: title = node.get("title", "Untitled") pages = f"pages {node.get('start_index', '?')}-{node.get('end_index', '?')}" text = node.get("text", "") context_parts.append( f"[{title} | {pages}]\n{text}" ) return "\n\n---\n\n".join(context_parts)async def answer_query(tree: dict, query: str) -> dict: """Full vectorless RAG pipeline: tree search + answer generation.""" # Step 1: LLM picks the nodes node_ids = await find_relevant_nodes(tree, query) # Step 2: Fetch content from those nodes context = collect_node_content(tree, node_ids) # Step 3: Generate answer with citations answer_prompt = f""" Answer the question using only the provided context. Cite specific pages and sections in your answer. Context: {context} Question: {query} """ response = await openai_client.chat.completions.create( model="gpt-4.1", messages=[{"role": "user", "content": answer_prompt}], temperature=0, ) return { "answer": response.choices[0].message.content, "retrieved_nodes": node_ids, "context_length": len(context), }# Run itquery = "What was the total value of deferred assets in 2023?"result = asyncio.run(answer_query(tree, query))print(result["answer"])print(f"Nodes used: {result['retrieved_nodes']}")Bonus: MCP IntegrationIf you’re working with Claude, Cursor, or any MCP-compatible agent, PageIndex plugs in directly:{ "mcpServers": { "pageindex": { "type": "http", "url": "https://api.pageindex.ai/mcp", "headers": { "Authorization": "Bearer your_api_key" } } }}There’s also a local MCP server for uploading files from disk (requires Node.js 18+):{ "mcpServers": { "pageindex": { "command": "npx", "args": ["-y", "@pageindex/mcp"] } }}The Benchmark Numbers (With Context)The headline result comes from FinanceBench, the standard benchmark for financial document QA. It uses real SEC filings (10-K, 10-Q, 8-K) and expects exact answers, no room for hand-waving.Mafin 2.5, VectifyAI’s financial analysis agent built on PageIndex, was tested on 100% of the dataset. Here’s how it stacks up:SystemAccuracyBenchmark CoverageMafin 2.5 (PageIndex)98.7%100%Traditional vector-based RAG~50%variesGPT-4o (direct, no RAG)~31%100%Perplexity~45%variesA ~49 percentage point gap over traditional vector RAG. That’s not incremental improvement; it’s a different class of result.What’s driving it? Three things keep showing up:Cross-reference following. PageIndex navigates in-document references like “see Appendix G” through the tree structure. Vector similarity has no concept of this.Structure preservation. Financial tables have headers, footnotes, and cell relationships. PageIndex keeps them intact as tree nodes. Chunking destroys them.Multi-step reasoning. Questions that need data from two separate sections (comparing FY2023 vs FY2024 when they’re reported in different parts of the filing) are handled naturally by the iterative loop.Where PageIndex Falls Short (And It Does)I’d be doing a disservice if I didn’t talk about the trade-offs honestly. PageIndex is impressive for its niche, but it’s not a drop-in replacement for vector RAG everywhere.It’s slower. Every retrieval involves multiple LLM calls: read the index, reason about nodes, fetch content, check if it’s enough, maybe loop again. Vector RAG returns in milliseconds. PageIndex takes several seconds. The VectifyAI co-founder has pointed out that because retrieval happens inline during generation (not as a blocking pre-step), time-to-first-token can be comparable to a normal LLM call. But total latency is still higher.It’s more expensive. Multiple LLM inference calls per query vs. a single embedding lookup. For high-volume applications, the cost math gets rough fast.It’s a depth tool, not a breadth tool. PageIndex is phenomenal at deep extraction from a single long document. But if you need to search across 10,000 short documents simultaneously? That’s where vector databases earn their keep. Building a tree for every document and reasoning over all of them isn’t practical at that scale.Bad structure in, bad retrieval out. The tree index is only as good as the document’s structure. A well-organized SEC filing with clear headings produces an excellent tree. A poorly formatted scanned PDF with no logical sections? The ToC degrades, and so does everything downstream. There’s a vision-based RAG mode for these cases, but structured docs remain the sweet spot.LLM reasoning isn’t perfect either. Vector RAG fails through embedding approximation. PageIndex fails through reasoning approximation. The model can navigate to the wrong section, misinterpret a summary, or skip a relevant sub-node. The failure mode is different, more interpretable, arguably more debuggable, but it doesn’t vanish.The 98.7% is on one benchmark. FinanceBench tests financial QA on well-structured SEC filings. Performance on messy, multi-domain, highly ambiguous queries across wildly different document types hasn’t been independently validated to the same degree. That 98.7% is real, but it’s important to understand exactly what it’s measuring.So When Should You Actually Use This?After spending a week with this framework, here’s my honest take on where it makes sense:Reach for PageIndex when:You’re dealing with long, structured professional documents, annual reports, legal contracts, regulatory filings, technical manuals.Accuracy matters more than speed. If a wrong answer costs real money or creates compliance risk, the latency trade-off is worth it.Queries need multi-step reasoning or cross-section navigation.You need audit trails. Every PageIndex answer comes with a full reasoning trace and node references. That’s gold for regulated industries.Stick with vector RAG when:You need sub-second responses at high query volume.You’re searching across a large corpus of short documents.Documents are unstructured or conversational.90% accuracy is good enough for the use case.Cost per query is the primary constraint.The hybrid play is probably underexplored. Use vector search to quickly identify which document in a large corpus is relevant, then hand it off to PageIndex for deep extraction. Best of both worlds.What’s Happened Since Launch (Recent Developments)PageIndex has moved fast since the September 2025 launch. A few things worth flagging if you’re evaluating it today:Agentic Vectorless RAG with OpenAI Agents SDK. This is the latest addition to the repo and probably the most exciting for anyone building agent systems. It’s a complete end-to-end example where a self-hosted PageIndex instance is wired into the OpenAI Agents SDK. The agent gets three tools, get_document(), get_document_structure(), and get_page_content(), and autonomously reasons over the tree index, calls the right tools, and retrieves content without any manual node selection. If you're building agentic workflows, this is the example to start with:pip install openai-agentspython3 examples/agentic_vectorless_rag_demo.pyVision-based Vectorless RAG (OCR-free). I glossed over this earlier, but it deserves its own mention. PageIndex now supports a vision-native pipeline that skips OCR entirely. Instead of extracting text from PDFs, it sends page images directly to a vision-capable LLM and builds the tree from what the model sees. This is a big deal for financial documents where the visual layout of a balance sheet or complex grid carries as much meaning as the text. Charts, tables with merged cells, footnote annotations, all of it stays intact because you’re never converting to text in the first place.JavaScript/TypeScript SDK. The Python SDK has been around since launch, but a TypeScript SDK (pageindex-js-sdk) shipped in early 2026 for developers building Node.js integrations or web-based document analysis tools.One-click MCP desktop extension (.mcpb). The MCP integration now supports a .mcpb bundle file format. You download the file, double-click it, and PageIndex is installed as a Claude Desktop Extension with OAuth handled automatically. It's the lowest-friction way to get PageIndex running with Claude.ChatIndex for conversations. VectifyAI also released a separate repo called ChatIndex, applying the same tree-indexing philosophy to long conversation histories rather than documents. Still early (January 2026), but it signals where the team is heading.The Bigger PicturePageIndex is part of a broader shift I’ve been watching across the AI tooling landscape: the move from passive retrieval (fetch whatever looks similar) to active, agentic retrieval (reason about where to look).It’s already happening in code. Claude Code and Cursor have moved away from vector-based RAG for code retrieval in favor of active codebase exploration. The PageIndex team believes document retrieval will follow the same trajectory, and after digging into this framework, I’m inclined to agree, at least for the structured-document use case.Vector databases aren’t going anywhere. They’re fast, cheap, and work well enough for a huge class of problems. But for the subset of use cases where correctness, transparency, and deep document understanding are non-negotiable, financial audits, legal discovery, medical records, regulatory compliance, reasoning-based retrieval isn’t just an alternative. It’s a fundamentally better fit.The retrieval game is changing. Worth keeping an eye on this one.Getting StartedGitHub: github.com/VectifyAI/PageIndex (MIT License, 23k+ stars)Agentic RAG Demo: examples/agentic_vectorless_rag_demo.pyChat Platform: chat.pageindex.aiAPI Docs: docs.pageindex.aiMCP Integration: pageindex.ai/mcpTypeScript SDK: github.com/VectifyAI/pageindex-js-sdkOfficial Blog Post: pageindex.ai/blog/pageindex-introPageIndex was created by Mingtian Zhang, Yu Tang, and the PageIndex team at VectifyAI (September 2025). If you found this useful, I write regularly about production RAG systems and LLM engineering. Follow along for more deep dives.PageIndex: The RAG Framework That Threw Out Vector Databases and Still Hit 98.7% Accuracy was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.