AI Agent memory search using SQLite FTS5. 90%+ token reduction (10x+) compared to reading full files. Use when the agent needs to search through markdown memory files, daily notes, or any text corpus efficiently. Triggers on memory search, file search, knowledge retrieval, or when context window is limited and full-file reading is too expensive.
基于FTS5的AI智能体记忆搜索。一次性索引Markdown文件,搜索时可节省90%以上的token消耗。
bash
python3 scripts/build-index.py <记忆目录> <数据库路径>
示例:
bash
python3 scripts/build-index.py ./memory ./memory.db
该命令会创建一个SQLite数据库,其中包含目录下所有.md文件的FTS5全文索引(递归处理)。
bash
python3 scripts/search.py <查询内容> [返回数量] [数据库路径]
示例:
bash
python3 scripts/search.py Physical AI路线图 5
python3 scripts/search.py 项目时间线 10 ./memory.db
默认返回数量:10。默认数据库路径:./memory.db
输出:匹配的代码片段及其文件路径和相关性评分。
重新运行build-index.py即可。它会从头重建索引(速度很快,典型工作空间耗时<1秒)。
FTS5基于关键词。通过以下方式提升搜索结果:
自行运行基准测试:
bash
python3 scripts/benchmark-recall.py # Recall@5, Recall@10
python3 scripts/benchmark-cache.py # 热缓存与冷缓存对比
sql
CREATE VIRTUAL TABLE memory_fts USING fts5(path, content);
直接SQL访问:
bash
sqlite3 memory.db SELECT path, snippet(memoryfts, 1, , , ..., 32) FROM memoryfts WHERE memory_fts MATCH query ORDER BY rank LIMIT 5;
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 eidolon-search-1776207510 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 eidolon-search-1776207510 技能
skillhub install eidolon-search-1776207510
文件大小: 11.34 KB | 发布时间: 2026-4-15 12:45