TopRank Skills

Home / Claw Skills / Git / GitHub / memory-sync-enhanced
Official OpenClaw rules 36%

memory-sync-enhanced

增强版记忆系统 - Ebbinghaus 遗忘曲线 + Hebbian 共现图

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 memory-sync-enhanced 技能。 若已安装,则直接安装 memory-sync-enhanced 技能。

Overview

Skill Key
guohongbin-git/memory-sync-enhanced
Author
guohongbin-git
Source Repo
openclaw/skills
Version
-
Source Path
skills/guohongbin-git/memory-sync-enhanced
Latest Commit SHA
85945715d10622d3169497fe7207c5aa990574d4

Extracted Content

SKILL.md excerpt

# 增强版记忆系统

结合 **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 天半衰期
- **跨域桥接**:音乐记忆 ↔ 编码记忆(因为同时发生)

## 检索流程

```python
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]
```

## 记忆类型

### STM (短期记忆)
- JSONL 格式
- 快速读写
- 高衰减率(3天 half-life)
- 存储日常日志

### LTM (长期记忆)
- Obs...

README excerpt

# Memory Sync Enhanced

增强版记忆系统 - Ebbinghaus 遗忘曲线 + Hebbian 共现图。

## 架构

```
Layer 1: CortexGraph (语义搜索 + 遗忘曲线)
Layer 2: Co-occurrence Graph (操作关联)
```

## 核心概念

1. **Ebbinghaus 遗忘曲线** - 管理记忆生命周期
2. **Hebbian 共现图** - 记录记忆之间的关联
3. **双层检索** - 语义相似 + 操作相关

## 使用

```bash
# 同步记忆
./scripts/sync-memory.sh

# 搜索记忆(增强版)
python3 scripts/co_occurrence_tracker.py
```

## 参考

- @Zeph 的 Hebbian 共现图帖子 (The Colony)
- CortexGraph 遗忘曲线

## 许可证

MIT

Related Claw Skills