← 返回 Skills 市场
cyunxh

auto_dream

作者 cyunxh · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
114
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install dreamclaw
功能描述
基于 Claude Code Auto Dream 架构,辅助手动追加日志并定期整合分析生成分类记忆文件和索引管理系统。
使用说明 (SKILL.md)

Auto Dream Skill - 记忆整合系统

参考 Claude Code Auto Dream 架构的记忆整合工具。

架构设计

.auto-dream/
├── logs/                      # 每日追加日志(append-only)
│   └── YYYY/MM/YYYY-MM-DD.md
├── memories/                  # 分类记忆文件
│   ├── user/
│   ├── feedback/
│   ├── project/
│   └── reference/
└── MEMORY.md                  # 索引(由记忆文件生成)

4 种记忆类型

类型 说明 例子
user 用户角色、目标、偏好 "用户想每周读完一本书"
feedback 用户的指导/纠正 "不要用那个方法"
project 项目上下文、决定 "项目用 Python 3.12"
reference 外部系统指针 "基金数据在 localhost:5000"

两阶段工作流

阶段1: Append(对话中随时)
  └── 追加记忆条目到 logs/YYYY-MM-DD.md

阶段2: Dream(定时或手动)
  └── AI 分析日志 + 现有记忆
        ├── Phase 1: Orient - 了解现有结构
        ├── Phase 2: Gather - 收集信号
        ├── Phase 3: Consolidate - 创建/更新/删除记忆
        └── Phase 4: Prune - 更新 MEMORY.md 索引

使用方法

1. 追加记忆(Append Mode)

方式一:命令行追加

python3 ~/.openclaw/skills/auto-dream/scripts/auto_dream.py append "用户想每周读完一本书" --type project

方式二:直接编辑日志

# 直接往今天的日志文件追加
nano ~/.openclaw/workspace/.auto-dream/logs/2026/04/2026-04-01.md
# 格式:
# - [2026-04-01 14:30] 用户想通过内容平台分享知识

格式说明

  • 追加是 append-only,不要修改旧内容
  • 每条格式:- [时间戳] 内容
  • 时间戳帮助 AI 判断时效性

2. 运行蒸馏(Dream Mode)

手动触发(推荐)

说 "整理记忆" 或 "dream"

AI 会读取:

  1. 每日日志(logs/)
  2. 现有记忆文件(memories/)
  3. 最近的会话记录

然后按 4 阶段执行整合。

命令行触发

python3 ~/.openclaw/skills/auto-dream/scripts/auto_dream.py check   # 查看状态
python3 ~/.openclaw/skills/auto-dream/scripts/auto_dream.py list     # 列出记忆
python3 ~/.openclaw/skills/auto-dream/scripts/auto_dream.py build-index  # 重建索引

3. 查看记忆

python3 ~/.openclaw/skills/auto-dream/scripts/auto_dream.py list

4 阶段蒸馏 Prompt

当你说 "整理记忆" 时,AI 会执行以下 4 阶段:

Phase 1: Orient(了解现状)

- ls memory/ 目录,查看现有结构
- 读 MEMORY.md 索引
- 浏览现有记忆文件,避免重复

Phase 2: Gather(收集信号)

1. 读每日日志 logs/YYYY/MM/YYYY-MM-DD.md
2. 检查与现状矛盾的旧记忆
3. 必要时 grep 会话记录

Phase 3: Consolidate(整合)

关键判断(AI 做):
- 哪些日志内容值得保存为独立记忆文件?
- 哪些旧记忆被证伪/过时了?→ 删除
- 哪些旧记忆需要更新?
- 新内容合并到现有 topic 还是新建?

格式(frontmatter):
---
name: \x3C简短标题>
type: \x3Cuser|feedback|project|reference>
description: \x3C一句话描述>
mtime: \x3CISO时间>
---

\x3C可选正文>

Phase 4: Prune & Index(修剪索引)

- MEMORY.md ≤ 200 行 + ~25KB
- 每条索引 ≤ ~150 字符
- 删除过时/矛盾指针
- 格式:- [Title](memories/\x3Ctype>/file.md) — 一句话描述

记忆文件 Frontmatter 示例

# memories/project/20260312_阅读目标.md
---
name: 每周阅读目标
type: project
description: 用户想每周读完一本书
mtime: 2026-03-12T10:30:00.000
---

用户在 2026-03-12 设定的目标:
- 目标:每周读完一本书
- 类型:技术书/小说/商业书轮换
- 记录:读完后写笔记到 Obsidian
# memories/feedback/20260320_不用那个方法.md
---
name: 避免使用XX方法
type: feedback
description: 用户明确不要用某方法
mtime: 2026-03-20T15:00:00.000
---

用户在 2026-03-20 说:不要用那个方法XX
原因:之前试过,效果不好

MEMORY.md 格式

# MEMORY.md - Long-term Memory

**最后更新**: 2026-04-01 14:30

## USER
- [20260312_用户角色.md](memories/user/20260312_用户角色.md) — username,开发者
- [20260315_用户目标.md](memories/user/20260315_用户目标.md) — 希望通过内容创作成长

## FEEDBACK
- [20260320_避免XX.md](memories/feedback/20260320_避免XX.md) — 不要用XX方式

## PROJECT
- [20260312_阅读目标.md](memories/project/20260312_阅读目标.md) — 每周读完一本书
- [20260325_基金系统.md](memories/project/20260325_基金系统.md) — 基金管理系统开发中

## REFERENCE
- [20260325_基金API.md](memories/reference/20260325_基金API.md) — 基金数据在 localhost:5000

与 Claude Code 的关键区别

功能 Claude Code OpenClaw
日志追加 助手自动追加 手动 append
蒸馏触发 24h + 5 sessions 自动 手动 "整理记忆"
AI 执行 forked sub-agent 主 agent 执行
Lock 机制 .consolidate-lock 无(单用户)
矛盾检测 AI prompt 引导 AI prompt 引导

核心区别:OpenClaw 的 Dream 由主 agent 触发和执行,而不是后台 sub-agent。因为:

  1. 单用户环境,不需要 lock
  2. AI 能力在主 session 中直接可用
  3. 简化架构

最佳实践

1. 对话中随时追加

当用户说 "记住 XXX" 或 "以后要记得 YYY":

python3 auto_dream.py append "用户偏好用方法A而不是方法B"

2. 每日一次整理

每天结束时或第二天说 "整理记忆",AI 会:

  • 读取过去1天的日志
  • 分析哪些该保留
  • 更新记忆文件

3. 周总结(可选 cron)

# 每周日 22:00 运行
0 22 * * 0 cd ~/.openclaw/skills/auto-dream/scripts && python3 auto_dream.py append "周总结..." && python3 -c "print('说 整理记忆 来触发蒸馏')"

命令速查

命令 用途
append "内容" 追加到今日日志
dream 运行蒸馏(由 AI 执行)
list 列出所有记忆
check 检查新鲜度
build-index 重建 MEMORY.md
安全使用建议
This skill appears to do what it says: read append-only logs and session transcripts, then create/update/delete local memory files and the MEMORY.md index. Before installing: (1) review the Python script yourself — it runs locally but will modify files under ~/.openclaw/workspace/.auto-dream and may remove old memories; (2) back up your MEMORY.md and memories/ directory; (3) prefer manual/interactive 'dream' runs (do not allow unattended cron/autonomous runs) until you're comfortable with its behavior; (4) if you want stricter containment, run the skill with filesystem permissions limited to a test directory or run in a VM/sandbox. If you can provide the rest of the truncated script or want me to audit specific functions (e.g., deletion logic, session parsing), I can re-check and raise the confidence level.
功能分析
Type: OpenClaw Skill Name: dreamclaw Version: 1.0.0 The 'dreamclaw' skill implements a memory consolidation system similar to Claude Code's 'Auto Dream' feature. It manages append-only logs and summarized memory files within the '~/.openclaw/workspace/.auto-dream/' directory and reads session history from '~/.openclaw/agents/main/sessions' to extract context. While the script (auto_dream.py) and instructions (SKILL.md) involve reading sensitive session data and generating prompts for the AI to process that data, the behavior is entirely consistent with the stated purpose of long-term memory management and lacks any indicators of data exfiltration, unauthorized execution, or malicious intent.
能力评估
Purpose & Capability
Name/description (memory consolidation / Auto Dream) match the actual behavior: the SKILL.md and script operate on a .auto-dream workspace (logs/, memories/, MEMORY.md) and session transcripts. There are no unrelated environment variables, external services, or surprising binaries requested.
Instruction Scope
The runtime instructions and built LLM prompt explicitly tell the agent to read daily logs, existing memories, and recent session transcripts and to create/update/delete memory files and update MEMORY.md. This is consistent with the stated purpose, but the instructions give the AI discretion to remove or modify files ("Deleting contradicted facts — remove it at the source"). That destructive capability is expected for a consolidation tool but is notable and should be safeguarded (backups, confirmation prompts).
Install Mechanism
No install spec (instruction-only plus a Python script). Nothing is downloaded from external URLs or installed automatically; risk from install mechanism is low. The single bundled script runs locally.
Credentials
The skill requests no environment variables, no external credentials, and only accesses files under the user's OpenClaw workspace (~/.openclaw/workspace/.auto-dream) and the agent sessions directory (~/.openclaw/agents/main/sessions). Those accesses are proportional to its purpose (using session transcripts as input).
Persistence & Privilege
always:false (no forced global inclusion). The skill, when invoked, can autonomously run consolidation and (per prompts) modify/delete files. Autonomous invocation is the platform default; combined with file-modification rights this means the skill can change user data — expected for this functionality but worth limiting (manual triggers or confirmations) if you want to avoid unintended deletions.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install dreamclaw
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /dreamclaw 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Auto Dream Claw 1.0.0 – Initial Release - Introduces a structured, append-only memory management system inspired by Claude Code's Auto Dream architecture. - Supports four memory types: user, feedback, project, and reference, with organized folders and YAML frontmatter. - Implements a two-stage workflow: "append" for capturing events/logs, and "dream" for manual memory consolidation and pruning. - Provides clear CLI commands for appending logs, listing memories, running consolidations, and rebuilding index files. - Designed for single-user environments with agent-driven memory integration and no lock mechanism required.
元数据
Slug dreamclaw
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

auto_dream 是什么?

基于 Claude Code Auto Dream 架构,辅助手动追加日志并定期整合分析生成分类记忆文件和索引管理系统。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 114 次。

如何安装 auto_dream?

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

auto_dream 是免费的吗?

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

auto_dream 支持哪些平台?

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

谁开发了 auto_dream?

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

💬 留言讨论