闲社服务运行正常AI智能体自动化平台
d

文档搜索

技能标识:doc-search

Search a local document library (Obsidian vault, wiki, notes, etc.) using BM25 inverted index + LLM query expansion + grep for precise location. Use when the user asks to find, look up, or search for information in their local docs/notes/vault.Triggers on "find in docs", "look up X in vault", "搜索文档", "查找笔记", "文档里有没有

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

文档搜索

文档搜索

BM25倒排索引 + LLM查询扩展 + grep。零外部依赖。

工作流程

每次按以下顺序执行步骤:

步骤 1 — 确定文档目录

检查用户是否提及文档目录。如果没有,则询问:

我应该搜索哪个目录?(例如 ~/obsidian, ~/notes)

步骤 2 — 检查索引是否存在

bash
ls /.cache/index.json

  • - 如果缺失 → 跳转到步骤 3(先构建索引)
  • 如果存在 → 跳转到步骤 4

步骤 3 — 构建索引

bash
python3 ~/.claude/skills/doc-search/scripts/buildindex.py dir>

索引保存至 /.doc-search/index.json。后续运行会增量更新。

步骤 4 — 扩展查询词

在搜索之前,将用户的查询扩展为包含同义词、中英文变体以及可能的标题。合并为一个字符串:

获取音色列表 → 获取 查询 list voice 音色 tts ListVoice 音色列表

步骤 5 — BM25搜索

bash
python3 ~/.claude/skills/doc-search/scripts/search.py <扩展后的查询> \
--docs-dir --topk 5

输出:JSON数组 [{path, rel, score, title, summary}, ...]

步骤 6 — 对前K个结果进行精确定位的grep搜索

对每个结果文件,使用原始关键词进行grep搜索:

bash
grep -ni -e 关键词1 -e 关键词2 /path/to/doc.md

向用户报告文件路径及匹配行号。

选项

标志默认值描述
--topk5BM25结果数量
--ext
md,txt,rst,org | 要索引的文件扩展名 | | --index | /.doc-search/index.json | 覆盖索引路径 |

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 doc-search-1775886731 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 doc-search-1775886731 技能

通过命令行安装

skillhub install doc-search-1775886731

下载

⬇ 下载 doc-search v1.0.0(免费)

文件大小: 7.5 KB | 发布时间: 2026-4-12 09:45

v1.0.0 最新 2026-4-12 09:45
- Initial release of doc-search: search local document libraries using BM25, LLM query expansion, and grep.
- Supports Chinese and English queries, synonyms, and custom query expansions.
- Zero external dependencies; uses simple bash and Python scripts.
- Step-by-step workflow includes index building, query expansion, and line-precise grep results.
- Flexible options for file extensions, result count, and index location.
返回顶部