memory-sleep

Lightweight memory consolidation for OpenClaw agents. Reviews recent daily memory files (`memory/*.md`), extracts durable knowledge, and merges it into `MEMORY.md` without imposing a new file architecture. Triggers: dream, consolidate memory, memory consolidation. Works well with manual runs or a simple nightly cron.

3,880 stars

Best use case

memory-sleep is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Lightweight memory consolidation for OpenClaw agents. Reviews recent daily memory files (`memory/*.md`), extracts durable knowledge, and merges it into `MEMORY.md` without imposing a new file architecture. Triggers: dream, consolidate memory, memory consolidation. Works well with manual runs or a simple nightly cron.

Teams using memory-sleep should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/memory-sleep/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/balukov/memory-sleep/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/memory-sleep/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How memory-sleep Compares

Feature / Agentmemory-sleepStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Lightweight memory consolidation for OpenClaw agents. Reviews recent daily memory files (`memory/*.md`), extracts durable knowledge, and merges it into `MEMORY.md` without imposing a new file architecture. Triggers: dream, consolidate memory, memory consolidation. Works well with manual runs or a simple nightly cron.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Sleep — Lightweight Memory Consolidation for OpenClaw

`memory-sleep` is a small, conservative skill for agents that keep:
- daily notes in `memory/YYYY-MM-DD.md`
- long-term knowledge in `MEMORY.md`

It does **not** introduce extra indexes, dashboards, archives, or custom memory schemas.
Its job is simple: keep `MEMORY.md` fresh while daily files remain raw journals.

## Use When

- User says `dream`
- User asks to consolidate memory
- A nightly cron runs the skill
- Daily memory files are piling up and `MEMORY.md` is getting stale

## Goals

- Keep the existing OpenClaw-style memory structure
- Distill durable facts from recent journals
- Correct stale information in `MEMORY.md`
- Avoid over-editing or inventing new structure

## Inputs

- `MEMORY.md`
- `memory/YYYY-MM-DD.md` files

## Outputs

- Updated `MEMORY.md`
- Optional short run note appended to today's daily file

## Consolidation Flow

### 1. Orient

1. Read `MEMORY.md`
2. List files in `memory/`
3. Focus on recent daily files first

### 2. Scan Recent Daily Files

Default window: last **7 days**.

Extract only durable items such as:
- preferences
- decisions
- recurring facts
- important project context
- corrections to stale memory

Ignore or down-rank:
- routine acknowledgements
- temporary chatter
- one-off noise with no lasting value

### 3. Merge Conservatively into `MEMORY.md`

Use surgical edits only.

Allowed operations:
- **Add** new durable facts
- **Correct** stale facts with newer confirmed info
- **Deduplicate** overlapping entries
- **Prune** clearly obsolete items when confidence is high
- **Absolutize** relative dates where useful

Do **not**:
- rewrite the whole file unnecessarily
- create a new memory system
- add bureaucratic structure unless the file already uses it

### 4. Optional Journal Marking

For older files already consolidated, optionally prepend a short HTML comment such as:

```html
<!-- consolidated to MEMORY.md on YYYY-MM-DD -->
```

Never delete journal files.

### 5. Report Briefly

Return a short summary like:

```text
🌙 Dream complete
- Scanned N daily files
- MEMORY.md: +N added / ~N corrected / -N pruned
```

## Rules

- Prefer the existing workspace memory architecture
- `MEMORY.md` is the primary long-term memory output
- Daily files remain journals, not databases
- Be conservative when removing information
- Avoid leaking secrets into reports or memory summaries
- If logging the run, keep it short

## Recommended Cron

Nightly example:

```text
0 3 * * *
```

Example job message:

```text
Execute dream skill: consolidate memory
```

## Design Principle

This skill is intentionally minimal.

It is for users who want:
- lightweight consolidation
- compatibility with default OpenClaw memory habits
- no imposed sidecar files unless they choose to add them later

Think of it as a careful editor, not a memory framework.

Related Skills

Agent Memory Architecture

3891
from openclaw/skills

Complete zero-dependency memory system for AI agents — file-based architecture, daily notes, long-term curation, context management, heartbeat integration, and memory hygiene. No APIs, no databases, no external tools. Works with any agent framework.

memory-cache

3891
from openclaw/skills

High-performance temporary storage system using Redis. Supports namespaced keys (mema:*), TTL management, and session context caching. Use for: (1) Saving agent state, (2) Caching API results, (3) Sharing data between sub-agents.

General Utilities

Memory

3891
from openclaw/skills

Infinite organized memory that complements your agent's built-in memory with unlimited categorized storage.

Memory Management

auto-memory

3891
from openclaw/skills

Indestructible agent memory — permanently stored, never lost. Save decisions, identity, and context as a memory chain on the Autonomys Network. Rebuild your full history from a single CID, even after total state loss.

AI Persistence & Memory

Triple-Layer Memory System

3880
from openclaw/skills

三层记忆系统 - 解决 AI Agent 长对话记忆丢失和上下文管理问题

Memory & Context Management

Claude Code Memory Kit

3891
from openclaw/skills

Stop Claude Code from repeating mistakes — enforce guardrails, preserve context, maintain consistency across sessions

eo-ability-memory

3891
from openclaw/skills

主动记忆能力(Proactive Memory),跨会话延续用户偏好、项目上下文,记住导师要求和格式规范

memory-optimizer-base

3891
from openclaw/skills

多Agent记忆管理系统 - 开放协作的知识库解决方案 支持私有+公共双层记忆空间,自动生成每日总结,跨Agent知识检索

trip-guide-pdf-car-sleep

3891
from openclaw/skills

Research, plan, revise, and deliver car-sleep travel guides as HTML/PDF with verified overnight parking, charging, toilet access, next-morning route anchors, and formal copy. Use when the user plans to sleep in the car, skip hotels, use Tesla/EV camp mode, optimize for chargers and public parking, or asks whether the hiking/scenic route should change after removing lodging.

memory-lifecycle

3891
from openclaw/skills

Systematic memory management for long-running AI agents. Implements a five-tier lifecycle — heartbeat micro-attention, nightly consolidation, weekly reflection, monthly archiving, and yearly wisdom distillation. Use when setting up a new agent's memory system, improving an existing agent's memory quality, or when the agent's MEMORY.md is growing too large and context quality is degrading. Triggers on "set up memory", "memory management", "improve memory", "memory lifecycle", "nightly consolidation", "sleep cycle", "memory housekeeping".

memory-stack

3891
from openclaw/skills

AI 记忆栈架构 - 符合 2026 前沿的 AI 记忆系统。微调+RAG+ 上下文三层设计,mirrors 人类记忆工作方式。

Qoris Memory — Persistent Agent Memory

3891
from openclaw/skills

Git-like persistent memory for OpenClaw agents. Your agent remembers everything across sessions — versioned, branched, and mergeable like a repository. Never lose context again. Powered by Qoris AI.