open-memory-system

v1.0.0

三层记忆系统 — Working/Short-Term/Long-Term Memory 管理。支持自动偏好记忆、实体记忆、事件记录、L2自动提炼、Hook自动触发、Cron定期整理。用于记忆用户偏好、跨会话积累知识、自动化记忆管理。

0· 195·0 current·1 all-time
byJochen@jochenyang

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for jochenyang/open-memory-system.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "open-memory-system" (jochenyang/open-memory-system) from ClawHub.
Skill page: https://clawhub.ai/jochenyang/open-memory-system
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install open-memory-system

ClawHub CLI

Package manager switcher

npx clawhub@latest install open-memory-system
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
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.
Assessment
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.

Like a lobster shell, security has layers — review code before you run it.

latestvk97a4swa27qcty0y2f9tx8b9qs83fg4m
195downloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

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

Comments

Loading comments...