📊 Module Progress
Complete objectives and quizzes to unlock your badge!
0/9 Tasks Completed
🎯 Learning Objectives
Differentiate short-term and long-term memory — Context window vs persistent files.
Know where memory is stored — MEMORY.md, daily logs, USER.md, TOOLS.md.
Write to memory — Automatic logging and manual "Remember this" commands.
Use memory safely — Privacy, security, and review best practices.
📖 Theory: Two Types of Memory
🧠 How OpenClaw Remembers
OpenClaw has two memory systems that work together: short-term (within a session) and long-term (across sessions).
📱 Short-Term Memory
- What: Current conversation context
- Duration: Until session ends or context window fills
- Limit: Context window size (e.g., 262,144 tokens)
- Use: Remembers what you said 5 minutes ago
💾 Long-Term Memory
- What: Persistent files stored on disk
- Duration: Forever, until you delete/edit them
- Files: MEMORY.md, memory/YYYY-MM-DD.md, USER.md, TOOLS.md
- Use: Remembers your favorite color, hometown, long-term goals
📁 Memory File Structure
OpenClaw stores memory in markdown files within your workspace. Here's the hierarchy:
workspace/
├── MEMORY.md ← Curated long-term facts (manually updated)
├── USER.md ← Info about you (user profile)
├── TOOLS.md ← Notes on tools, APIs, preferences
└── memory/ ← Daily logs (auto-generated)
├── 2026-04-23.md
├── 2026-04-24.md
└── ...
🔄 How Memory Works: During vs Between Sessions
During a session:
1. You chat with JiXe
2. JiXe "remembers" via context window (last N tokens/characters)
3. When context window fills up, older messages get compressed/summarized
Between sessions:
1. Session ends (you close chat or idle timeout)
2. JiXe writes important things to
3. Next session starts fresh but can READ old memories
4. Key facts get promoted to
Reading memories: JiXe automatically reads relevant memory files when you ask "What did we discuss yesterday?"
Writing to memory:
- Automatic: JiXe logs daily activities
- Manual: You say "Remember, my favorite color is blue" → JiXe writes to memory files
1. You chat with JiXe
2. JiXe "remembers" via context window (last N tokens/characters)
3. When context window fills up, older messages get compressed/summarized
Between sessions:
1. Session ends (you close chat or idle timeout)
2. JiXe writes important things to
memory/YYYY-MM-DD.md (daily log)3. Next session starts fresh but can READ old memories
4. Key facts get promoted to
MEMORY.md (curated, long-term)Reading memories: JiXe automatically reads relevant memory files when you ask "What did we discuss yesterday?"
Writing to memory:
- Automatic: JiXe logs daily activities
- Manual: You say "Remember, my favorite color is blue" → JiXe writes to memory files
Best Practices for Memory Management
- Important facts → MEMORY.md: Manually add significant facts, decisions, preferences to the curated long-term memory.
- Daily logs → Automatic: Let JiXe log daily activities; review weekly to catch patterns.
- Sensitive info → Be careful: Memory files are stored locally on your machine; protect your computer's access.
- Review periodically: Every few weeks, review MEMORY.md — remove outdated info, promote important daily entries.
🧪 Hands-On: Memory Test (Simulated)
See Memory in Action (10 minutes)
Scenario: First Session
Scenario: Session Ends (Simulated)
*Session ends. JiXe writes to
Scenario: New Session Starts
Scenario: Promoting to Long-Term
Verification:
You: "Remember, I'm from Ipoh, Perak."JiXe: "Got it! Ipoh, Perak. I'll note that down." (writes to memory)You: "My favorite subject is Biology."JiXe: "Noted! Biology is your favorite. Interesting choice!" (writes to memory)Scenario: Session Ends (Simulated)
*Session ends. JiXe writes to
memory/2026-04-24.md:
- [15:30] User is from Ipoh, Perak
- [15:32] User's favorite subject: Biology
Scenario: New Session Starts
You: "Where am I from?"JiXe: (reads memory files) "You're from Ipoh, Perak, bro!"You: "What's my favorite subject?"JiXe: "Biology! You told me yesterday." (reads from memory)Scenario: Promoting to Long-Term
You: "Add to MEMORY.md: I'm from Ipoh and love Biology."JiXe: (edits MEMORY.md) "Done! Added to your long-term memory."Verification:
You: "Read my MEMORY.md."JiXe: (reads curated file) "Here's what I have: • You're from Ipoh, Perak • You love Biology • ..."
📝 Quiz: Memory System (5 Questions)
Q1: Short-term memory is:
A
Stored in files
B
The current conversation context
Q2: Long-term memory is stored in:
A
The AI's brain
B
Files like MEMORY.md and daily logs
Q3: Which file contains curated, important long-term memories?
A
memory/2026-04-24.md
B
MEMORY.md
Q4: Daily logs are stored in:
A
MEMORY.md
B
memory/YYYY-MM-DD.md
C
The chat window
D
A notebook
Q5: Who can read your memory files?
A
Everyone on the internet
B
Anyone with access to your computer