Install
openclaw skills install memory-sync-enhanced增强版记忆系统 - Ebbinghaus 遗忘曲线 + Hebbian 共现图
openclaw skills install memory-sync-enhanced结合 Ebbinghaus 遗忘曲线 + Hebbian 共现图 的双层记忆架构。
┌─────────────────────────────────────────────────────────┐
│ 记忆检索 │
│ semantic_search() + co_occurrence_boost() + decay() │
└─────────────────────────────────────────────────────────┘
│
┌───────────────┴───────────────┐
▼ ▼
┌─────────────────────┐ ┌─────────────────────┐
│ Layer 1: 向量库 │ │ Layer 2: 共现图 │
│ (CortexGraph) │ │ (Hebbian) │
│ │ │ │
│ • 语义相似度 │◄─────►│ • 操作关联 │
│ • Ebbinghaus 衰减 │ │ • 边权重衰减 │
│ • use_count 追踪 │ │ • 跨域桥接 │
└─────────────────────┘ └─────────────────────┘
score = (use_count)^β × e^(-λ × Δt) × strength
effective_weight = weight × 2^(-age_days / 30)
def retrieve_memory(query, top_k=10):
# 1. 语义搜索
semantic_results = cortexgraph.search(query, top_k * 2)
# 2. 共现增强
for mem in semantic_results:
co_occur_boost = get_co_occurrence_score(mem.id, recent_context)
mem.boosted_score = mem.semantic_score + co_occur_boost * 0.3
# 3. 遗忘曲线过滤
for mem in semantic_results:
mem.final_score = mem.boosted_score * mem.decay_factor
# 4. 返回 Top K
return sorted(semantic_results, key=lambda x: x.final_score)[:top_k]
{
"id": "uuid",
"content": "记忆内容",
"embedding": [0.1, 0.2, ...],
"use_count": 5,
"last_used": "2026-02-19",
"strength": 1.5,
"created_at": "2026-02-15",
"tags": ["daily-log", "finding"]
}
CREATE TABLE co_occurrence (
memory_a TEXT,
memory_b TEXT,
weight REAL,
last_updated TEXT,
PRIMARY KEY (memory_a, memory_b)
);
# 同步 MEMORY.md
./scripts/sync-memory.sh
# 同步每日日志
./scripts/sync-daily.sh 2026-02-19
# 记录共现
./scripts/record-co-occurrence.sh
# 语义搜索
./scripts/search.sh "量化交易"
# 增强搜索(语义 + 共现)
./scripts/search-enhanced.sh "量化交易"
# 查看记忆统计
./scripts/stats.sh
# 垃圾回收(删除低分记忆)
./scripts/gc.sh --threshold 0.1
# 晋升到长期记忆
./scripts/promote.sh <memory_id>
=== 记忆系统统计 ===
总记忆数: 2,400
共现边: 803 (连接 366 个记忆)
平均每个记忆连接: 2.2 个
记忆分布:
- STM: 1,800 (75%)
- LTM: 600 (25%)
衰减状态:
- Danger zone (0.15-0.35): 120 个
- Healthy (0.35-0.65): 1,500 个
- Strong (>0.65): 780 个
| 系统 | 向量搜索 | 遗忘曲线 | 共现图 |
|---|---|---|---|
| Markdown 文件 | ❌ | ❌ | ❌ |
| CortexGraph 原版 | ✅ | ✅ | ❌ |
| Zeph 的 Hebbian | ✅ | ❌ | ✅ |
| 本系统 | ✅ | ✅ | ✅ |
版本: 2.0.0 结合 Ebbinghaus 遗忘曲线 + Hebbian 共现图