← 返回 Skills 市场
OpenClaw Memory System
作者
Jason99666
· GitHub ↗
· v1.0.0
· MIT-0
89
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install light-memory
功能描述
A lightweight, prompt-driven three-layer memory system for long-term context retention in OpenClaw agents with secure, asynchronous data extraction and Markd...
使用说明 (SKILL.md)
Memory System - Three-Layer Memory Architecture
版本:v1.0.0 | 日期:2026-04-12 设计原则:轻量、跨平台、Prompt-Driven、原子化安装、用户数据安全
一句话描述
一个可复用的 LLM Agent 三层记忆架构(L1/L2/L3),解决长周期对话的上下文失忆问题。
核心价值
- 纯 Prompt 驱动:无 Python/Bash 依赖,跨平台开箱即用
- 显式标记协议:用户主动标记"决策:"、"洞察:",后台异步提取
- Memory Synergy 协议:不再实时拦截写入对话流,而是通过显式标记协助后台 Cron 任务异步提取,不阻塞用户对话
- CAR 经验萃取:结构化长期记忆(Context-Action-Result)
- 物理文件持久化:不依赖向量数据库,纯 Markdown 可审计
- OpenClaw 原生集成:利用 Cron + Session 机制,无需额外服务
- 绝对数据安全:安装时自动备份,迁移为可选命令
目标用户
- OpenClaw 深度用户
- 需要长周期记忆的个人 Agent 开发者
- 对"上下文管理"有痛点的 AI 应用开发者
推荐模型
- 推荐:Claude Sonnet / GPT-4o / 其他强推理模型
- 可用:其他模型(效果可能因理解能力而异)
可用命令
/install-memory
原子化一键安装记忆系统。
执行流程(一气呵成,不可中断):
Step 1: 获取绝对路径(pwd)
↓
Step 2: 冲突检测(proactive-agent / self-improving-agent)
↓
Step 3: 备份现有文件
↓
Step 4: 写入 6 个 Prompt 模板
↓
Step 5: 初始化记忆文件(L1/L2/L3,保护已有数据)
↓
Step 6: 注册 Cron 任务(4 个核心 + 1 个可选心跳)
↓
Step 7: 验证 + 输出报告
执行步骤:
- 读取
prompts/install-prompt.md - 严格按 Prompt 指引执行,任何步骤失败立即停止
- 输出安装报告(备份位置、文件列表、Cron 任务)
安全检查点:
- 备份后验证文件存在
- Prompt 写入后验证非空
- Cron 注册后验证任务数量
/migrate-memory
可选迁移旧记忆数据到新格式。
执行流程:
Step 1: 验证备份存在(来自 /install-memory)
↓
Step 2: 读取旧数据(备份目录)
↓
Step 3: 识别模式(决策/任务/洞察/完成)
↓
Step 4: 清洗并写入新格式(L1/L2/L3)
↓
Step 5: 输出迁移报告
执行步骤:
- 读取
prompts/migrate-prompt.md - 严格按 Prompt 指引执行
- 输出迁移报告(L1/L2/L3 数据统计)
安全机制:
- 强制验证备份存在
- 不覆盖现有文件,仅追加
- 输出详细迁移报告
/check-memory
检查记忆系统运行状态。
执行步骤:
- 读取
references/troubleshooting.md - 执行自检清单
- 输出状态报告
架构概览
用户对话(显式标记)
↓
物理日志 (.jsonl)
↓ [每小时:00, Prompt 驱动]
L1 提炼(LLM 读取 → 分析 → 写入)
↓
SESSION-STATE.md (L1)
↓ [23:05, Prompt 驱动]
L1→L2 归档(LLM 读取 → 按日期写入)
↓
memory/YYYY-MM-DD.md (L2)
↓ [周日 23:30, Prompt 驱动]
L2→L3 萃取(LLM 读取 → CAR 提炼)
↓
MEMORY.md (L3)
↓ [每天 23:10, Prompt 驱动]
Session GC(清理临时文件)
↓
心跳检查(每 30 分钟,健康监控)
文件结构
openclaw-memory-system/
├── SKILL.md # 本文件
├── _meta.json # ClawHub 元数据
├── prompts/ # 7 个核心 Prompt 模板
│ ├── l1-hourly-prompt.md # L1 每小时提炼
│ ├── l2-nightly-prompt.md # L2 夜间归档
│ ├── l3-weekly-prompt.md # L3 每周萃取
│ ├── gc-cleanup-prompt.md # Session GC 清理
│ ├── heartbeat-prompt.md # 心跳检查(可选)
│ ├── install-prompt.md # 原子化安装
│ └── migrate-prompt.md # 可选迁移
├── templates/ # 记忆文件模板
│ ├── SESSION-STATE.template.md
│ ├── daily-log.template.md
│ └── MEMORY.template.md
└── references/ # 补充文档
├── architecture.md # 架构详解
├── car-format.md # CAR 格式规范
└── troubleshooting.md # 故障排查
Cron 任务清单
核心任务(4 个)
| 任务名称 | 触发时间 | sessionTarget | 目标写入 |
|---|---|---|---|
| L1 每小时智能提炼 | 0 9-23 * * * |
isolated | SESSION-STATE.md |
| L2 夜间全自动归档 | 5 23 * * * |
isolated | memory/YYYY-MM-DD.md |
| L3 周度自我进化 | 30 23 * * 0 |
isolated | MEMORY.md |
| Session GC 清理 | 10 23 * * * |
isolated | 无(物理删除) |
可选任务(1 个)
| 任务名称 | 触发时间 | 说明 |
|---|---|---|
| 心跳检查 | */30 * * * * |
每 30 分钟检查系统健康状态 |
关键设计原则
- 禁止 ~ 符号:Cron 环境中 ~ 可能被解析为 /root,使用
pwd获取绝对路径 - 禁止硬编码日期:使用
date动态获取,避免读取过期数据 - 游标防重:
[Last_Extracted_Time]标记,避免重复提炼 - 原子化操作:安装一气呵成,失败立即停止
- 数据安全:安装时自动备份,迁移为可选
冲突处理
检测到已安装 proactive-agent 或 self-improving-agent 时:
- 输出对比分析
- 不强制替换
- 用户自行决定是否共存
参考文档
- 架构详解:
references/architecture.md - CAR 格式:
references/car-format.md - 故障排查:
references/troubleshooting.md
设计完成:2026-04-12 | 版本:v1.0.0
安全使用建议
This skill appears to be what it says: a file-based, prompt-driven memory system that schedules Cron tasks and manipulates local workspace and sessions files. Before installing: (1) verify the BASE/pwd layout used in prompts matches your OpenClaw installation (the prompts assume a specific ../../agents/main/sessions path); (2) review and, if needed, adapt the GC deletion rules (':run:' and <1KB criteria) to avoid accidental deletion in your environment; (3) confirm what the platform 'read'/'write' tools do and what permissions they hold; (4) ensure you are comfortable with automatic Cron registrations (they will persist and run autonomously); (5) test in a non-production agent or backup your workspace and run the included validate.sh locally to see expected file effects. If any of these items are unclear or you need the skill to be less aggressive, request changes prior to installation.
功能分析
Type: OpenClaw Skill
Name: light-memory
Version: 1.0.0
The 'light-memory' skill bundle implements a structured three-layer memory architecture (L1/L2/L3) for OpenClaw agents using Markdown files and Cron jobs. The system performs automated log analysis, data archival, and experience extraction (CAR format) through a series of specialized prompts. While the bundle includes capabilities for file deletion (gc-cleanup-prompt.md) and system configuration (install-prompt.md), these actions are transparently documented, include safety mechanisms like automated backups, and are strictly aligned with the stated purpose of session management and long-term memory persistence. No evidence of data exfiltration, unauthorized remote execution, or malicious intent was detected.
能力评估
Purpose & Capability
The skill claims to provide a three-layer L1/L2/L3 memory system and all artifacts (SKILL.md, prompts, templates, references) implement that design. Required paths, cron registrations, backup/restore, and file-based persistence are coherent with the stated purpose. No unrelated credentials, network endpoints, or binaries are requested.
Instruction Scope
Runtime prompts instruct the agent to read/write/append files under a workspace and to scan the agent sessions directory (../../agents/main/sessions/). They also define a GC deletion policy (delete files containing ':run:' or <1KB). These operations are consistent with memory management, but they are destructive when misconfigured: if BASE/pwd is different than expected, or the sessions path layout differs, deletion/overwrites could affect unintended files. Prompts reference agent 'read'/'write' tools (assumed platform tools) but do not explain their permissions — review how those tools behave in your environment.
Install Mechanism
No install spec and no external downloads — instruction-only plus one local validation shell script. This is low-risk from an installation standpoint; nothing is fetched from arbitrary URLs or written outside the skill/workspace except via Cron registration (which is expected).
Credentials
The skill requests no environment variables, no credentials, and no config paths outside the agent workspace. All file and path accesses declared by prompts relate to the memory system (workspace, memory/, SESSION-STATE.md, sessions/). There are no demanded API keys or unexplained secret access.
Persistence & Privilege
The skill registers Cron tasks (openclaw cron add) to run prompts on a schedule and will therefore create persistent, periodic behavior. This is appropriate for a memory system but does increase runtime persistence. always:false and no modifications to other skills' configs are observed. Confirm you are comfortable with scheduled autonomous tasks that will read/write session files.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install light-memory - 安装完成后,直接呼叫该 Skill 的名称或使用
/light-memory触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
light-memory v1.0.0
- Introduces a three-layer LLM Agent memory architecture (L1/L2/L3) to address long-term context retention issues.
- Fully prompt-driven, cross-platform, and does not depend on Python/Bash or vector databases.
- Features atomic one-click installation with safety checks and automatic data backup.
- Users can explicitly mark key information ("决策:", "洞察:"); system extracts and archives asynchronously via Cron tasks.
- Includes commands for installation, migration, and health checks, with detailed reports and data safety measures.
- Integrates natively with OpenClaw, supporting long-term, robust, and auditable memory for agent workflows.
元数据
常见问题
OpenClaw Memory System 是什么?
A lightweight, prompt-driven three-layer memory system for long-term context retention in OpenClaw agents with secure, asynchronous data extraction and Markd... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 89 次。
如何安装 OpenClaw Memory System?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install light-memory」即可一键安装,无需额外配置。
OpenClaw Memory System 是免费的吗?
是的,OpenClaw Memory System 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
OpenClaw Memory System 支持哪些平台?
OpenClaw Memory System 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 OpenClaw Memory System?
由 Jason99666(@jason99666)开发并维护,当前版本 v1.0.0。
推荐 Skills