#7894: Memory improvements: Give OpenClaw better memory + REM sleep
docs
scripts
agents
stale
Cluster:
Memory Management Enhancements
## Summary / user impact
This change makes OpenClaw’s memory feel “sticky” across sessions without extra configuration by standardizing on a WM/STM-friendly workspace layout while keeping LTM explicit and opt-in.
After this PR, OpenClaw will automatically create `STM.md` and `WORKING.md` in the agent workspace (when missing) and keep them updated via the existing pre-compaction memory flush. LTM stays opt-in (via `ltm/index.md` or `ltm/nodes/`). This means preferences, decisions, and other personalization signals can reliably land in durable memory that `memory_search` can retrieve later, improving continuity and “it remembers how I like things” behavior over time without unexpectedly expanding the indexed surface.
## What users get (before → after)
- **Before**: memory was effectively limited to `MEMORY.md`/`memory.md` + `memory/**`. Users who already kept structured memory (STM + LTM) had to manually wire `extraPaths` or accept that the memory tools wouldn’t reliably see that content.
- **After**: OpenClaw creates and maintains `STM.md` automatically and the memory tools can search/read STM (and LTM if you already opted in) out of the box, so structured personalization works immediately without extra config.
## Key behaviors / guardrails
- `WORKING.md` is readable via `memory_get` but intentionally **not indexed** by default (keeps search results high-signal).
- `ltm/` is only indexed when explicitly opted in by structure (`ltm/index.md` or `ltm/nodes/`), and OpenClaw does not auto-create that opt-in.
- Existing workspaces that already have memory files keep working; legacy `MEMORY.md` + `memory/` remains supported.
## Implementation notes
- Memory file detection includes `STM.md` and (when opted in) `ltm/`.
- `memory_get` allowlist expands to include `STM.md`, `WORKING.md`, and `ltm/**` (opt-in only) while preserving existing `"path required"` rejection semantics for disallowed paths.
- Docs and tool descriptions are updated to describe the expanded memory surface and the default retrieval strategy.
## Verification
- Unit tests: cover STM inclusion, LTM opt-in behavior, and `ltm/` read gating.
- Manual repro: `scripts/repro/memory-wm-stm-ltm-smoke.ts` exercises the WM/STM/LTM flow with a live model.
Most Similar PRs
#6060: feat(onboarding): add Memory Optimization step to onboarding wizard
by GodsBoy · 2026-02-01
73.0%
#7480: feat: Add CoreMemories hierarchical memory system
by Itslouisbaby · 2026-02-02
70.3%
#2884: fix: Create memory directory and symlink identity files during work...
by webdevtodayjason · 2026-01-27
70.0%
#21217: fix: memory prune command to prevent unbounded MEMORY.md growth
by theognis1002 · 2026-02-19
69.1%
#20791: Feature/aeon memory plugin
by mustafarslan · 2026-02-19
68.4%
#11179: fix(memory): replace confusing "No API key" errors in memory tools ...
by liuxiaopai-ai · 2026-02-07
67.4%
#21855: feat: add memory-bank skill — persistent file-based context
by winstonkoh87 · 2026-02-20
66.7%
#16669: feat(memory-lancedb): add memory_search/memory_get compatibility re...
by ciberponk · 2026-02-15
65.9%
#22269: feat(memory): add remote memory backend via OpenAI-compatible Vecto...
by yossiovadia · 2026-02-20
65.9%
#21003: feat(memory): add durable memory_write + memory_upsert tools
by SmithLabsLLC · 2026-02-19
65.8%