返回顶部
m

memory-sync-cn记忆同步系统

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

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
748
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

memory-sync-cn

记忆同步系统

自动同步 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.promotememory autodetect=true dry_run=true

执行晋升

mcporter call cortexgraph.promotememory autodetect=true

CortexGraph 工具

核心操作

bash

保存记忆


mcporter call cortexgraph.save_memory content=... tags=[tag1] entities=[Entity1]

搜索记忆

mcporter call cortexgraph.searchmemory query=关键词 topk=5

强化记忆(减缓衰减)

mcporter call cortexgraph.touchmemory memoryid=UUID boost_strength=true

查看知识图谱

mcporter call cortexgraph.read_graph limit=10

智能分析

bash

分析是否值得记住


mcporter call cortexgraph.analyze_message message=用户说的话

分析是否需要搜索

mcporter call cortexgraph.analyzeforrecall message=用户说的话

自动回忆

mcporter call cortexgraph.autorecallprocess_message message=用户说的话

维护

bash

垃圾回收(删除低分记忆)


mcporter call cortexgraph.gc dry_run=true

合并相似记忆

mcporter call cortexgraph.consolidatememories autodetect=true mode=preview

生成嵌入向量

mcporter call cortexgraph.backfillembeddings dryrun=true

遗忘曲线算法

CortexGraph 使用 Ebbinghaus 遗忘曲线:

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

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

记忆会自然衰减,除非:

  • - 被引用(touchmemory)
  • 被搜索到(autorecall)
  • 晋升到长期记忆(promote_memory)

配置

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

env

存储路径


CORTEXGRAPHSTORAGEPATH=~/.config/cortexgraph/jsonl

衰减参数

CORTEXGRAPHDECAYMODEL=power_law CORTEXGRAPHPLHALFLIFE_DAYS=3.0

阈值

CORTEXGRAPHFORGETTHRESHOLD=0.05 CORTEXGRAPHPROMOTETHRESHOLD=0.65

长期记忆(Obsidian)

LTMVAULTPATH=~/Documents/Obsidian/Vault

使用场景

1. 对话中自动记住

bash

分析消息


mcporter call cortexgraph.analyze_message message=用户说...

如果 should_save=true,则保存

2. 对话中自动回忆

bash

分析消息


mcporter call cortexgraph.analyzeforrecall message=用户问...

如果 should_search=true,则搜索

3. 定期维护

bash

每周运行


mcporter call cortexgraph.gc
mcporter call cortexgraph.consolidatememories autodetect=true mode=apply

与 OpenClaw 集成

CortexGraph 已通过 mcporter 配置:

json
// ~/.openclaw/workspace/config/mcporter.json
{
cortexgraph: {
command: /home/ghb/.local/bin/cortexgraph,
description: Temporal memory system for AI with Ebbinghaus forgetting curve
}
}

最佳实践

  1. 1. 重要信息 strength=1.5-2.0(用户偏好、关键决策)
  2. 普通信息 strength=1.0(日常对话)
  3. 临时信息 strength=0.5(上下文相关)
  4. 每周维护:GC + 合并 + 晋升
  5. 每月检查:调整衰减参数

版本: 1.0.0 作者: 赚钱小能手

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 memory-sync-cn-1776420081 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 memory-sync-cn-1776420081 技能

通过命令行安装

skillhub install memory-sync-cn-1776420081

下载

⬇ 下载 memory-sync-cn v1.0.0(免费)

文件大小: 7.38 KB | 发布时间: 2026-4-17 20:13

v1.0.0 最新 2026-4-17 20:13
Initial release - CortexGraph integration with Ebbinghaus forgetting curve

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部