用语义节点检索精准定位技能文档片段,大幅减少提示词用量。
SkillPager: Query-Adaptive Intra-Skill Navigation via Semantic Node Retrieval

- 将技能文档拆解为带类型语义节点,离线构建索引
- 在线查询时用MMR算法选出最适执行上下文,保有78.89%足够性
- 相比全文提示节省47%令牌,适合高效率智能体应用
基于技能的大型语言模型代理越来越多依赖长篇流程文档,但全文档提示会浪费令牌并稀释关键信息。本文将此问题定义为技能内检索,目标是在给定查询下从已知技能文档中选取最小且足以执行的上下文。我们提出SkillPager,一种两阶段框架:离线将Markdown技能文档解析为带类型的语义节点,线上利用最大边际相关性(MMR)进行全局、查询相关的节点选择。在包含395个技能和1,975个查询的基准上,SkillPager实现78.89%的LLM评估上下文足够性,优于82.23%的全文档基线,同时减少47.04%的提示令牌。粒度消融实验表明,对固定长度块使用相同检索算法可达到81.77%足够性,但令牌开销增加28.81%,说明效率提升源于类型化语义粒度而非算法本身。在图基基线中,SkillPager领先最强基线12.16%。进一步消融显示,支持内容应保留在候选池中并自适应选择,而非被静态规则剔除。这些结果表明,类型化文档内检索是技能代理的独特访问问题。
原文摘要 · Abstract (English)
Skill-based LLM agents increasingly rely on long procedural documents, but full-document prompting wastes tokens and dilutes information critical to execution. We study this setting as intra-skill retrieval, where the goal is to select a minimal, execution-sufficient context from a known skill document given a query. We present SkillPager, a two-stage framework that parses each Markdown skill into typed semantic nodes offline and leverages Maximal Marginal Relevance (MMR) to perform global, query-conditioned node selection online. On a benchmark of 395 skills and 1,975 queries, SkillPager achieves 78.89% LLM-judged context sufficiency, compared to 82.23% for the exhaustive full-document baseline, while reducing prompt tokens by 47.04%. A granularity ablation shows that applying the same retrieval algorithm to raw fixed-length chunks reaches a comparable 81.77% sufficiency but increases token cost by 28.81%, demonstrating that efficiency gains are driven by typed semantic granularity rather than the retrieval algorithm alone. Among graph-based baselines, SkillPager outperforms the strongest baseline by a margin of 12.16%. Further ablations show that supporting content is most effective when retained in the candidate pool and selected adaptively rather than removed by static heuristics. These results identify typed intra-document retrieval as a distinct access problem for skill-based agents.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。