← Back to Skills Marketplace
minmengxhw-cpu

Enhanced Memory System V2

by minmengxhw-cpu · GitHub ↗ · v1.2.0 · MIT-0
cross-platform ⚠ suspicious
90
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install enhanced-memory-v2
Description
完整记忆系统 - 文件系统记忆 + 向量搜索 + 四类记忆分类 + AutoDream 自动整合
README (SKILL.md)

Memory System 🧠

完整记忆系统 - 文件系统记忆 + 向量搜索 + 四类记忆分类 + AutoDream 自动整合 + Feedback 双向记录

特性

  • 📁 文件系统存储 - 基于 Markdown 文件,无数据库依赖
  • 🔍 语义搜索 - 支持 Ollama 向量搜索
  • 自动加载 - 会话启动时自动加载相关记忆
  • 💾 Memory Flush - 上下文接近阈值时自动持久化
  • 📝 四类记忆分类 - User / Feedback / Project / Reference
  • 🔄 Feedback 双向记录 - 同时记录纠正和确认
  • 🌙 AutoDream - 定时自动整合记忆,保持记忆新鲜

安装

clawhub install memory-system

核心概念

1. 四类记忆

类型 作用域 用途 保存时机
User 私密 用户角色、偏好、知识 了解用户任何细节
Feedback 私密/团队 用户的纠正和确认 用户纠正或确认时
Project 团队 项目进展、目标、决策 了解项目动态时
Reference 团队 外部系统指针 发现外部资源时

2. Feedback 双向记录

为什么重要?

只记录"不要做什么" → AI 会变得保守,不敢做决定

双向记录 → AI 既能避免错误,也能复用成功经验

### 不要mock数据库
**Type:** negative
**Why:** 上一季度mock测试通过了但生产迁移失败
**How to apply:** 集成测试必须用真实数据库

### 接受单PR而非多个小PR
**Type:** positive
**Why:** 拆分反而造成不必要的开销
**How to apply:** 重构类需求优先合并为大PR

3. AutoDream 🌙

自动记忆整合系统,在空闲时整理记忆。

触发条件:

  • 距离上次整合 >= 24 小时
  • 新增 >= 3 个会话

整合任务:

  1. 扫描现有记忆文件
  2. 识别过时信息并删除
  3. 更新 MEMORY.md 索引
  4. 合并重复记忆

工具

memory_search

语义搜索记忆文件。

{
  "query": "用户偏好",
  "type": "user",
  "topK": 5
}

memory_write

写入或追加记忆。

{
  "file": "feedback/dev-rules.md",
  "content": "### 不要mock数据库\
**Type:** negative\
**Why:** ...\
**How to apply:** ...",
  "type": "feedback",
  "mode": "append"
}

memory_flush

手动触发记忆持久化。

{ "force": true }

memory_dream ⭐

执行 AutoDream 记忆整合。

{ "force": false }
  • 默认检查触发条件(时间 + 会话数)
  • force: true 强制执行

memory_dream_status

查看 AutoDream 状态。

{}

返回:

  • 上次整合时间
  • 距下次触发还需多久
  • 当前记忆文件数

配置

{
  "skills": {
    "memory-system": {
      "memoryDir": "~/.openclaw/workspace/memory",
      "flushMode": "safeguard",
      "softThresholdTokens": 300000,
      "vectorEnabled": true,
      "embeddingModel": "nomic-embed-text",
      "autoDream": {
        "enabled": true,
        "minHours": 24,
        "minSessions": 3
      }
    }
  }
}

AutoDream 配置

参数 默认值 说明
enabled true 是否启用
minHours 24 最小触发间隔(小时)
minSessions 3 最小新增会话数

目录结构

memory/
├── MEMORY.md              # 索引文件
├── .auto-dream-state.json # AutoDream 状态
├── user/                  # 用户记忆
├── feedback/              # 反馈记忆
│   ├── positive/         # 正面确认
│   └── negative/         # 纠正指导
├── project/              # 项目记忆
├── reference/            # 引用记忆
└── sessions/             # 会话历史

最佳实践

保存记忆

了解用户 → 保存到 user/
收到反馈 → 保存到 feedback/
了解项目 → 保存到 project/
发现资源 → 保存到 reference/

格式规范

### [标题]
**Type:** negative | positive
**Why:** [原因]
**How to apply:** [何时应用]
**Date:** YYYY-MM-DD

索引规范

  • 每条索引 \x3C= 150 字符
  • 绝对日期代替相对日期
  • 定期清理过时记忆

版本

1.2.0 - 新增 AutoDream 自动整合系统
1.1.0 - 引入四类记忆分类 + Feedback 双向记录


作者:团宝 (openclaw)

Usage Guidance
Key things to consider before installing: - Backup your memory directory (~/.openclaw/workspace/memory by default). AutoDream describes deleting/merging outdated entries; even if the code currently only emits prompts, the overall flow can lead to deletions if an LLM or caller applies changes. - This skill calls local commands (exec('ollama list') and uses curl to http://localhost:11434). Make sure you have a local Ollama service and curl available if you want vector search; the skill metadata did not declare these required binaries — runtime failures are likely otherwise. - There is a dependency/typo inconsistency (embed default uses 'nomatic-embed-text' but config and dependencies mention 'nomic-embed-text'). Expect embedding issues; review embed.ts before trusting semantic search results. - The skill dynamically imports platform APIs (import('openclaw')) to read session token counts; this is expected for integration but means the skill interacts with runtime session state. - The skill uses child_process and shell-calls. Although network calls are to localhost in the code, child_process usage can run arbitrary commands — review the code and ensure you trust the author. - Recommended actions: run in an isolated environment or test agent, set autoDream.enabled = false and flushMode = 'manual' in config initially, ensure you have file backups, and audit the code paths that would modify or delete files before enabling automated hooks. If you want, I can point out the exact lines where the shell calls, file-writes, and AutoDream prompt generation occur and suggest concrete config changes to reduce risk (e.g., disable onHeartbeat, set autoDream.enabled=false).
Capability Analysis
Type: OpenClaw Skill Name: enhanced-memory-v2 Version: 1.2.0 The skill bundle implements a functional memory system but contains critical security vulnerabilities that could be exploited. Specifically, the `memory_get` and `memory_write` tools in `src/get.ts` and `src/write.ts` are vulnerable to Path Traversal, as they allow absolute paths or parent directory references (e.g., '../../') to access files outside the intended memory directory. Additionally, `src/embed.ts` uses `child_process.exec` to execute a `curl` command with parameters derived from user-controlled text, creating a risk of Shell Injection. While these represent significant RCE and data access risks, they appear to be unintentional design flaws rather than deliberate malicious logic.
Capability Assessment
Purpose & Capability
The code implements the declared features (file-based memory, vector search via Ollama, auto-load/flush, AutoDream consolidation). However, there are mismatches: the skill.json lists dependencies ('ollama', 'nomic-embed-text') and the code calls the 'ollama' command and invokes curl, yet the metadata's 'required binaries' lists none. This omission is disproportionate: running vector embedding requires a local Ollama service and a curl/binary or an 'ollama' binary accessible on PATH. Also there is a small naming inconsistency in embed defaults ('nomatic-embed-text' vs 'nomic-embed-text') which looks like a bug.
Instruction Scope
SKILL.md and code legitimately read and write many files under the configured memoryDir (expected for a memory system). But AutoDream's described behavior includes '识别过时信息并删除' (identify and delete outdated information). The code's executeDream builds a prompt that instructs an LLM to delete/merge memory files; while the code itself doesn't directly delete files, the prompt delegates destructive decisions to an LLM or caller — that grants broad discretion to modify or remove user files. The skill also attempts to read session token counts via dynamic import('openclaw'), which accesses platform runtime state. These behaviors expand scope beyond passive read-only memory access and warrant caution.
Install Mechanism
There is no install spec (files are present in the bundle), so no external download step is present — good. But the code executes shell commands ('ollama list' and curl) and skill.json declares dependencies that may not correspond to npm packages; the lack of declared required binaries (curl, ollama) is inconsistent and may lead to runtime surprises. No remote/external download URLs or obfuscated installers were found.
Credentials
The skill does not request secrets or external API keys. It reads HOME and platform-provided APIs (globalThis.openclaw / import('openclaw')) which is expected for an OpenClaw skill. It does not attempt to exfiltrate to remote hosts — network calls are directed to localhost:11434 (Ollama).
Persistence & Privilege
The skill is not 'always: true' but registers hooks (onSessionStart, onHeartbeat). onHeartbeat will automatically check and (if conditions met) run AutoDream; that means the skill can autonomously run periodic consolidation logic and update its .auto-dream-state.json and possibly prompt an LLM to change memory content. This autonomous behavior combined with the potential to delete/merge memory files increases risk — consider disabling AutoDream until reviewed.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install enhanced-memory-v2
  3. After installation, invoke the skill by name or use /enhanced-memory-v2
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.2.0
v1.2.0: 新增AutoDream自动整合系统
Metadata
Slug enhanced-memory-v2
Version 1.2.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Enhanced Memory System V2?

完整记忆系统 - 文件系统记忆 + 向量搜索 + 四类记忆分类 + AutoDream 自动整合. It is an AI Agent Skill for Claude Code / OpenClaw, with 90 downloads so far.

How do I install Enhanced Memory System V2?

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

Is Enhanced Memory System V2 free?

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

Which platforms does Enhanced Memory System V2 support?

Enhanced Memory System V2 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Enhanced Memory System V2?

It is built and maintained by minmengxhw-cpu (@minmengxhw-cpu); the current version is v1.2.0.

💬 Comments