Memory System
Memory System
Section titled “Memory System”Principle: Disk is Source of Truth
Section titled “Principle: Disk is Source of Truth”All agent knowledge lives on disk. Write outcomes to files immediately. Memory in context is ephemeral — disk is canonical.
Directory Structure
Section titled “Directory Structure”/home/winnie/.openclaw/workspace/├── MEMORY.md # Long-term curated essentials (agent reads on startup)├── HANDOVER.md # Machine-readable session handover (overwritten each session)├── HEARTBEAT.md # Current Now/Next/Blockers (updated each heartbeat)├── AGENTS.md # Delegation + spawning rules├── IDENTITY.md # Winnie's identity and role├── SOUL.md # Core operating principles + checkpoint protocol├── memory/│ ├── daily/ # Append-only session logs (YYYY-MM-DD.md)│ ├── decisions/ # CEO/Winnie decisions by month (YYYY-MM.md)│ ├── projects/ # Per-project status files│ ├── ops/ # Operational reference docs│ ├── research/ # Research outputs by topic│ └── checkpoints/ # Sub-agent result files (subagent-<label>.md)File Types
Section titled “File Types”Ephemeral (session-scoped)
Section titled “Ephemeral (session-scoped)”- HANDOVER.md — Overwritten on every checkpoint. Contains: Last Action, System State, Scope Rules, Dev Model, Next Actions.
- HEARTBEAT.md — Updated every 30 minutes. Contains: Now, Next, Blockers.
Append-Only
Section titled “Append-Only”memory/daily/YYYY-MM-DD.md— Session summaries. Never modify past entries.
Canonical Reference
Section titled “Canonical Reference”- MEMORY.md — Curated essentials. Updated when stable patterns are confirmed.
- AGENTS.md — Delegation rules, routing, agent fleet table.
memory/ops/*.md— Operational procedures, model catalog, corrections log.memory/projects/*.md— Per-project status.memory/decisions/YYYY-MM.md— Decision log by month.
Memory Protocol
Section titled “Memory Protocol”On session startup, agents read:
- HANDOVER.md (last session state)
- MEMORY.md (curated long-term memory)
- HEARTBEAT.md (current status)
- Project-specific files (FRANKEL.md, etc.)
On session end (checkpoint), agents write:
- HANDOVER.md (current state)
memory/daily/YYYY-MM-DD.md(append session summary)- HEARTBEAT.md (update Now/Next/Blockers)
- Any project or ops updates
After Every Outcome
Section titled “After Every Outcome”- Summary →
memory/projects/<PROJECT>.md - Append →
memory/daily/YYYY-MM-DD.md - Config/routing changed →
memory/ops/CHANGELOG.md - CEO decision →
memory/decisions/YYYY-MM.md
QMD Vector Backend
Section titled “QMD Vector Backend”- Engine: QMD 1.0.7 (Bun 1.3.9)
- Purpose: Session transcript indexing for semantic search via
memory_search - Retention: 30 days
- Indexing: 29 files, 112 vectors at setup
- CPU-only: Models ~2GB, unloaded after idle
- Use
memory_searchfor deep lookups across transcript history
Key Files Reference
Section titled “Key Files Reference”| File | When to Read | When to Write |
|---|---|---|
MEMORY.md | Cold start, session reset | When stable patterns confirmed |
HANDOVER.md | Session start | Every checkpoint |
HEARTBEAT.md | Heartbeat run | Every heartbeat |
AGENTS.md | When routing/spawning | After routing changes |
memory/ops/corrections.md | Before starting work | When new mistake logged |
memory/ops/CHANGELOG.md | When checking config history | After config changes |
memory/decisions/YYYY-MM.md | When need decision context | After CEO decisions |
Search Strategy
Section titled “Search Strategy”- MEMORY.md — Start here. Curated one-liners with pointers.
- Topic files (
memory/ops/*.md,memory/projects/*.md) — Detail reference. memory_search— Semantic search across transcript history (last resort — slow).memory/daily/YYYY-MM-DD.md— Chronological session logs (last resort — large files).
See Also
Section titled “See Also”- Infrastructure — Server and backup details
- Decision Log — How decisions are recorded
- Checkpoint Protocol — Mandatory write procedures