PageIndex 每个文档过一遍llm不会很慢吗

📅 发布时间:2026/7/7 7:25:10 👁️ 浏览次数:
PageIndex 每个文档过一遍llm不会很慢吗
这是关于 PageIndex 的概述文档。PageIndex 是一个向量无关、基于推理的 RAG 框架它通过构建文档的层次树结构索引并使用 LLM 对该索引进行推理来实现检索模拟人类专家导航复杂文档的方式 1 。核心特点无需向量数据库使用文档结构和 LLM 推理进行检索而非向量相似性搜索 2无需分块文档按自然章节组织而非人工分块 3类人检索模拟人类专家导航和提取知识的过程 4主要功能文档主要介绍了 PageIndex Cloud API SDK包括文档处理 API提交文档、获取树结构、检查处理状态 5聊天完成 API基于文档的交互式问答支持流式响应 6PageIndexClient SDK提供 Python 客户端接口 7使用方式云服务通过 chat.pageindex.ai 平台或 API 使用本地部署使用开源代码自行运行企业版私有化或本地部署该框架在 FinanceBench 基准测试中达到了 98.7% 的准确率展示了在专业文档分析方面的优越性能 8 。Notes文档还包含了多个实用示例简单向量无关 RAG、视觉向量无关 RAG、智能检索和聊天快速入门等支持处理复杂 PDF 文档提供 PageIndex OCR 服务以保持文档的原始层次结构可通过 MCPModel Context Protocol集成到 Claude、Cursor 等工具中Wiki pages you might want to explore:PageIndex Cloud API SDK (VectifyAI/PageIndex)CitationsFile:README.md (L53-57)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**File:README.md (L68-68)- **No Vector DB**: Uses document structure and LLM reasoning for retrieval, instead of vector similarity search.File:README.md (L69-69)- **No Chunking**: Documents are organized into natural sections, not artificial chunks.File:README.md (L70-70)- **Human-like Retrieval**: Simulates how human experts navigate and extract knowledge from complex documents.File:README.md (L73-73)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).File:cookbook/pageindex_RAG_simple.ipynb (L131-136)from pageindex import PageIndexClient\n, import pageindex.utils as utils\n, \n, # Get your PageIndex API key from https://dash.pageindex.ai/api-keys\n, PAGEINDEX_API_KEY \YOUR_PAGEINDEX_API_KEY\\n, pi_client PageIndexClient(api_keyPAGEINDEX_API_KEY)File:cookbook/pageindex_RAG_simple.ipynb (L321-326)if pi_client.is_retrieval_ready(doc_id):\n, tree pi_client.get_tree(doc_id, node_summaryTrue)[result]\n, print(Simplified Tree Structure of the Document:)\n, utils.print_tree(tree)\n, else:\n, print(\Processing document, please try again later...\)File:cookbook/agentic_retrieval.ipynb (L342-347)for chunk in pi_client.chat_completions(\n, messages[{\role\: \user\, \content\: query}],\n, doc_iddoc_id,\n, streamTrue\n, ):\n, print(chunk, end, flushTrue)PageIndex 通过分层处理和轻量推理避免每次查询都让整个文档过 LLM从而控制延迟 1 。为什么不会很慢索引生成是一次性的文档提交后由后台异步生成树结构客户端轮询状态直到就绪而不是每次查询都重建索引 2 。检索时只推理节点摘要树搜索阶段移除全文text仅用轻量的 node_id/title/summary 让 LLM 做路径选择极大减少输入长度 3 。按需提取全文只有在确定相关节点后才从树中提取对应节点的完整文本用于生成答案避免无关内容进入 LLM 4 。流式与并发优化Chat API 支持流式返回云服务可并行处理多文档减少用户感知延迟 5 。实际表现在 FinanceBench 上达到 98.7% 准确率的同时推理式检索在专业长文档上仍保持可用速度说明架构设计已平衡精度与效率 6 。Notes如果对延迟敏感可优先使用 PageIndex 云服务其后台做了 OCR 与索引的并行优化本地部署则需自行管理 LLM 调用并发与缓存。视觉 RAG 场景下甚至跳过 OCR直接用页面图像做视觉推理进一步减少文本处理开销 7 。Wiki pages you might want to explore:PageIndex Cloud API SDK (VectifyAI/PageIndex)CitationsFile:README.md (L53-57)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**File:README.md (L73-73)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).File:cookbook/pageindex_RAG_simple.ipynb (L321-326)if pi_client.is_retrieval_ready(doc_id):\n, tree pi_client.get_tree(doc_id, node_summaryTrue)[result]\n, print(Simplified Tree Structure of the Document:)\n, utils.print_tree(tree)\n, else:\n, print(\Processing document, please try again later...\)File:cookbook/pageindex_RAG_simple.ipynb (L357-375)tree_without_text utils.remove_fields(tree.copy(), fields[text])\n, \n, search_prompt f\\\\n, You are given a question and a tree structure of a document.\n, Each node contains a node id, node title, and a corresponding summary.\n, Your task is to find all nodes that are likely to contain the answer to the question.\n, \n, Question: {query}\n, \n, Document tree structure:\n, {json.dumps(tree_without_text, indent2)}\n, \n, Please reply in the following JSON format:\n, {{\n, \thinking\: \Your thinking process on which nodes are relevant to the question\,\n, \node_list\: [\node_id_1\, \node_id_2\, ..., \node_id_n\]\n, }}\n, Directly return the final JSON structure. Do not output anything else.\n, \\\\n,File:cookbook/pageindex_RAG_simple.ipynb (L484-489)node_list json.loads(tree_search_result)[\node_list\]\n, relevant_content \\\n\\n\.join(node_map[node_id][\text\] for node_id in node_list)\n, \n, print(Retrieved Context:\\n)\n, utils.print_wrapped(relevant_content[:1000] ...) ]File:cookbook/agentic_retrieval.ipynb (L342-347)for chunk in pi_client.chat_completions(\n, messages[{\role\: \user\, \content\: query}],\n, doc_iddoc_id,\n, streamTrue\n, ):\n, print(chunk, end, flushTrue)File:cookbook/vision_RAG_pageindex.ipynb (L70-74) **If a VLM can already process both the document images and the query to produce an answer directly, do we still need the intermediate OCR step?**\n, \n, In this notebook, we give a practical implementation of a vision-based question-answering system for long documents, without relying on OCR. Specifically, we use PageIndex as a reasoning-based retrieval layer and OpenAIs multimodal GPT-4.1 as the VLM for visual reasoning and answer generation.\n, \n, See the original [blog post](https://pageindex.ai/blog/do-we-need-ocr) for a more detailed discussion on how VLMs can replace traditional OCR pipelines in document question-answering.