← 返回 Skills 市场
yingdadaa

Layered Memory

作者 yingdadaa · GitHub ↗ · v1.2.0 · MIT-0
cross-platform ⚠ suspicious
354
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install layered-memory
功能描述
基于 L0/L1/L2 三层结构的分层记忆管理系统,大幅减少 Token 消耗。L0 节省 99% Token(摘要层),L1 节省 88%(概览层),L2 为完整内容。支持自动生成分层文件、智能按需加载、防重复写入。适用于需要高效管理大型记忆文件的场景。
使用说明 (SKILL.md)

Layered Memory Management System

分层记忆管理系统,通过 L0/L1/L2 三层结构智能加载记忆,减少 Token 消耗。

层级说明

  • L0 (Abstract): 极简摘要,节省 ~99% Token
  • L1 (Overview): 结构概览,节省 ~88% Token
  • L2 (Full): 完整内容,按需加载

使用方式

# 生成所有记忆文件的分层
node index.js generate --all

# 为单个文件生成分层
node index.js generate ~/clawd/MEMORY.md

参考文档

安全使用建议
This skill appears to implement the claimed layered-memory functionality, but it has notable inconsistencies that you should resolve before installing or running it with real data: 1) Verify the external scripts it calls (~/clawd/scripts/generate-layers-simple.js, memory-extractor.js, memory-archiver.js) actually exist and inspect their contents — the package does not include them. 2) Do not run this on sensitive conversation data until you confirm the helper scripts are trusted; execSync will execute whatever code is at those locations. 3) Confirm the publisher/source (none provided) and ask for a release that bundles all necessary components or documents required runtime files. 4) Consider running in an isolated environment (container or VM) and back up your ~/clawd memory files before use. 5) If you need a safer choice, prefer a version that includes all scripts in the package or one from a known homepage/repository with a validated LICENSE and reproducible build.
功能分析
Type: OpenClaw Skill Name: layered-memory Version: 1.2.0 The skill implements a memory management system that relies on high-risk execution patterns, specifically using 'execSync' in 'index.js' to run shell commands for generating and reading memory layers. It employs an 'agent:bootstrap' hook in 'hooks/openclaw/handler.js' to inject instructions that command the AI agent to execute these shell scripts based on token usage thresholds. While the behavior appears aligned with the stated goal of token optimization, the architecture of using prompt injection to trigger shell execution creates a significant attack surface for potential command injection or unauthorized local execution.
能力评估
Purpose & Capability
The skill claims to be a self-contained L0/L1/L2 memory manager, but its code expects multiple scripts and files in ~/clawd/scripts (e.g. generate-layers-simple.js, memory-extractor.js, memory-archiver.js) that are not bundled. test.js also expects a LICENSE file and scripts under the user's HOME. Requiring external files in the user's home without declaring them is disproportionate to the described purpose and will cause failures or silently execute whatever is present there.
Instruction Scope
SKILL.md describes benign CLI usage (generate/read/search) and integration guidance (cron, hooks). However documentation and code instruct reading/writing many files under HOME (~/clawd, ~/.clawd, memory daily files) and installing cron/hooks. The hook injects a bootstrap reminder into agent bootstrapFiles. These actions are consistent with a memory manager, but they also give the skill access to conversation contents and local files — so verify you want a skill that will read/write your workspace memory files.
Install Mechanism
There is no install spec (instruction-only), but the published bundle includes operational code (index.js, hooks, tests). The code runs child_process.execSync to execute scripts located in ~/clawd/scripts. Because the skill does not bundle those scripts, it implicitly depends on arbitrary files in the user's HOME; this is risky because execSync will execute whatever is present at those paths.
Credentials
The manifest declares no required env vars, but lib/config-loader will read environment variables prefixed with LAYERED_MEMORY_. index.js and many docs rely on process.env.HOME and global paths. More importantly, the skill reads/writes user memory files and state files (e.g. ~/.clawd/.memory-checker-state.json, ~/clawd/memory/daily/...) — appropriate for a memory manager but sensitive. The package does not declare or justify its dependency on external scripts in HOME, nor include a LICENSE file referenced by tests, which is inconsistent.
Persistence & Privilege
always:false (good). The skill installs an OpenClaw hook (handler.js) that injects a bootstrap reminder into agent context — expected for a memory helper. Combined with autonomous invocation and the ability to exec local scripts, this increases impact if the external scripts or paths are untrusted. The skill does not request other skills' configs, but it will read/write local memory files and state files.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install layered-memory
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /layered-memory 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.2.0
v1.2.0: Add config loader, concurrent processing, incremental generation, dry-run mode, verbose logging. Full rewrite of generator with performance improvements. 10/10 tests passing.
v1.1.0
v1.1.0: Add test suite, config example, benchmark script, contributing guide. Fix missing test.js. Improved documentation and hooks. Enhanced error handling.
v1.0.0
- 首次发布:提供分层记忆管理系统 layered-memory。 - 采用 L0/L1/L2 三层结构,智能加载记忆内容,大幅减少 Token 消耗。 - 支持自动生成摘要层、概览层和完整内容层的分层文件。 - 提供自动按需加载与防重复写入功能。 - 适用于高效管理和调用大型记忆文件。
元数据
Slug layered-memory
版本 1.2.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 3
常见问题

Layered Memory 是什么?

基于 L0/L1/L2 三层结构的分层记忆管理系统,大幅减少 Token 消耗。L0 节省 99% Token(摘要层),L1 节省 88%(概览层),L2 为完整内容。支持自动生成分层文件、智能按需加载、防重复写入。适用于需要高效管理大型记忆文件的场景。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 354 次。

如何安装 Layered Memory?

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

Layered Memory 是免费的吗?

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

Layered Memory 支持哪些平台?

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

谁开发了 Layered Memory?

由 yingdadaa(@yingdadaa)开发并维护,当前版本 v1.2.0。

💬 留言讨论