Skip to content

Latest commit

 

History

History
80 lines (68 loc) · 3.25 KB

File metadata and controls

80 lines (68 loc) · 3.25 KB
title OpenClaw Three-Tier Memory System: Keep Cross-Session Context Without Token Bloat
slug openclaw-three-tier-memory-system
summary 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.
whatItDoes Organizes agent memory into long-term, daily, and project layers, then uses semantic recall to retrieve the right context quickly.
category automation-integration
difficulty intermediate
tags
memory-management
session-continuity
semantic-retrieval
agent-workflow
targetUser
AI agent builders
OpenClaw operators
Automation engineers
skillsUsed
name href
memory_search
updatedAt 2026-03-12
published true

What it does

  • Splits memory into three layers: MEMORY.md (long-term), memory/YYYY-MM-DD.md (daily), and PROJECTS.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

  1. Create the memory structure in workspace root:
    • MEMORY.md
    • PROJECTS.md
    • memory/YYYY-MM-DD.md
  2. Keep layers scoped:
    • Durable principles/preferences → MEMORY.md
    • Daily events/decisions → memory/YYYY-MM-DD.md
    • Goal, blocker, next step → PROJECTS.md
  3. 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.
  4. Enable retrieval by using semantic memory tools (memory_search then memory_get) for targeted recall.

Archived Materials

A representative three-layer file layout from the source:

workspace/
├── MEMORY.md
├── PROJECTS.md
└── memory/
    ├── 2026-02-19.md
    └── heartbeat-state.json

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).