TopRank Skills

Home / Claw Skills / Recherche / memory-sync-cn
Official OpenClaw rules 36%

memory-sync-cn

记忆同步系统 - 自动同步 MEMORY.md 与 CortexGraph,支持遗忘曲线和智能检索

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

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

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

Overview

Skill Key
guohongbin-git/memory-sync-cn
Author
guohongbin-git
Source Repo
openclaw/skills
Version
-
Source Path
skills/guohongbin-git/memory-sync-cn
Latest Commit SHA
d96fc0ae3eed8d6a170f6d0ac039bbbb8452ec7a

Extracted Content

SKILL.md excerpt

# 记忆同步系统

自动同步 OpenClaw 记忆系统与 CortexGraph(带遗忘曲线)。

## 架构

```
MEMORY.md (长期记忆)
     ↕
CortexGraph (智能层)
     ↕
memory/YYYY-MM-DD.md (每日日志)
```

## 同步脚本

### 1. 导入 MEMORY.md 到 CortexGraph

```bash
# 运行同步
./scripts/sync-memory.sh
```

### 2. 导入每日日志

```bash
# 同步今天的日志
./scripts/sync-daily.sh

# 同步指定日期
./scripts/sync-daily.sh 2026-02-18
```

### 3. 晋升高价值记忆

```bash
# 查看晋升候选
mcporter call cortexgraph.promote_memory auto_detect=true dry_run=true

# 执行晋升
mcporter call cortexgraph.promote_memory auto_detect=true
```

## CortexGraph 工具

### 核心操作

```bash
# 保存记忆
mcporter call cortexgraph.save_memory content="..." tags='["tag1"]' entities='["Entity1"]'

# 搜索记忆
mcporter call cortexgraph.search_memory query="关键词" top_k=5

# 强化记忆(减缓衰减)
mcporter call cortexgraph.touch_memory memory_id="UUID" boost_strength=true

# 查看知识图谱
mcporter call cortexgraph.read_graph limit=10
```

### 智能分析

```bash
# 分析是否值得记住
mcporter call cortexgraph.analyze_message message="用户说的话"

# 分析是否需要搜索
mcporter call cortexgraph.analyze_for_recall message="用户说的话"

# 自动回忆
mcporter call cortexgraph.auto_recall_process_message message="用户说的话"
```

### 维护

```bash
# 垃圾回收(删除低分记忆)
mcporter call cortexgraph.gc dry_run=true

# 合并相似记忆
mcporter call cortexgraph.consolidate_memories auto_detect=true mode=preview

# 生成嵌入向量
mcporter call cortexgraph.backfill_embeddings dry_run=true
```

## 遗忘曲线算法

CortexGraph 使用 Ebbinghaus 遗忘曲线:

```
score = (use_count)^β × e^(-λ × Δt) × strength
```

- **β** = 0.6(使用频率权重)
- **λ** = ln(2) / half_life(衰减常数,默认 3 天)
- **strength** = 1.0-2.0(重要性)

记忆会自然衰减,除非:
- 被引用(touch_memory)
- 被搜索到(auto_recall)
- 晋升到长期记忆(promote_memory)

## 配置

编辑 `~/.config/cortexgraph/.env`:

```env
# 存储路径
CORTEXGRAPH_STORAGE_PATH=~/.config/cortexgraph/jsonl

# 衰减参数
CORT...

README excerpt

# Memory Sync CN

记忆同步系统 - 自动同步 OpenClaw 记忆系统与 CortexGraph。

## 功能

- 🔄 **双向同步**: MEMORY.md ↔ CortexGraph
- 🧠 **遗忘曲线**: 基于 Ebbinghaus 的智能记忆管理
- 📊 **自动晋升**: 高价值记忆自动升级到长期存储
- 🔍 **智能检索**: 语义搜索 + 衰减评分

## 安装

```bash
# 安装 CortexGraph
uv tool install cortexgraph

# 安装 mcporter
npm install -g mcporter

# 配置 CortexGraph
mcporter config add cortexgraph --command "$(which cortexgraph)"
```

## 使用

### 同步 MEMORY.md

```bash
./scripts/sync-memory.sh
```

### 同步每日日志

```bash
# 今天
./scripts/sync-daily.sh

# 指定日期
./scripts/sync-daily.sh 2026-02-18
```

### 晋升高价值记忆

```bash
./scripts/promote-to-memory-md.sh
```

## CortexGraph 工具

```bash
# 保存记忆
mcporter call cortexgraph.save_memory content="..." tags='["tag1"]'

# 搜索记忆
mcporter call cortexgraph.search_memory query="关键词"

# 强化记忆
mcporter call cortexgraph.touch_memory memory_id="UUID"

# 查看图谱
mcporter call cortexgraph.read_graph
```

## 架构

```
┌─────────────┐
│  MEMORY.md  │ ← 长期记忆(手动维护)
└──────┬──────┘
       │ sync
       ↓
┌─────────────┐
│ CortexGraph │ ← 智能层(自动衰减)
└──────┬──────┘
       │ sync
       ↓
┌─────────────┐
│  daily.log  │ ← 每日日志(自动导入)
└─────────────┘
```

## 配置

编辑 `~/.config/cortexgraph/.env`:

```env
CORTEXGRAPH_STORAGE_PATH=~/.config/cortexgraph/jsonl
CORTEXGRAPH_DECAY_MODEL=power_law
CORTEXGRAPH_PL_HALFLIFE_DAYS=3.0
CORTEXGRAPH_FORGET_THRESHOLD=0.05
CORTEXGRAPH_PROMOTE_THRESHOLD=0.65
```

## 许可证

MIT

Related Claw Skills