Searches, stores, and manages agent memory across 4 sources (fact store, vector embeddings, BM25, knowledge graph). Runs 100% local via Ollama — no API keys, no cloud dependency. Use when searching workspace knowledge, extracting facts from text, detecting contradictions, auto-ingesting file changes, or building entity graphs. Triggers on memory recall, fact extraction, knowledge search, workspace indexing.
多源记忆召回与事实管理。通过Ollama本地运行(0€)。
问题 → unified_recall.py → 扇出4个来源 → 合并 → 评分 → 重排序 → 回答
├─ 事实存储(Convex或本地JSON)
├─ 向量嵌入(nomic)
├─ BM25全文检索(QMD)
└─ 知识图谱(JSON)
文件变更 → auto_ingest.py → 提取事实 → 矛盾检查 → 存储
→ 更新嵌入 → 重建图谱
bash
要求:Python 3.9+、Ollama、curl。可选:QMD CLI(bun install -g qmd)。
bash
bash
事实在存储前会在本地进行矛盾检查(gemma3,约2秒)。分类:knowledge、error、timeline、preference、tool、client、hr。
bash
python3 scripts/auto_ingest.py --scan # 一次性:处理已修改的.md文件
python3 scripts/auto_ingest.py --watch # 守护进程:每30秒轮询变更
python3 scripts/auto_ingest.py --file doc.md # 单个文件
通过内容哈希+5分钟冷却期去重。触发流程:事实提取→存储→嵌入缓存更新→图谱重建。
bash
python3 scripts/knowledge_graph.py # 完整重建
python3 scripts/knowledge_graph.py --dry-run # 预览而不写入
图谱存储在.cache/knowledge-graph.json。由auto_ingest.py增量自动重建。
bash
python3 scripts/tests.py # 28个单元测试
编辑scripts/config.json。完整指南见references/configuration.md。
存储后端 — 自动检测:
模型预设 — 通过一个标志切换LLM/嵌入提供者:
bash
python3 scripts/unified_recall.py 查询 --preset ollama # 默认
python3 scripts/unified_recall.py 查询 --preset lmstudio
python3 scripts/unified_recall.py 查询 --preset openai
按脚本模型覆盖 — 在config.json中 → scriptOverrides:
json
scriptOverrides: {
recall: { llm: { model: gemma3:4b, apiFormat: ollama } },
extract: { llm: { model: gemma3:4b, apiFormat: ollama } }
}
按内存推荐模型:
| 内存 | LLM | 嵌入模型 |
|---|---|---|
| 4 GB | gemma3:1b | nomic-embed-text |
| 8 GB |
⚠ 避免在JSON任务中使用Qwen 3.5 — 输出会进入thinking字段而非响应。
| 平台 | 方法 |
|---|---|
| macOS | 带WatchPaths的LaunchAgent |
| Linux |
示例见references/configuration.md。
scripts/
├── unified_recall.py # 多源搜索+评分+综合
├── extract_facts.py # 事实提取+矛盾检查+存储
├── auto_ingest.py # 文件监视器/扫描器流水线
├── multihop_search.py # 链式推理搜索
├── decay_search.py # 时间加权搜索
├── knowledge_graph.py # 实体/关系图谱构建器
├── fact_store.py # 存储抽象层(Convex/本地JSON)
├── llm_client.py # LLM/嵌入客户端(Ollama/LM Studio/OpenAI)
├── selftest.py # 设置验证
├── tests.py # 单元测试(28个)
└── config.json # 配置+预设
references/
└── configuration.md # 完整配置指南
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 agent-memory-tools-1776062714 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 agent-memory-tools-1776062714 技能
skillhub install agent-memory-tools-1776062714
文件大小: 47.43 KB | 发布时间: 2026-4-14 14:37