← Back to Skills Marketplace
jochenyang

open-memory-system

by Jochen · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
192
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install open-memory-system
Description
三层记忆系统 — Working/Short-Term/Long-Term Memory 管理。支持自动偏好记忆、实体记忆、事件记录、L2自动提炼、Hook自动触发、Cron定期整理。用于记忆用户偏好、跨会话积累知识、自动化记忆管理。
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install open-memory-system
  3. After installation, invoke the skill by name or use /open-memory-system
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Open Memory System 1.0.0 - 首次发布:基于 OpenViking + Microsoft Agent Memory 的三层记忆系统(Working/Short-Term/Long-Term Memory)。 - 支持自动偏好、实体、事件记忆,L2 自动提炼,Hook 自动触发,Cron 定期整理。 - 明确的目录结构和初始化流程,方便持久化管理用户和 Agent 记忆。 - 提供命令行工具进行记忆读取、统计、清理、提炼及记录偏好/事件/经验。 - 详尽文档,说明自动化流程与 Hook 部署,方便快速集成与配置。
Metadata
Slug open-memory-system
Version 1.0.0
License MIT-0
All-time Installs 1
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is open-memory-system?

三层记忆系统 — Working/Short-Term/Long-Term Memory 管理。支持自动偏好记忆、实体记忆、事件记录、L2自动提炼、Hook自动触发、Cron定期整理。用于记忆用户偏好、跨会话积累知识、自动化记忆管理。 It is an AI Agent Skill for Claude Code / OpenClaw, with 192 downloads so far.

How do I install open-memory-system?

Run "/install open-memory-system" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is open-memory-system free?

Yes, open-memory-system is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does open-memory-system support?

open-memory-system is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created open-memory-system?

It is built and maintained by Jochen (@jochenyang); the current version is v1.0.0.

💬 Comments