Qmd zh

From L-LesterYu/OpenClaw-hot-skills-zh · View interactive version

Qmd zh is an AI agent skill from the GitHub repository L-LesterYu/OpenClaw-hot-skills-zh. 本地混合搜索 Markdown 笔记和文档。适用于搜索笔记、查找相关内容或从已索引的文档集合中检索文档。

How to use this skill

Skill file

qmd - 快速 Markdown 搜索

适用于 Markdown 笔记、文档和知识库的本地搜索引擎。一次索引,快速搜索。

适用场景(触发短语)

默认行为(重要)

前置条件

安装 Bun(macOS):brew install oven-sh/bun/bun

安装

bun install -g https://github.com/tobi/qmd

配置

qmd collection add /path/to/notes --name notes --mask "**/*.md"
qmd context add qmd://notes "此集合的描述"  # 可选
qmd embed  # 首次运行以启用向量 + 混合搜索

索引范围

搜索模式

性能说明

常用命令

qmd search "查询词"             # 默认
qmd vsearch "查询词"
qmd query "查询词"
qmd search "查询词" -c notes     # 搜索指定集合
qmd search "查询词" -n 10        # 返回更多结果
qmd search "查询词" --json       # JSON 格式输出
qmd search "查询词" --all --files --min-score 0.3

实用选项

文档检索

qmd get "path/to/file.md"       # 完整文档
qmd get "#docid"                # 按搜索结果中的 ID 检索
qmd multi-get "journals/2025-05*.md"
qmd multi-get "doc1.md, doc2.md, #abc123" --json

维护

qmd status                      # 索引健康状态
qmd update                      # 重新索引已变更的文件
qmd embed                       # 更新嵌入向量

保持索引最新

自动化索引流程,确保在添加/编辑笔记时搜索结果保持最新。

定时任务示例(cron):

# 每小时增量更新(保持 BM25 索引最新):
0 * * * * export PATH="$HOME/.bun/bin:$PATH" && qmd update

# 可选:每晚更新嵌入向量(可能较慢):
0 5 * * * export PATH="$HOME/.bun/bin:$PATH" && qmd embed

如果你的 Clawdbot/Agent 环境支持内置调度器,可以在那里运行相同的命令,而非使用系统 cron。

模型与缓存

与 Clawdbot 记忆搜索的关系

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.