| name | memory-sync-enhanced |
| description | 增强版记忆系统 - Ebbinghaus 遗忘曲线 + Hebbian 共现图 |
| metadata | {"openclaw":{"emoji":"🧠","category":"system","tags":["memory","cortexgraph","hebbian","ebbinghaus","forgetting-curve"]}} |
增强版记忆系统
结合 Ebbinghaus 遗忘曲线 + Hebbian 共现图 的双层记忆架构。
架构
┌─────────────────────────────────────────────────────────┐
│ 记忆检索 │
│ semantic_search() + co_occurrence_boost() + decay() │
└─────────────────────────────────────────────────────────┘
│
┌───────────────┴───────────────┐
▼ ▼
┌─────────────────────┐ ┌─────────────────────┐
│ Layer 1: 向量库 │ │ Layer 2: 共现图 │
│ (CortexGraph) │ │ (Hebbian) │
│ │ │ │
│ • 语义相似度 │◄─────►│ • 操作关联 │
│ • Ebbinghaus 衰减 │ │ • 边权重衰减 │
│ • use_count 追踪 │ │ • 跨域桥接 │
└─────────────────────┘ └─────────────────────┘
核心算法
Layer 1: Ebbinghaus 遗忘曲线
score = (use_count)^β × e^(-λ × Δt) × strength
- β = 0.6(使用频率权重)
- λ = ln(2) / half_life(默认 3 天)
- strength = 1.0-2.0(重要性)
Layer 2: Hebbian 共现图
effective_weight = weight × 2^(-age_days / 30)
- 每次记忆 A 和 B 同时被检索 → 边(A,B) 权重 +1
- 边权重 30 天半衰期
- 跨域桥接:音乐记忆 ↔ 编码记忆(因为同时发生)
检索流程
():
semantic_results = cortexgraph.search(query, top_k * )
mem semantic_results:
co_occur_boost = get_co_occurrence_score(mem., recent_context)
mem.boosted_score = mem.semantic_score + co_occur_boost *
mem semantic_results:
mem.final_score = mem.boosted_score * mem.decay_factor
(semantic_results, key= x: x.final_score)[:top_k]