返回顶部
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
安全检测
已通过
163
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

doc-search

文档搜索

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.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部