Install
openclaw skills install light-memoryA lightweight, prompt-driven three-layer memory system for long-term context retention in OpenClaw agents with secure, asynchronous data extraction and Markd...
openclaw skills install light-memory版本:v1.0.0 | 日期:2026-04-12 设计原则:轻量、跨平台、Prompt-Driven、原子化安装、用户数据安全
一个可复用的 LLM Agent 三层记忆架构(L1/L2/L3),解决长周期对话的上下文失忆问题。
原子化一键安装记忆系统。
执行流程(一气呵成,不可中断):
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安全检查点:
可选迁移旧记忆数据到新格式。
执行流程:
Step 1: 验证备份存在(来自 /install-memory)
↓
Step 2: 读取旧数据(备份目录)
↓
Step 3: 识别模式(决策/任务/洞察/完成)
↓
Step 4: 清洗并写入新格式(L1/L2/L3)
↓
Step 5: 输出迁移报告
执行步骤:
prompts/migrate-prompt.md安全机制:
检查记忆系统运行状态。
执行步骤:
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 # 故障排查
| 任务名称 | 触发时间 | 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 | 无(物理删除) |
| 任务名称 | 触发时间 | 说明 |
|---|---|---|
| 心跳检查 | */30 * * * * | 每 30 分钟检查系统健康状态 |
pwd 获取绝对路径date 动态获取,避免读取过期数据[Last_Extracted_Time] 标记,避免重复提炼检测到已安装 proactive-agent 或 self-improving-agent 时:
references/architecture.mdreferences/car-format.mdreferences/troubleshooting.md设计完成:2026-04-12 | 版本:v1.0.0