← 返回 Skills 市场
jochenyang

open-memory-system

作者 Jochen · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
192
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install open-memory-system
功能描述
三层记忆系统 — Working/Short-Term/Long-Term Memory 管理。支持自动偏好记忆、实体记忆、事件记录、L2自动提炼、Hook自动触发、Cron定期整理。用于记忆用户偏好、跨会话积累知识、自动化记忆管理。
使用说明 (SKILL.md)

Open Memory System

基于 OpenViking + Microsoft Agent Memory 的三层记忆框架,适用于 AI Agent 的持久化记忆系统。

核心概念

层级 用途 存储
Working Memory 当前会话临时信息 working.json
Short-Term Memory 会话级别短期记忆 short-term/*.md
Long-Term Memory 偏好、实体、事件持久化 user/preferences/, user/entities/, user/events/

目录结构

memory/                          # 记忆主目录
├── working.json                # Working Memory
├── short-term/                 # Short-Term Memory (会话级别)
│   └── YYYY-MM-DD-HHMM.md
├── user/                       # Long-Term Memory (用户视角)
│   ├── preferences/           # 偏好记录
│   ├── entities/              # 实体记忆
│   └── events/                # 重要事件
└── agent/                     # Agent 自身记忆
    ├── persona/                # 人设/角色设定
    └── episodic/               # 经验教训

快速安装

Step 1: 解压 skill 到 workspace

cd ~/.openclaw/workspace/skills
unzip open-memory-system.zip -d open-memory-system

Step 2: 初始化记忆目录

export MEMORY_DIR=~/.openclaw/workspace/memory
mkdir -p $MEMORY_DIR/{user/{preferences,entities,events},agent/{persona,episodic},short-term}

Step 3: 部署 Hook

# auto-save-memory: 部署到 ~/.openclaw/hooks/
cp -r open-memory-system/scripts/auto-save-memory ~/.openclaw/hooks/

# load-memory-on-start 已在 ~/.openclaw/hooks/ 中预装,无需重复部署

Step 4: 创建 Cron(定时任务)

参考 crons/memory-crons.txt 创建每日定时任务。

CLI 命令

# 读取核心记忆
python3 scripts/memory.py

# 每日统计
python3 scripts/memory.py summary

# 清理过期
python3 scripts/memory.py cleanup

# L2 提炼(从 short-term → long-term events)
python3 scripts/distill_l2.py

# 记录偏好
python3 scripts/memory.py pref "沟通方式" "直接高效" "用户偏好"

# 记录事件
python3 scripts/memory.py event "项目启动" "Miloya 正式成立"

# 记录经验
python3 scripts/memory.py episode "第一次部署" "negative" "需要检查依赖版本"

自动化流程

用户对话
    ↓
[session:end Hook]  → auto-save-memory → 保存 .learnings → memory
    ↓
[memory-check cron] → 清理过期 + 会话摘要 → short-term
    ↓
[distill_l2 cron @20:00] → short-term 提炼 → user/events/ (L2)
    ↓
[session:start Hook] → load-memory-on-start → 加载 MEMORY.md + short-term

内置 Hook 说明

Hook 位置 触发 功能
load-memory-on-start ~/.openclaw/hooks/(预装) agent:bootstrap 运行 memory.py read 加载记忆
auto-save-memory ~/.openclaw/hooks/(需部署) session:end 保存 .learnings/ 到 events

自定义配置

修改 scripts/memory.py 开头的配置区:

MEMORY_DIR = Path(os.environ.get("MEMORY_DIR", "/root/.openclaw/workspace/memory"))
DEFAULT_EXPIRE_DAYS = 90
安全使用建议
This package appears to do what it says: manage local memory files and provide hooks/crons to auto-save/load and distill short-term items into long-term events. Before installing: (1) inspect the files you’ll allow the hooks to read (MEMORY.md, ~/.openclaw/workspace/.learnings) to ensure they contain no secrets; (2) consider changing the default MEMORY_DIR to a non-root path appropriate for your deployment; (3) avoid passing untrusted input into preference/entity keys (filenames are created directly from keys — this can allow path traversal or odd filenames); (4) review and control deployment of the hook directory (~/.openclaw/hooks/) since hooks will run automatically on agent events; and (5) verify whether any referenced helper (index.py) exists in your environment (cleanup tries to run it if present). Overall the skill is coherent and local-only, but follow these precautions before enabling hooks or crons.
功能分析
Type: OpenClaw Skill Name: open-memory-system Version: 1.0.0 The 'open-memory-system' skill bundle is a legitimate framework for managing an AI agent's multi-layered memory (Working, Short-Term, and Long-Term). The bundle consists of Python and Node.js scripts that handle file-based storage of user preferences, entities, and events within a designated workspace. Analysis of 'memory.py', 'distill_l2.py', and the hook handlers shows no evidence of data exfiltration, network requests, or malicious execution. Subprocess calls are handled safely using argument lists, and the system's automation (hooks and crons) is strictly aligned with the stated purpose of memory maintenance and distillation.
能力评估
Purpose & Capability
Name/description promise a local memory system and the included scripts and hooks exclusively implement file-based memory operations (working/short-term/long-term), L2 distillation, and cron/hook wiring — these requirements align with the stated purpose.
Instruction Scope
Runtime instructions and hook code read and write files in the agent workspace (MEMORY.md, .learnings, memory/*). This is expected for a memory manager, but hooks will automatically read .learnings and MEMORY.md from the workspace when deployed, so you should ensure those directories/files do not contain secrets you don't want the skill to ingest.
Install Mechanism
No remote installers or downloads — the skill is instruction-plus-local-scripts only. The install steps are copy/unzip and creating directories, which is proportionate to the task.
Credentials
The skill declares no required credentials or env vars. Code uses optional environment variables (MEMORY_DIR, OPENCLAW_WORKSPACE) and defaults to a path under /root/.openclaw/workspace/memory; this is reasonable but the default absolute root path and reliance on workspace env vars should be reviewed in your environment. No network credentials are requested.
Persistence & Privilege
always:false (no forced always-on). Hooks are intended to be copied to ~/.openclaw/hooks/ and will run on agent events (session:end, agent:bootstrap) if deployed — autonomous invocation of hooks is expected behavior for this skill but you should be aware hooks will execute automatically once installed.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install open-memory-system
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /open-memory-system 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Open Memory System 1.0.0 - 首次发布:基于 OpenViking + Microsoft Agent Memory 的三层记忆系统(Working/Short-Term/Long-Term Memory)。 - 支持自动偏好、实体、事件记忆,L2 自动提炼,Hook 自动触发,Cron 定期整理。 - 明确的目录结构和初始化流程,方便持久化管理用户和 Agent 记忆。 - 提供命令行工具进行记忆读取、统计、清理、提炼及记录偏好/事件/经验。 - 详尽文档,说明自动化流程与 Hook 部署,方便快速集成与配置。
元数据
Slug open-memory-system
版本 1.0.0
许可证 MIT-0
累计安装 1
当前安装数 0
历史版本数 1
常见问题

open-memory-system 是什么?

三层记忆系统 — Working/Short-Term/Long-Term Memory 管理。支持自动偏好记忆、实体记忆、事件记录、L2自动提炼、Hook自动触发、Cron定期整理。用于记忆用户偏好、跨会话积累知识、自动化记忆管理。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 192 次。

如何安装 open-memory-system?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install open-memory-system」即可一键安装,无需额外配置。

open-memory-system 是免费的吗?

是的,open-memory-system 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

open-memory-system 支持哪些平台?

open-memory-system 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 open-memory-system?

由 Jochen(@jochenyang)开发并维护,当前版本 v1.0.0。

💬 留言讨论