← 返回 Skills 市场
whyischen

Memory Layer

作者 whyischen · GitHub ↗ · v0.1.1 · MIT-0
cross-platform ✓ 安全检测通过
102
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install memory-layer
功能描述
基于 Claude Code 记忆哲学的三层记忆管理系统。当需要以下操作时使用:(1) 设计 Index/Topic/Transcript 记忆架构,(2) 迁移现有记忆文件到分层结构,(3) 配置 autoDream 自动整理,(4) 优化上下文窗口使用率 70%+,(5) 实现基于重要性评分的记忆排序和检索。
使用说明 (SKILL.md)

Memory Layer - 三层记忆系统

🧠 基于 Claude Code 记忆哲学,为 OpenClaw 设计


核心原则

原则 说明
分层加载 Index 永远加载,Topic 按需,Transcript 仅 grep
写纪律 先写 Topic,再更新 Index(防止膨胀)
敏感数据不存储 Transcript 是纯文本,禁止存储账号/密码/健康记录
自动化 autoDream 夜间整理(默认禁用,需手动启用)

架构

┌─────────────────────────────────────────┐
│   MEMORY.md (Index 层)                   │
│   - 仅指针,≤25KB                        │
│   - 始终加载到上下文                      │
└───────────────┬─────────────────────────┘
                │ 按需加载 (2-5 个文件)
                ▼
┌─────────────────────────────────────────┐
│   memory/topics/*.md (Topic 层)          │
│   - 结构化知识,≤50KB/文件               │
│   - 仅在相关时加载                        │
└───────────────┬─────────────────────────┘
                │ 永不加载,仅 grep
                ▼
┌─────────────────────────────────────────┐
│   memory/transcripts/*.log (Transcript 层)│
│   - 原始日志,仅追加                      │
│   - >90 天自动归档                        │
└─────────────────────────────────────────┘

如何使用

1. 创建目录结构

mkdir -p memory/topics memory/transcripts/$(date +%Y-%m)

2. 迁移现有记忆文件

# 备份(重要)
cp -r memory/ memory.backup.$(date +%Y%m%d)

# 迁移(根据你的目录结构调整)
cp memory/investments/*.md memory/topics/  # 示例
cp memory/projects/*.md memory/topics/     # 示例
cp memory/assets/*.md memory/topics/       # 示例

3. 重构 MEMORY.md

手动重写为 Index 格式(参考 references/index-spec.md):

# MEMORY.md - OpenClaw 记忆索引

## Topics
| 领域 | 主题 | 路径 | 更新 | 摘要 | 标签 | 重要性 |
|------|------|------|------|------|------|--------|
| 项目 | 内容工具 | memory/topics/project-tool.md | 2026-04-02 | 创作工具 | AI | 0.7 |

4. 启用 autoDream(可选)

# 默认配置已禁用,需手动启用
openclaw cron add "0 23 * * *" "memory-system auto-dream"

依赖

依赖 必需 说明
OpenClaw CLI 唯一依赖
OpenClaw Cron 仅 autoDream 需要

无需额外工具:本 Skill 是纯文档设计,memory-system 等工具不存在。


配置

默认配置config/default.json(Skill 自带)

自定义配置~/.openclaw/memory-config.json(可选)

{
  "autoDream": {
    "enabled": false,
    "schedule": "23:00",
    "notifyOnComplete": false
  }
}

文档导航

文档 说明
references/architecture.md 完整架构设计
references/index-spec.md Index 层格式规范
references/topic-spec.md Topic 层格式规范
references/transcript-spec.md Transcript 层格式规范
references/autodream.md autoDream 算法详情
references/config.md 完整配置参数
guides/MIGRATION.md 迁移指南
guides/EXAMPLES.md 使用示例

版本:2.0 | 最后更新:2026-04-03 | 代号:Memory Layer

安全使用建议
This skill is a design/spec document (no executable code). It expects you to manage local files under a memory/ directory and to have the OpenClaw CLI/cron available if you want scheduled autoDream runs. Before following commands: 1) make a backup (the guides recommend cp -r memory/ …) and verify backups before running migration or rollback steps; 2) be careful with destructive commands (rm -rf in rollback examples); 3) autoDream automation references a 'memory-system' command that is not provided — you must implement or obtain that tool before scheduling autoDream; 4) the docs explicitly forbid storing passwords, keys, health data in transcripts — treat that as a strong recommendation and audit your existing files to avoid accidental inclusion of sensitive data; 5) test autoDream in dry-run/manual mode first (docs recommend this) so you can review changes before enabling automated cleanup. If you need stronger guarantees (enforced encryption, automated sensitive-data redaction, or an actual binary implementation), request or develop an implementation rather than relying on these docs alone.
功能分析
Type: OpenClaw Skill Name: memory-layer Version: 0.1.1 The memory-layer skill bundle is a documentation-centric system designed to implement a tiered memory management architecture (Index, Topic, and Transcript layers) for an AI agent. It contains no executable binary or script files, relying instead on markdown instructions (SKILL.md, guides/) and configuration (config/default.json) to guide the agent in organizing local files. The skill demonstrates good security hygiene by explicitly instructing the agent in transcript-spec.md to avoid storing sensitive data like passwords or API keys, and the provided shell commands are limited to standard local file operations (mkdir, cp, grep) and platform-specific scheduling (openclaw cron) for maintenance tasks.
能力评估
Purpose & Capability
Name/description (three-layer memory management, autoDream, migration, importance scoring) match the files and runtime instructions. The skill is purely documentation and only asks the user to operate on local memory/ files and (optionally) use existing OpenClaw CLI/cron; there are no unrelated credential or binary requests.
Instruction Scope
SKILL.md and guides instruct the agent/user to run local file operations (mkdir, cp, grep, cat, find) and to schedule a cron job via the OpenClaw CLI. This is consistent with the stated migration/management purpose. Notes: (1) the instructions reference a 'memory-system auto-dream' command and 'memory-system' tool that the repo does not provide — the docs acknowledge 'memory-system' does not exist, so automation requires separate implementation; (2) some commands (cp, rm -rf in rollback guidance) can be destructive if run accidentally — the docs do recommend backups but users should exercise caution; (3) guidance forbids storing sensitive fields in transcripts but enforcement is manual.
Install Mechanism
No install spec and no code files — the skill is instruction-only. This is the lowest installation risk (nothing is downloaded or written by the skill itself).
Credentials
The skill declares no required environment variables, no credentials, and no special config paths. It documents using existing OpenClaw CLI/cron/feishu configurations if available; these uses are proportional to the documented features (scheduling and optional notifications).
Persistence & Privilege
Skill does not request always:true, does not modify other skills or system-wide settings, and stores only a default config file in the repo for user-copying. Autonomous invocation defaults are unchanged (normal).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install memory-layer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /memory-layer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.1
- 简化和精炼了核心原则与架构描述,明确分层加载与写入规范。 - 新增“如何使用”分步指南,包括目录结构创建、记忆迁移、Index 重构及 autoDream 启用步骤。 - 删除具体 Agent 行为和细节流程,强调 Skill 仅为文档规范设计,无实际 memory-system 工具。 - 默认禁用 autoDream,并明确仅 OpenClaw CLI 为必需依赖。 - 补充迁移指南与示例参考文档导航链接。 - 更新默认和自定义配置说明,突出易用性和安全性。
v0.1.0
- Initial release of MemLayer, a general-purpose three-layer memory management system for OpenClaw. - Dramatically reduces context usage (up to 70%+), improves retrieval speed (10x+), and enables automated maintenance. - Provides a clear architecture: Index layer (MEMORY.md), Topic layer (memory/topics), and Transcript layer (memory/transcripts). - Includes step-by-step quick start and automated nightly memory optimization via autoDream. - Extensive documentation and configuration examples included for easy adoption.
元数据
Slug memory-layer
版本 0.1.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Memory Layer 是什么?

基于 Claude Code 记忆哲学的三层记忆管理系统。当需要以下操作时使用:(1) 设计 Index/Topic/Transcript 记忆架构,(2) 迁移现有记忆文件到分层结构,(3) 配置 autoDream 自动整理,(4) 优化上下文窗口使用率 70%+,(5) 实现基于重要性评分的记忆排序和检索。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 102 次。

如何安装 Memory Layer?

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

Memory Layer 是免费的吗?

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

Memory Layer 支持哪些平台?

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

谁开发了 Memory Layer?

由 whyischen(@whyischen)开发并维护,当前版本 v0.1.1。

💬 留言讨论