🧠 Memory Never Forget 🧠

v4.1.3

Memory system v4.13: Dual-layer structure (todos for execution + knowledge for strategy) with Dream/Refinement memory mechanisms.

⭐ 3· 3k·15 current·16 all-time
Security findings were reviewed by staff and cleared for public use.

Runtime requirements

🧠 Clawdis
aivk970apxm4q6534qfgpz18yb2v5852txsassistantvk97ed3z1zd4y5ztsbqanj739t182841yatkinson-shiffrinvk970apxm4q6534qfgpz18yb2v5852txsbrainvk97ed3z1zd4y5ztsbqanj739t182841yclaude codevk970apxm4q6534qfgpz18yb2v5852txscontextvk97cyvqgms3wma0hcgw8jba2j183ze3klatestvk970apxm4q6534qfgpz18yb2v5852txsmemoryvk970apxm4q6534qfgpz18yb2v5852txsopenclawvk97ed3z1zd4y5ztsbqanj739t182841yproductivityvk970apxm4q6534qfgpz18yb2v5852txsthree-stage-memoryvk970apxm4q6534qfgpz18yb2v5852txs
3kdownloads
3stars
12versions
Updated 1d ago
v4.1.3
MIT-0

🧠 Memory Never Forget v4.13

A full-featured memory system for OpenClaw, integrating Active Memory retrieval, Memory Palace structured views, and a Dual-Layer Dream Verification mechanism β€” delivering "proactive memory + global view + verifiable consolidation."

Core Logic: Active Memory = Memory Butler, Memory Palace = Knowledge Palace, Dual-Layer Dream = Verification & Consolidation Expert

Three-Layer Separation: todos.md = Execution Layer | knowledge/ = Strategy Layer | memory/ = Classified Memory Layer

License: MIT-0 | Updated: 2026-04-18 | v4.13: Added dual-layer structure


Overview

This skill manages memory across two orthogonal dimensions:

  1. Temporal (Atkinson-Shiffrin 3-stage model) β€” what to keep vs. what to prune
  2. Content (4-type taxonomy) β€” where to store for fast retrieval

Three independent mechanisms work together:

MechanismTriggerWrite to disk?Purpose
Active MemoryEvery reply (before_prompt_build)❌ Read-onlyReal-time recall, inject relevant memories into current conversation
Dream (memory-core)Daily 12:30 cronβœ… MEMORY.md (Deep phase)Decide which memories promote or decay
Refinement (13:00)Daily 13:00 cron (user-defined)βœ… WriteableVerify Dream results, fill gaps

⚠️ v4.12b source-verified correction (2026-04-17): Clarified actual division of three mechanisms


Core Components

1. Active Memory β€” Proactive Recall (Source-Verified)

Trigger mechanism:

  • Hooked to before_prompt_build, auto-triggers before every reply
  • Spawns a read-only sub-agent with only memory_search + memory_get permissions
  • Builds query from current user message, searches recall index (memory/.dreams/short-term-recall.json)
  • Searched summaries are prepended to prompt before model generates reply
  • Results cached 15 seconds (cacheTtlMs) to avoid repeated recall in same turn

Key constraints:

  • ❌ Read-only, produces no files
  • ❌ Cannot call other tools
  • Only affects current conversation context, not persisted

Configuration (openclaw.json β†’ plugins.entries.active-memory.config):

{
  "enabled": true,
  "queryMode": "recent",      // message | recent | full
  "promptStyle": "balanced",  // balanced | strict | contextual | recall-heavy | precision-heavy | preference-only
  "maxSummaryChars": 220,
  "recentUserTurns": 2,
  "recentAssistantTurns": 1,
  "timeoutMs": 15000
}

2. Memory Palace β€” Structured Views

Provides multi-dimensional views of your agent's long-term memory:

  • Timeline β€” chronological view of work progress
  • Projects β€” aggregated by project
  • Technology β€” organized by tech domain
  • Custom β€” user-defined dimensions

3. Dream (memory-core) β€” Temporal Layering (Source-Verified)

Trigger: 30 12 * * * (cron), sessionTarget="main", payload="systemEvent: __openclaw_memory_core_short_term_promotion_dream__"

Three phases (Light β†’ REM β†’ Deep):

Source quote (formatPhaseGuide):
"deep is the only stage that writes durable entries to MEMORY.md. DREAMS.md is for human-readable dreaming summaries and diary entries."

PhaseOutputWrites files?Description
LightDream Diary prose entries→ DREAMS.mdOrganize session-corpus, 4 parallel sessions
REMTheme reflections→ DREAMS.mdExtract recurring themes
Deep6-dimensional weighted scoring signalsβœ… β†’ MEMORY.mdOnly phase that writes to MEMORY.md

Deep phase promotion parameters (adjust in cron job description):

  • minScore: 0.500 (tune based on your promotion rate)
  • minRecallCount: 3
  • minUniqueQueries: 3
  • recencyHalfLifeDays: 14
  • maxAgeDays: 30
  • limit: 10

⚠️ The following files are NEVER generated (source-verified):

  • ❌ memory/dreaming/deep/YYYY-MM-DD.md
  • ❌ memory/dreaming/light/YYYY-MM-DD.md
  • ❌ memory/dreaming/rem/YYYY-MM-DD.md

4. Refinement (User-Defined Cron) β€” Content Classification

Trigger: 0 13 * * * (user-defined cron), sessionTarget="isolated"

Nature: User-written AI agent prompt, not an OpenClaw native mechanism

Responsibilities:

  • Read Dream outputs (DREAMS.md, session-corpus)
  • Verify conflicts, hallucinations, outdated entries
  • Classify new memories into 4 categories (user/feedback/project/reference)
  • Write verification report to memory/dreaming/verify/YYYY-MM-DD.md

⚠️ Note: Verification reports' "supplementary promotion suggestions" are text only and won't automatically write to MEMORY.md. Manual promotion required.


Two Orthogonal Dimensions

DimensionFrameworkMechanismPurpose
Temporal (how long)Atkinson-Shiffrin 3-stage modelDream (memory-core) Deep phaseDecay β€” what to keep vs. prune
Content (where)4-type taxonomyRefinement 13:00 + agent proactive writesStorage β€” where to put for retrieval

Dimension 1: Temporal Layering

StageHuman EquivalentImplementationTTLAction
Sensory~0.25 sec perceptionCurrent input contextInstantFilter immediately
Short-termRecentModel context window 10 turns10 turnsPass through working filters
WorkingRecent ~7 daysmemory/YYYY-MM-DD.md + Active Memory7 daysExtract signal β†’ promote or decay
Long-termPermanentMEMORY.md (index) + classified filesPermanentPeriodic review, prune when stale

Dimension 2: Content Classification (4 Types)

Written by: agent proactively during conversation (not automatic)

TypeDirectoryContent ExampleWhen to Write
usermemory/user/User profile (role, preferences, knowledge, goals)When learning user preferences/profile
feedbackmemory/feedback/Lessons (corrections, confirmations, style)When user corrects or confirms
projectmemory/project/Project decisions/reasoning (raw material)When project has new progress/decision
referencememory/reference/External resources (links, tools, locations)When discovering new tools/resources

Important: Project execution state tracking (blockers, needs, progress) β†’ write directly to knowledge/project-tracker.md (strategy layer); only project experience, decision reasoning, retrospective summaries β†’ sublimate to memory/project/ (classified memory layer)


What to Save / What NOT to Save

βœ… Save

  • User's role, preferences, responsibilities, knowledge
  • User corrections ("not like that", "should be this way")
  • User confirmations ("yes exactly", "perfect, keep that")
  • Project decisions and the reasoning (not just what, but why)
  • New tools, links, resources
  • External system locations and their purpose

❌ Don't Save

  • ❌ Code patterns, architecture, file paths (derivable from codebase)
  • ❌ Git history (git log is the authoritative source)
  • ❌ Debugging solutions (the fix is in the code)
  • ❌ Anything already documented elsewhere
  • ❌ Ephemeral task state (write to todos.md instead)
  • ❌ Raw conversation content

MEMORY.md = Long-Term Index Only

MEMORY.md is the index of long-term memories only, never content. Format:

- [Title](path) β€” one-line description (<150 chars)

Memory File Format

Every classified memory file must have frontmatter:

---
name: Memory name
description: One-line description (used to judge relevance)
type: user|feedback|project|reference
created: YYYY-MM-DD
---

## Rule / Fact
(the content)

## Why
(reason / motivation)

## How to apply
(when and how to use this memory)

Memory Drift Caveat

Memories can become stale. Rules:

  1. Verify first: When referencing a file, function, or path β€” check it still exists
  2. Trust current state: If memory conflicts with current observation, trust what you see now
  3. Update or delete: When a memory is outdated, fix or remove it immediately
  4. Absolute dates: Convert relative dates ("yesterday", "last week") to absolute dates

Memory β†’ Knowledge Sublimation

Not all mature memories should decay. Some evolve into knowledge.

When to Sublimate

TriggerDetection SignalResult
Project completeAll tasks marked done, 3+ related project memoriesMerge into knowledge/project-postmortem.md
Project state trackingNew progress/blockers/resource needsUpdate knowledge/project-tracker.md directly (skip sublimation)
Feedback patterns3+ related feedback entries (e.g., all about reply style)Merge into knowledge/user-work-style-guide.md
User depthUser memory accumulates role, preferences, habits over timeExpand to knowledge/user-playbook.md
Periodic reviewDream detects high density of related memories in one categorySuggest: "Found 5 related feedback entries β†’ merge into knowledge?"

Session Lifecycle

Session Start

1. Sensory: Read current input
2. Short-term: Last 10 turns from context window
3. Working: Read memory/today.md + memory/yesterday.md
4. Long-term: Read MEMORY.md index

Note: Active Memory runs before the above (in before_prompt_build hook)

During Conversation

- New info β†’ write to working memory (today's daily log)
- Learned something worth remembering β†’ update MEMORY.md index + save classified file
- User preference β†’ update USER.md + memory/user/
- Task/priority change β†’ update todos.md
- Need to retrieve β†’ find in MEMORY.md index β†’ read classified file

Session End

- Summarize β†’ write to memory/today.md (working memory)
- Identify items for long-term β†’ update classified files
- Update MEMORY.md index
- Mark items for Dream review (decay candidates)

Workspace Structure

workspace/
β”œβ”€β”€ MEMORY.md              # long-term memory index (written by Dream Deep phase)
β”œβ”€β”€ USER.md                # user info
β”œβ”€β”€ SOUL.md                # AI identity
β”œβ”€β”€ todos.md               # β˜… Execution layer: today's tasks + long-term tracking (user-facing)
β”œβ”€β”€ HEARTBEAT.md           # daily reminders
β”œβ”€β”€ memory/
β”‚   β”œβ”€β”€ memory-types.md    # this file (or link to SKILL.md)
β”‚   β”œβ”€β”€ user/              # long-term user memories (written by agent)
β”‚   β”œβ”€β”€ feedback/          # long-term feedback (written by agent)
β”‚   β”œβ”€β”€ project/           # long-term project memories (written by agent, post-sublimate)
β”‚   β”œβ”€β”€ reference/         # long-term references (written by agent)
β”‚   β”œβ”€β”€ palace/            # Memory Palace views
β”‚   β”‚   β”œβ”€β”€ timeline.md
β”‚   β”‚   β”œβ”€β”€ projects.md
β”‚   β”‚   β”œβ”€β”€ technology.md
β”‚   β”‚   └── custom.md
β”‚   β”œβ”€β”€ dreaming/
β”‚   β”‚   └── verify/        # Verification reports (written by Refinement 13:00)
β”‚   β”œβ”€β”€ .dreams/           # Internal machine data (NOT human-readable)
β”‚   β”‚   β”œβ”€β”€ phase-signals.json    # Deep phase scoring signals
β”‚   β”‚   β”œβ”€β”€ events.jsonl          # memory_search event log
β”‚   β”‚   β”œβ”€β”€ session-ingestion.json # session-corpus metadata
β”‚   β”‚   └── short-term-recall.json # Active Memory recall index
β”‚   └── YYYY-MM-DD.md     # working memory (daily logs)
└── knowledge/             # β˜… Strategy layer (project blockers/progress/resources/suggestions)
    └── project-tracker.md # Project panorama, user-facing

Three-Layer Principle

  • todos.md = Execution layer: what to do today, tracking each node (user-maintained)
  • knowledge/ = Strategy layer: where projects are stuck, what resources needed, suggestions
  • memory/ = Classified memory layer: experience distillation, decision retrospectives, pattern discovery

Each layer has its own purpose, no duplication.


Example Interactions

User provides important info:

User: "I'm a data analyst, mostly working with Python" β†’ Working: log in today's daily log β†’ Long-term: save to memory/user/user-profile.md, update MEMORY.md index

User corrects you:

User: "Don't use Markdown tables, use lists" β†’ Working: log in today's daily log β†’ Long-term: save to memory/feedback/no-tables.md, update MEMORY.md index

Project decision:

Decision: approach A over B because lower cost β†’ Working: log decision context β†’ Long-term: save to memory/project/decision.md with reasoning

Looking up a past date:

User: "What did we do last Tuesday?" β†’ Active Memory auto-recalls β†’ read memory/YYYY-MM-DD.md for that date


OpenClaw Commands

# Check Active Memory status
openclaw plugins list | grep active-memory

# Check Dream status
openclaw dreaming status

# Toggle Dream on/off
openclaw dreaming on
openclaw dreaming off

# Manually trigger Dream Consolidation
openclaw memory dream

Changelog

VersionChanges
v4.13Dual-layer structure established (2026-04-18): Added three-layer principle (todos execution + knowledge strategy + memory classified); removed ongoing-projects.md, replaced with knowledge/project-tracker.md for strategic view; updated Workspace Structure and Sublimation description
v4.12bSource-verified major correction (2026-04-17): Clarified three-mechanism division (Active Memory trigger/read-only, Dream Deep唯一写MEMORY.md, Refinement as user-defined cron); corrected Deep/Light/REM phase descriptions; removed non-existent file references; updated Active Memory source-level description
v4.12Dual-Layer Dream Verification: Official Dream (12:30) + Refined Verify (13:00) cross-checking. Verification reports in memory/dreaming/verify/. Hallucination and drift prevention.
v4.11Full integration with OpenClaw 4.11 ecosystem, Active Memory + Memory Palace + Dream Consolidation
v3.2Memory sublimation system, 5-phase consolidation
v2.2Memory-Knowledge layering + Atkinson-Shiffrin integration
v1.0Initial release β€” Atkinson-Shiffrin three-stage model

Version: v4.13 | Updated: 2026-04-18 | Three layers: todos execution + knowledge strategy + memory classified

Comments

Loading comments...