← Back to Learning Path
🧠

Step 6 of 9

Upgrade Your Memory

Best practice today is hybrid memory: Mem0 for long-term semantic recall + compact folders for clean startup context.

🎥 Memory walkthrough video: https://www.youtube.com/watch?v=Nt03hgxv5TE

Why this approach works

Without structure

  • One huge memory file
  • Token-heavy startup reads
  • Duplicate/stale notes accumulate
  • Hard to know what is current

Mem0 + folders

  • Mem0 stores durable facts/preferences
  • Context files stay short and intentional
  • Compaction-safe workflow
  • Lower token usage, better recall quality

Step 1: Install and configure Mem0

openclaw plugins install @mem0/openclaw-mem0
openclaw config set plugins.slots.memory openclaw-mem0
openclaw config set plugins.entries.openclaw-mem0.enabled true
openclaw config set plugins.entries.openclaw-mem0.config.mode 'platform'
openclaw config set plugins.entries.openclaw-mem0.config.apiKey 'YOUR_MEM0_API_KEY'
openclaw config set plugins.entries.openclaw-mem0.config.userId 'default'
openclaw config set plugins.entries.openclaw-mem0.config.autoRecall true
openclaw config set plugins.entries.openclaw-mem0.config.autoCapture true
openclaw gateway restart

Step 2: Create structured memory folders

mkdir -p ~/.openclaw/workspace/memory
mkdir -p ~/.openclaw/workspace/context/{projects,preferences,knowledge-base}
mkdir -p ~/.openclaw/workspace/projects

Recommended files:

Step 3: Prompt you can paste into OpenClaw

Create/update my OpenClaw memory architecture to be compaction-safe:
- Keep MEMORY.md as a short index only
- Keep memory/memory.md concise
- Use context/projects/{goals,decisions,current-status}.md
- Use context/preferences/{coding-style,communication}.md
- Use context/knowledge-base/{research-notes,reference-data}.md
- Keep project-specific docs in projects/*
- Add a compaction-safe checklist in AGENTS.md
- Verify Mem0 is active and test with: openclaw mem0 stats + openclaw mem0 search

Step 4: Verify memory is working

openclaw mem0 stats
openclaw mem0 search "what do you know about my projects" --scope long-term