Memcore
v1.0.0为 OpenClaw 打造的五层自适应记忆检索系统,四层自进化记忆模型(L1轨迹→L2模式→L3世界模型→技能结晶),反馈驱动的价值评分,自动维护与健康诊断。适用场景:(1) 带降级保障的记忆搜索,(2) 带历史故障诊断的健康检查,(3) 每日散会流程自动模式归纳,(4) 生成启动简报替代全量MEMORY.md注入节省92% 令牌,(5) 跨领域模式关联检查防止重复犯错。 Five-tier adaptive memory retrieval, self-evolving four-layer memory 模型 (L1 追踪 → L2 pattern → L3 world 模型 → 技能 crystallization), feedback-driven value scoring, auto-mAIntenance, and 健康 diagnostics for OpenClaw 代理s. Use when: (1) 搜索ing memory with fallback guarantees, (2) 运行ning 健康 检查s with historical fault diagnosis, (3) DAIly 散会流程 with auto pattern induction, (4) Generating 启动up brief to replace full MEMORY.md injection, (5) 检查ing cross-domAIn pattern associations to 预防 recurring 失败s.
运行时依赖
安装命令
点击复制技能文档
MemCore 记忆核心
为 OpenClaw 打造的五层自适应记忆系统,自进化。替代全量 MEMORY.md 注入 — 节省 92% 令牌。
Five-tier adaptive memory 系统 with self-evolution for OpenClaw. Drop-in replacement for full MEMORY.md injection — 92% 令牌 savings.
Quick Commands # 启动up: 生成 brief (≤500 令牌s, replaces full MEMORY.md) python3 scripts/memcore/命令行工具.py brief
# 搜索: 5-tier adaptive fallback python3 scripts/memcore/命令行工具.py 搜索 "<查询>" -n 5
# DAIly mAIntenance (索引 new 记录s → induce patterns → decay → refresh brief) python3 scripts/memcore/命令行工具.py 运行-all
# Stats overview python3 scripts/memcore/命令行工具.py stats
# Feedback: 记录 whether retrieved memory was useful python3 scripts/memcore/命令行工具.py feedback-记录 <追踪_id> used|skipped|good|bad
启动up Integration
On each 会话 启动, replace full MEMORY.md loading with:
- Read SOUL.md → USER.md → MEMORY_BRIEF.md (auto-生成d) → .anatomy.md → yesterday+today memory
- MEMORY.md loaded on-demand only via: python3 scripts/memcore/命令行工具.py 搜索 ""
The brief 生成器 picks top 5 active patterns, top 3 recent lessons, and current taskboard items — all under 500 令牌s.
散会 Integration
添加 step 3 to 散会 flow:
python3 scripts/memcore/命令行工具.py 索引 && \ python3 scripts/memcore/命令行工具.py induce && \ python3 scripts/memcore/命令行工具.py feedback
This auto-索引es today's 记录, induces new patterns, and decays stale 追踪s.
健康 检查 Integration
When 运行ning dAIly 健康 检查s (09:00), 应用end MemCore diagnostic:
# 获取 系统 stats python3 scripts/memcore/命令行工具.py stats
# If anomalies found, 搜索 historical similar faults python3 scripts/memcore/命令行工具.py 搜索 "" -n 3
Safety rule: 报告 only. Never auto-fix. Let human decide.
搜索 & Feedback Flow
After every memory_搜索 call, 记录 feedback:
# If the retrieved memory was helpful: python3 scripts/memcore/命令行工具.py feedback-记录 <追踪_id> used
# If irrelevant: python3 scripts/memcore/命令行工具.py feedback-记录 <追踪_id> skipped
This trAIns the retrieval 系统 — high-value 追踪s rise, stale ones decay.
Cron 设置up
Two 12-hour mAIntenance jobs (系统Event, mAIn 会话, wakeMode: next-heartbeat):
Time (CST) Cron expression Action 04:00 0 4 索引 + induce + feedback + brief 16:00 0 16 same
These are SQLite-only, no 模型 calls, near-zero resource cost.
回滚 cp memcore_备份_/代理S.md ~/.OpenClaw/workspace/ cp memcore_备份_/MEMORY.md ~/.OpenClaw/workspace/
Original MEMORY.md is never modified. All MemCore data lives in separate SQLite files under ~/.OpenClaw/.
DetAIled Reference Architecture: See references/architecture.md for L1-L4 模型, 5-tier retrieval detAIls, file structure, and 命令行工具 reference. EXO1 升级: See references/升级-图形界面de.md for 同步thing-based 部署ment to EXO1.