openclaw - ✅(Solved) Fix Feature: Sleep-based memory consolidation for agents [1 pull requests, 1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#59258Fetched 2026-04-08 02:26:47
View on GitHub
Comments
1
Participants
1
Timeline
5
Reactions
2
Author
Participants
Timeline (top)
commented ×1cross-referenced ×1mentioned ×1referenced ×1

Discussion originated on Sales Brains (WhatsApp) between @tuhaj, Dagmara, and Xavier (agent). The memory problem has been recurring for weeks - documented fixes (checkpoints, rules, dashboard tracking) help but don't solve the root cause: raw accumulation without consolidation.

/cc @tuhaj

Root Cause

Discussion originated on Sales Brains (WhatsApp) between @tuhaj, Dagmara, and Xavier (agent). The memory problem has been recurring for weeks - documented fixes (checkpoints, rules, dashboard tracking) help but don't solve the root cause: raw accumulation without consolidation.

Fix Action

Fixed

PR fix notes

PR #59262: feat: memory-sleep skill - agent memory consolidation

Description (problem / solution / changelog)

Summary

Adds a new memory-sleep skill that implements nightly memory consolidation for agents, inspired by biological NREM+REM sleep cycles.

Problem

Agents accumulate daily notes (10KB+/day) that cause "session drift" - forgetting decisions, repeating mistakes, losing project context. Each new session starts from zero with bloated, unstructured notes.

Solution

Three-phase consolidation cycle running as a nightly cron job:

Phase 1: NREM - Stabilize

  • Scan last 3 days of daily notes
  • Classify entries as KEEP (decisions, facts, lessons) or DISCARD (routine logs, duplicates)

Phase 2: REM - Integrate

  • Update MEMORY.md with distilled insights
  • Maintain per-project summaries
  • Remove stale/outdated entries
  • Resolve contradictions (newer info wins)

Phase 3: Cleanup

  • Archive daily files >7 days into weekly summaries
  • Generate compact morning briefing (<2KB) for fast session bootstrap
  • Track consolidation metrics in sleep-log.json

Research

Based on peer-reviewed research showing sleep-like replay reduces catastrophic forgetting:

Origin

Discussion on WhatsApp (Sales Brains group) about agent memory problems led to the insight that agents need a "sleep" equivalent. Issue: #59258

Files

  • skills/memory-sleep/SKILL.md - Complete skill with phases, criteria, setup instructions, and metrics

Changed files

  • openclaw-2026-04-01.log (added, +38/-0)
  • openclaw-2026-04-02.log (added, +10/-0)
  • skills/memory-sleep/SKILL.md (added, +151/-0)
RAW_BUFFERClick to expand / collapse

Problem

Agents suffer from "catastrophic forgetting" between sessions. Each session starts from zero, relying on raw daily notes that grow large (10KB+/day) and often aren't fully read on startup. This leads to:

  • Lost project context between sessions
  • Repeated mistakes (same errors documented multiple times)
  • Growing memory files that become too large to process effectively

Proposal: Agent "Sleep" - Nightly Memory Consolidation

Inspired by biological sleep cycles (NREM stabilization + REM integration), implement a scheduled consolidation process that runs during off-hours:

Phase 1: NREM-like stabilization

  • Review daily notes from last 2-3 days
  • Extract significant decisions, outcomes, and action items
  • Discard noise (routine logs, duplicate info, resolved issues)

Phase 2: REM-like integration

  • Update long-term memory (MEMORY.md) with distilled insights
  • Create/update per-project summaries for quick context loading
  • Build cross-references between related topics
  • Remove outdated information

Phase 3: Cleanup

  • Archive old daily files (>7 days) into compressed summaries
  • Validate memory consistency (no contradictions, stale data)
  • Generate a "morning briefing" optimized for fast session bootstrap

Implementation Ideas

  • Cron job running at ~4:00 AM (off-peak, cheaper model like Sonnet)
  • Could be a reusable OpenClaw skill (sleep / memory-consolidation)
  • Configurable consolidation rules per agent
  • Metrics: track context load time, memory hit rate, forgotten-topic incidents

Research

Context

Discussion originated on Sales Brains (WhatsApp) between @tuhaj, Dagmara, and Xavier (agent). The memory problem has been recurring for weeks - documented fixes (checkpoints, rules, dashboard tracking) help but don't solve the root cause: raw accumulation without consolidation.

/cc @tuhaj

extent analysis

TL;DR

Implement a nightly memory consolidation process to reduce catastrophic forgetting in agents by stabilizing and integrating significant information from daily notes.

Guidance

  • Review the proposed three-phase consolidation process (NREM-like stabilization, REM-like integration, and Cleanup) to understand how it can help mitigate the issue of catastrophic forgetting.
  • Consider implementing a cron job to run the consolidation process during off-peak hours (e.g., 4:00 AM) using a cheaper model like Sonnet.
  • Evaluate the potential benefits of creating a reusable OpenClaw skill (sleep / memory-consolidation) to make the consolidation process more efficient and scalable.
  • Track relevant metrics, such as context load time, memory hit rate, and forgotten-topic incidents, to measure the effectiveness of the consolidation process.

Example

No specific code snippet is provided, but the implementation ideas suggest using a cron job and a reusable OpenClaw skill to automate the consolidation process.

Notes

The proposed solution is inspired by biological sleep cycles and has been researched in the context of artificial neural networks. However, the effectiveness of this approach may vary depending on the specific use case and implementation details.

Recomm

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING