Files
openclaw-skill/skills/qmd-brain/SKILL.md
Selig 4c966a3ad2 Initial commit: OpenClaw Skill Collection
6 custom skills (assign-task, dispatch-webhook, daily-briefing,
task-capture, qmd-brain, tts-voice) with technical documentation.
Compatible with Claude Code, OpenClaw, Codex CLI, and OpenCode.
2026-03-13 10:58:30 +08:00

1.9 KiB
Raw Permalink Blame History

name, description, triggers, tools
name description triggers tools
qmd-brain 第二大腦知識庫搜尋與索引。用 qmdBM25+向量混合)搜尋本地 markdown 文件,並透過 PostgreSQL pgvector 進行深度語意搜尋。
搜尋
查找
找資料
recall
記憶
之前說過
知識庫
找到
我之前
幫我找
查一下
有沒有
搜一下
brain search
qmd
exec
memory

qmd-brain Skill

功能說明

第二大腦Second Brain知識庫搜尋工具整合兩層搜尋

層次 工具 特色
Layer 1 qmd (BM25 全文搜尋) 快速關鍵字比對,本地 SQLite
Layer 2 embed_to_pg (語意搜尋) 向量相似度PostgreSQL pgvector

觸發範例

使用者:「幫我找關於 nginx 設定的資料」
→ qmd search "nginx 設定" → 返回相關文件段落

使用者:「之前有記過 Telegram bot 的設定嗎?」
→ embed_to_pg search "Telegram bot token 設定" → 語意搜尋

使用者:「更新知識庫索引」
→ qmd embed + embed_to_pg embed

使用者:「查知識庫統計」
→ qmd collection list + embed_to_pg stats

搜尋策略

  1. 關鍵字搜尋qmd search適合確定的詞彙、指令、設定名稱
  2. 語意搜尋embed_to_pg search適合概念性問題、模糊記憶
  3. 混合搜尋:先用 qmd 快速篩選,再用 pgvector 重排

輸出格式

搜尋結果包含:

  • 文件來源(檔案路徑)
  • 相關段落(前 200 字)
  • 相似度分數

重要路徑

qmd 索引:       ~/.cache/qmd/index.sqlite
pgvector DB    postgresql://qmd_user@localhost/qmd_brain
embed 腳本:     /home/selig/apps/qmd-pg/embed_to_pg.py
qmd collectionsselig-home (/home/selig)

每日排程

凌晨 02:00 自動執行:

  1. qmd embed(更新 BM25 + 本地向量索引)
  2. embed_to_pg embed(更新 PostgreSQL 向量庫)