OpenClaw Three-Tier Memory System: Keep Cross-Session Context Without Token Bloat
A structured three-layer memory pattern for OpenClaw that separates long-term memory, daily logs, and project tracking so agents keep context across sessions with lower retrieval noise.
Tags
Target users
What it does
- Splits memory into three layers:
MEMORY.md(long-term),memory/YYYY-MM-DD.md(daily), andPROJECTS.md(project state). - Defines migration rules so temporary notes can be promoted into durable memory.
- Uses semantic retrieval (
memory_search+memory_get) to find past decisions faster.
Skills You Need
Pain Point
A single large memory file becomes noisy fast: useful facts and temporary notes mix together, retrieval quality drops, and agents lose continuity between sessions.
Core value of this case
This pattern keeps memory durable but lightweight. Teams can preserve long-term preferences, keep daily execution logs separate, and maintain project-level next actions without inflating every session context.
Typical scenarios
- Maintaining personal AI assistants that run continuously over days or weeks.
- Recovering project context after model restarts or session compaction.
- Reducing repeated “what did we decide last time?” questions in agent workflows.
How to setup
- Create the memory structure in workspace root:
MEMORY.mdPROJECTS.mdmemory/YYYY-MM-DD.md
- Keep layers scoped:
- Durable principles/preferences →
MEMORY.md - Daily events/decisions →
memory/YYYY-MM-DD.md - Goal, blocker, next step →
PROJECTS.md
- Durable principles/preferences →
- Add a session routine:
- Session start: read long-term + today/yesterday daily logs + project state.
- Session end: migrate durable insights from daily logs to
MEMORY.md.
- Enable retrieval by using semantic memory tools (
memory_searchthenmemory_get) for targeted recall.
Archived Materials
A representative three-layer file layout from the source:
Related Links
FAQ
Is this a replacement for vector memory search?
No. The three-tier structure organizes what gets written; vector search improves how those files are retrieved.
Do I need all three files from day one?
No, but using all three layers helps avoid mixing long-term preferences with short-lived execution logs.
When should notes move from daily logs to long-term memory?
When a fact is likely to matter across multiple days (for example stable user preferences or confirmed operating rules).
