<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Pageindex on OHTLY Blog</title>
    <link>https://blog.ohtly.com/tags/pageindex/</link>
    <description>Recent content in Pageindex on OHTLY Blog</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Thu, 09 Jul 2026 15:51:22 +0800</lastBuildDate>
    <atom:link href="https://blog.ohtly.com/tags/pageindex/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>四种 PageIndex 检索方案的 Token 消耗对比</title>
      <link>https://blog.ohtly.com/posts/2026-07-09-pageindex-token-comparison/</link>
      <pubDate>Thu, 09 Jul 2026 15:21:34 +0800</pubDate>
      <guid>https://blog.ohtly.com/posts/2026-07-09-pageindex-token-comparison/</guid>
      <description>&lt;h2 id=&#34;背景&#34;&gt;&#xA;  背景&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e8%83%8c%e6%99%af&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;PageIndex 是一个无向量（vectorless）、基于推理（reasoning-based）的 RAG 框架。核心思路是将文档解析为树状索引，让 LLM 通过推理来导航定位内容，而不是靠向量相似度搜索。&lt;/p&gt;&#xA;&lt;p&gt;这次实验的数据源是一本人教版《物理必修第二册》扫描版 PDF。因为纯扫描件没有文字层，先用 MinerU（vlm-engine）OCR 提取了结构化文本，再插入 &lt;code&gt;&amp;lt;!-- page N --&amp;gt;&lt;/code&gt; 标记以使页码可追溯。最后用 PageIndex 对这份带页码的 markdown 建立树索引。&lt;/p&gt;&#xA;&lt;p&gt;基于同一份数据，实现了四种检索方案，对比它们的实现差异和 Token 消耗。&lt;/p&gt;&#xA;&lt;h2 id=&#34;四种方案的设计差异&#34;&gt;&#xA;  四种方案的设计差异&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e5%9b%9b%e7%a7%8d%e6%96%b9%e6%a1%88%e7%9a%84%e8%ae%be%e8%ae%a1%e5%b7%ae%e5%bc%82&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;h3 id=&#34;方案-a简单查询&#34;&gt;&#xA;  方案 A：简单查询&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%96%b9%e6%a1%88-a%e7%ae%80%e5%8d%95%e6%9f%a5%e8%af%a2&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;两步走，两次独立 LLM 调用：&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LLM #1 看树结构 → 返回行号范围&#xA;LLM #2 取内容 → 回答&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;没有验证步骤，LLM 一次定生死。&lt;/p&gt;&#xA;&lt;h3 id=&#34;方案-b手写-agent-循环&#34;&gt;&#xA;  方案 B：手写 Agent 循环&#xA;  &lt;a class=&#34;heading-link&#34; href=&#34;#%e6%96%b9%e6%a1%88-b%e6%89%8b%e5%86%99-agent-%e5%be%aa%e7%8e%af&#34;&gt;&#xA;    &lt;i class=&#34;fa-solid fa-link&#34; aria-hidden=&#34;true&#34; title=&#34;链接到标题&#34;&gt;&lt;/i&gt;&#xA;    &lt;span class=&#34;sr-only&#34;&gt;链接到标题&lt;/span&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;三步走，三次独立 LLM 调用：&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;LLM #1 identify_ranges → 返回候选行号列表&#xA;LLM #2 evaluate → 判断内容是否包含答案&#xA;LLM #3 final_answer → 基于内容给出最终回答&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;写了 for 循环遍历候选清单，显式 evaluate 确认命中后才回答。&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
