instances/xiaodazi/skills/knowledge-base/SKILL.md
Personal knowledge base with SQLite FTS5 full-text search. Save, organize, and retrieve knowledge locally.
npx skillsauth add malue-ai/dazee-small knowledge-baseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
基于 SQLite + FTS5 的本地知识库,帮助用户保存、整理、检索知识片段。数据完全本地化。
知识库存储在 ~/Documents/xiaodazi/knowledge.db:
CREATE TABLE knowledge (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT NOT NULL,
content TEXT NOT NULL,
tags TEXT DEFAULT '', -- 逗号分隔的标签
source TEXT DEFAULT '', -- 来源 URL 或文件
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE VIRTUAL TABLE knowledge_fts USING fts5(
title, content, tags,
content='knowledge',
content_rowid='id'
);
保存知识:
import sqlite3
db = sqlite3.connect("~/Documents/xiaodazi/knowledge.db")
db.execute(
"INSERT INTO knowledge (title, content, tags, source) VALUES (?, ?, ?, ?)",
["Python 装饰器原理", "装饰器是一个接受函数并返回函数的高阶函数...", "python,编程", ""]
)
db.execute(
"INSERT INTO knowledge_fts (rowid, title, content, tags) VALUES (last_insert_rowid(), ?, ?, ?)",
["Python 装饰器原理", "装饰器是一个接受函数并返回函数的高阶函数...", "python,编程"]
)
db.commit()
搜索知识:
results = db.execute("""
SELECT k.id, k.title, snippet(knowledge_fts, 1, '**', '**', '...', 30) as excerpt,
k.tags, k.created_at
FROM knowledge_fts
JOIN knowledge k ON knowledge_fts.rowid = k.id
WHERE knowledge_fts MATCH ?
ORDER BY rank
LIMIT 10
""", ["Python 装饰器"]).fetchall()
按标签浏览:
results = db.execute("""
SELECT title, substr(content, 1, 100) as preview, created_at
FROM knowledge
WHERE tags LIKE '%python%'
ORDER BY updated_at DESC
""").fetchall()
用户:帮我记住——Python 的 GIL 是全局解释器锁,同一时刻只有一个线程执行字节码
→ 保存到知识库,自动提取标签 [python, 并发]
→ 回复:已保存 ✅「Python GIL」— 标签:python, 并发
用户:我之前存过什么关于 Python 的知识?
→ 搜索知识库
→ 找到 3 条记录:
1. Python 装饰器原理(2/20)
2. Python GIL(2/26)
3. Python 异步编程(2/22)
development
Local web search (Tavily/Exa, requires API Key). For quick searches. If no Key configured or deep research needed, use cloud_agent instead.
development
Get current weather and forecasts (no API key required).
tools
Send WhatsApp messages to other people or search/sync WhatsApp history via the wacli CLI (not for normal user chats).
tools
Start voice calls via the Moltbot voice-call plugin.