Memory System
The memory system provides persistence across sessions, enabling continuity in conversations and long-term knowledge retention.
What It Is
Without memory, each session starts fresh. The memory system solves this by:
- Storing conversation context
- Recording decisions and events
- Building long-term knowledge
- Enabling recall of prior work
Types of Memory
Daily Notes
Location: memory/YYYY-MM-DD.md
Raw logs of what happened each day:
- Conversation summaries
- Decisions made
- Tasks completed
- Infrastructure changes
- Errors and lessons learned
Created automatically or manually. Formatted as running logs.
Long-Term Memory
Location: MEMORY.md
Curated, distilled knowledge:
- User preferences and profile
- Infrastructure details
- Important decisions
- Lessons learned (condensed from daily notes)
- Contact information
- Project context
Security note: Only loaded in 1:1 private sessions (WhatsApp, DMs), not in group chats.
Session Transcripts
Optional history of past conversations. Used for:
- Context recall
- Continuing interrupted tasks
- Audit trails
How It Works
Session Startup
Before responding, the agent:
- Reads
SOUL.md— agent identity - Reads
USER.md— user profile - Reads
memory/YYYY-MM-DD.md— today and yesterday - Reads
MEMORY.md— if private session
Memory Search
When asked about prior work:
- Semantic search across memory files
- Return top relevant snippets with citations
- Pull full context only when needed
Writing Memory
Significant events should be recorded:
- Decisions and their rationale
- Infrastructure changes
- Errors and fixes
- New preferences learned
- Project milestones
Your Setup
| Component | Location |
|---|---|
| Active workspace | /home/openclaw/.openclaw/workspace on k3s-master |
| Daily notes | memory/YYYY-MM-DD.md |
| Long-term memory | MEMORY.md |
| Backup | Synced to onthecouch/REDACTED-workspace repo |
Best Practices
For Daily Notes
- Log key events as they happen
- Include context (what, why, outcome)
- Skip routine chatter
- Timestamp important entries
For Long-Term Memory
- Review daily notes periodically (weekly)
- Distill into MEMORY.md
- Remove outdated information
- Structure with clear headings
- Never include secrets — Use
TOOLS.mdfor sensitive details
For Users
- Tell the agent "remember this" to save important context
- Reference prior work by date or topic
- Correct mistakes in memory when spotted
Maintenance
Weekly Review (Heartbeat Task)
- Read recent daily notes
- Identify significant learnings
- Update MEMORY.md
- Remove obsolete entries
- Commit and push
Monthly Cleanup
- Archive old daily notes (>30 days)
- Verify MEMORY.md accuracy
- Update infrastructure docs if changed
Security
- Private data stays in private contexts
- Secrets go in
TOOLS.md(not committed) or Sealed Secrets - Memory is searchable — Don't write what you wouldn't want found
- Group chat safe — MEMORY.md not loaded in shared channels
Related
- Personas — Agent behavior configuration
- Architecture — Session and context flow