← 返回 Skills 市场
113
总下载
0
收藏
0
当前安装
6
版本数
在 OpenClaw 中安装
/install layered-memory-sys
功能描述
提供基于6层架构的分层记忆管理,支持SQLite存储、本地嵌入搜索、中文分词、时间衰减及REST/WebSocket接口。
使用说明 (SKILL.md)
layered-memory-sys
分层记忆系统 — 6层架构的智能记忆管理。
6层记忆架构
- 核心层 (永久) → MEMORY.md
- 沉淀层 (90天) → 重要决策/项目经验
- 关注层 (30天) → 反复讨论的话题
- 活跃层 (7天) → 正在进行的任务
- 闪存层 (3天) → 临时查询/一次性问答
- Session (实时) → 当前对话上下文
功能
- 📊 分层 TTL 管理 — 自动升级/归档/遗忘
- 💤 梦境模式 — 巩固、归档、遗忘、合并
- 🔍 TF-IDF 搜索 — 中文关键词搜索
- 📈 统计面板 — HTML 可视化健康报告
- ⚙️ 路径配置化 — 支持环境变量和配置文件
- 🤖 自动写入检测 — 从对话中识别值得记住的内容
快速开始
测试
cd skills/layered-memory-sys
node scripts/test-v2.mjs
梦境模式
node scripts/dream-cycle.mjs
统计面板
node scripts/stats-panel.mjs
使用方式
该技能通过记忆索引 (memory/index.json) 管理记忆数据。
记忆层级
| 层级 | TTL | 说明 |
|---|---|---|
| flash | 3天 | 临时查询、一次性问答 |
| active | 7天 | 正在进行的任务 |
| attention | 30天 | 反复讨论的话题 |
| settled | 90天 | 重要经验、决策记录 |
升级规则
- 同一话题被召回 ≥3 次 → flash → active
- 多天连续被召回 → active → attention
- 召回 ≥10 次 → attention → settled
- 用户说"记住这个" → 直接进沉淀层
配置
支持环境变量 + 配置文件 (memory/config.json) + 默认值三级覆盖:
| 环境变量 | 说明 |
|---|---|
| MEMORY_DIR | 记忆数据目录 |
| SESSION_DIR | Session 日志目录 |
依赖
| 依赖 | 用途 | 必需 |
|---|---|---|
| sql.js | SQLite WASM 存储 | ✅ |
| nodejieba | 中文分词 | 推荐 |
| ws | WebSocket | 可选 |
版本历史
- v1.1.2 — bug fix: 合并跳过提醒记忆 / 过滤系统消息
- v1.1 — 向量搜索/路径配置化/统计面板/自动写入检测
- v1.0 — 6层架构 + 梦境模式
安全使用建议
This skill implements a local memory system that reads your agent session logs and writes a memory index, archive files, dream logs and stats. Before installing or enabling it:
- Review and approve which directory it will use (MEMORY_DIR/SESSION_DIR). Note: one file hardcodes /root/.openclaw/agents/main/sessions — update or audit that path if you don't want it to read system sessions.
- Expect it to automatically create memory entries from recent conversations (auto-write/dream-cycle). If that behaviour is undesirable, turn off autoWrite in config.
- If you enable embedding providers, the skill may require API keys (DOUBAO/DASHSCOPE/@xenova) not declared in the registry metadata — confirm which secrets you supply.
- Run the skill in an isolated environment or with restricted filesystem permissions until you are comfortable with its behavior; inspect the omitted/remaining files (embedder/tokenizer and any network code) before granting network or session access.
- If you plan to run the API/WS panel, bind it to localhost or a controlled interface and consider firewalling the ports.
These inconsistencies look like sloppy configuration rather than clear malicious intent, but they materially affect privacy — treat the skill as potentially sensitive and verify config/paths and optional code before use.
功能分析
Type: OpenClaw Skill
Name: layered-memory-sys
Version: 1.1.3
The skill implements a sophisticated multi-layered memory system for AI agents, featuring automated memory consolidation ("dream mode") and session log analysis. It is classified as suspicious due to significant security vulnerabilities: the REST API and WebSocket servers (src/api/server.mjs, src/api/ws.mjs) lack authentication and implement a permissive CORS policy ("*"), potentially exposing sensitive conversation history to unauthorized access. Additionally, the system automatically transmits session data to external AI providers (Doubao at ark.cn-beijing.volces.com and Dashscope at dashscope.aliyuncs.com) for summarization and embeddings, which are high-risk data handling practices despite being documented features.
能力标签
能力评估
Purpose & Capability
Name/description, SKILL.md and code consistently implement a layered memory system (TTL, consolidation, archive, dream cycle, REST/WS panel, TF‑IDF, optional embedding/tokenizer). Reading session logs and managing a local memory index is coherent with the stated purpose, but this capability requires access to user conversation logs and filesystem paths which are high‑impact and should be expected/explicit.
Instruction Scope
Runtime instructions and code read session log files and update a memory index (memory/index.json, archive.md, dream-log.md, stats files). The auto-write/dream-cycle logic scans recent session .jsonl files and may automatically create memory entries from conversation content. Additionally, one module (scripts/session-search.mjs) hardcodes SESSION_DIR as '/root/.openclaw/agents/main/sessions' instead of using the configurable path — an inconsistency that can cause the skill to access session data even if you configured a different directory.
Install Mechanism
No install spec is provided (instruction-only skill). The package is source code only; installing requires running npm install per README. No external URL downloads or opaque installers were observed in the provided files.
Credentials
Registry metadata declares no required env vars, but README and assets reference environment variables and API keys (MEMORY_DIR, SESSION_DIR, DOUBAO_API_KEY, DASHSCOPE_API_KEY, MEMORY_WORKSPACE). Optional embedding providers may require API keys. The skill will operate without credentials for local TF‑IDF/SQL storage, but if you enable cloud/local embedding you may need to provide keys — these env vars are mentioned in docs but not declared by the registry, which is an inconsistency you should confirm.
Persistence & Privilege
The skill does not request 'always: true'. It includes a heartbeat handler and scripts intended to be run periodically (or by a heartbeat system) and registers an API/WS server on localhost when started. Autonomous invocation is allowed by default (normal), which combined with session-reading code increases blast radius if the agent is allowed to run the skill unattended. It does not appear to modify other skills or global configs.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install layered-memory-sys - 安装完成后,直接呼叫该 Skill 的名称或使用
/layered-memory-sys触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.3
更新技能介绍文档
v1.1.2
恢复发布; fix: 合并时跳过带remindAt的提醒记忆; fix: 过滤心跳模板/系统元数据避免误检测
v2.0.0
v2.0 全面重构:SQLite存储(jieba分词/TF-IDF搜索/并发安全);Cron调度器(梦境模式每小时检查/提醒每分钟检查);REST API(HTTP端点/WebSocket实时);事件总线;Session日志搜索;时间衰减召回;合并来源追溯;v1.2功能集成(上下文补齐/Session分组/LLM摘要);自动JSON迁移
v1.1.1
fix: 合并时跳过带remindAt的提醒记忆; fix: 过滤心跳模板/系统元数据避免误检测
v1.1.0
v1.1: 向量搜索+路径配置化+统计面板+自动写入检测
v1.0.0
- 首次发布:layered-memory-sys 1.0.0 实现分层记忆系统。
- 提供类人6层记忆架构,支持自动管理TTL与生命周期。
- 集成梦境模式:定期自动巩固、遗忘、归档与合并记忆。
- 内置语义相似度检测与session日志优先检索机制。
- 支持对不同类型任务和记忆升级进行自动分层与整理。
元数据
常见问题
Layered Memory Sys 是什么?
提供基于6层架构的分层记忆管理,支持SQLite存储、本地嵌入搜索、中文分词、时间衰减及REST/WebSocket接口。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 113 次。
如何安装 Layered Memory Sys?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install layered-memory-sys」即可一键安装,无需额外配置。
Layered Memory Sys 是免费的吗?
是的,Layered Memory Sys 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Layered Memory Sys 支持哪些平台?
Layered Memory Sys 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Layered Memory Sys?
由 141553(@141553)开发并维护,当前版本 v1.1.3。
推荐 Skills