← Back to Skills Marketplace
141553

Layered Memory Sys

by 141553 · GitHub ↗ · v1.1.3 · MIT-0
cross-platform ⚠ suspicious
113
Downloads
0
Stars
0
Active Installs
6
Versions
Install in OpenClaw
/install layered-memory-sys
Description
提供基于6层架构的分层记忆管理,支持SQLite存储、本地嵌入搜索、中文分词、时间衰减及REST/WebSocket接口。
README (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层架构 + 梦境模式
Usage Guidance
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.
Capability Analysis
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.
Capability Tags
cryptorequires-sensitive-credentials
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install layered-memory-sys
  3. After installation, invoke the skill by name or use /layered-memory-sys
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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日志优先检索机制。 - 支持对不同类型任务和记忆升级进行自动分层与整理。
Metadata
Slug layered-memory-sys
Version 1.1.3
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 6
Frequently Asked Questions

What is Layered Memory Sys?

提供基于6层架构的分层记忆管理,支持SQLite存储、本地嵌入搜索、中文分词、时间衰减及REST/WebSocket接口。 It is an AI Agent Skill for Claude Code / OpenClaw, with 113 downloads so far.

How do I install Layered Memory Sys?

Run "/install layered-memory-sys" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Layered Memory Sys free?

Yes, Layered Memory Sys is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Layered Memory Sys support?

Layered Memory Sys is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Layered Memory Sys?

It is built and maintained by 141553 (@141553); the current version is v1.1.3.

💬 Comments