3-Tier Memory System Spec
The exact memory architecture I run in production. Hand this spec to your OpenClaw agent and let it build the system for you.
Note: How to Use This
This isn't a guide. It's a spec. Copy the full system description below and hand it to your CEO agent (or whichever agent you want to run this architecture). Tell it: “Implement this memory system. Create the vault structure, update your MEMORY.md, and follow the checkpoint and retrieval rules going forward.”
The spec is written so an agent can parse and implement it without further explanation. Every rule, every trigger, every directory is defined.
Core Model
The system uses a 3-layer memory architecture:
| Layer | What It Holds | Canonical Surface |
|---|---|---|
| Layer 1 — Session memory | Governance files and MEMORY.md | MEMORY.md |
| Layer 2 — Knowledge graph | Structured notes in the numbered memory/ vault | memory/00-home through memory/99-archive |
| Layer 3 — Ingestion pipeline | Research, transcripts, articles, and operating inputs promoted into structured notes | Promoted into Layer 2 surfaces |
Numbered Vault Structure
The local memory uses an Obsidian-style numbered vault layout. Each directory has a specific purpose. Navigation starts at memory/00-home/index.md when orienting inside the graph.
memory/00-home/ — Navigation entrypoints
memory/10-maps/ — Maps of systems, domains, and note locations
memory/15-specs/ — Formal local specs
memory/20-domains/ — Stable domain truths
memory/30-decisions/ — Durable decisions and policies
memory/40-research/ — Canonical research takeaways
memory/50-operations/ — Operating procedures, scoreboards, and workflows
memory/60-daily/ — Chronological daily notes (YYYY-MM-DD.md)
memory/70-weekly/ — Weekly synthesis notes (YYYY-WW.md)
memory/99-archive/ — Compressed historical detailMemory Classes
Every piece of information falls into one of five classes. Each class has a canonical home. The agent should never store information outside its designated surface.
1. Durable Facts
Approved decisions, standing directives, stable ownership rules, approved process changes.
MEMORY.mdfor active operating truthmemory/20-domains/,memory/30-decisions/,memory/40-research/for longer-lived canonical notes
2. Operational State
Current blockers, active watch items, counters and scorecards, approval backlog.
- Canonical home:
MEMORY.md
3. Daily Log
Same-day execution trace, short-horizon observations, checkpoint residue not yet promoted, chronology for what changed today.
- Canonical home:
memory/60-daily/YYYY-MM-DD.md
4. Weekly Synthesis
Compression of the last 7 daily logs, recurring patterns from the week, durable promotions identified from daily notes, stale detail ready for archive.
- Canonical home:
memory/70-weekly/YYYY-WW.md
5. Archive
Stale detail removed from active files, historical rollups, old logs that no longer need to live in prompt-critical surfaces.
- Canonical home:
memory/99-archive/
Checkpoint Triggers
A memory checkpoint is required on each of these triggers. No exceptions.
- Task completion
- Model/tool/provider failure
- Escalation
- Compaction or
memoryFlush - Before
/new,/reset, or session end - Any fallback event or model-routing change that materially changes execution state
- Any directive from the owner that creates a new standing rule, policy, or decision
Checkpoint Write Order
On each required checkpoint, write in this exact order:
- Append short-horizon facts to
memory/60-daily/YYYY-MM-DD.md - Promote durable local operating truth to
MEMORY.md - Promote durable strategic/decision truth to
memory/30-decisions/ - If the item is canonical and cross-agent, also route it into
_shared/knowledge/
Critical: Order Matters
Daily note first, then MEMORY.md, then canonical graph notes, then shared knowledge. If the session ends mid-checkpoint, at least the daily note is saved.
Retrieval Order
When recalling context, read in this order:
MEMORY.md_shared/knowledge/when the topic may be canonical or cross-agentmemory/20-domains/,memory/30-decisions/,memory/40-research/memory/10-maps/andmemory/00-home/index.mdwhen navigation is neededmemory/60-daily/for chronology and unpromoted short-horizon factsmemory/70-weekly/for synthesis context- Recent session context only if the answer is still not found
Routing Policy
Every piece of information routes to one of three destinations based on its scope and durability.
Local Only
Use local memory (MEMORY.md + memory/) when the item is:
- Role-specific
- Interpretive or managerial
- Short-horizon
- A watch item, concern, or synthesis note
- Mainly useful to the orchestration role
Shared Only
Use _shared/knowledge/ when all of these are true:
- Relevant to multiple agents
- Durable for at least 1-2 weeks
- A fact, rule, definition, or approved decision
- Should remain consistent across the organization
Both
Use both local and shared only when the item is canonical company truth and the agent must actively enforce or monitor it.
Rules for Each Surface
MEMORY.md
- Holds durable facts and active operating state
- Should remain concise and prompt-useful
- Must not become a warehouse for all raw detail
- Prefer pointers and active implications when a better canonical note exists elsewhere in the graph
Daily Notes
- Append-only by date
- Used for chronology and same-day continuity
- Not the first home for durable truth
Weekly Notes
- Summarize the last 7 daily notes
- Promote durable items out of daily notes into canonical surfaces
- Capture patterns, not raw event streams
- Move stale or low-value detail toward archive
Archive
- Preserve historical detail without polluting active prompt surfaces
- Use for rollups and long-form history after promotion/compression
Anti-Duplication Rule
The same operational fact should have one canonical home. Never two.
STATUS.mdshould summarize canonical state, not become a second database- Daily notes should not duplicate full durable truth already captured elsewhere
MEMORY.mdshould not repeat everything that belongs in domain/decision/research notes
Startup Read Order
Before acting on any task, the agent should read these files in order:
- Governance files
MEMORY.mdmemory/00-home/index.md- Today's
memory/60-daily/YYYY-MM-DD.mdif present - Current
memory/70-weekly/YYYY-WW.mdif present
Recreation Checklist
To implement this system from scratch, complete every item:
- ✓Create the numbered
memory/vault with all 10 directories - ✓Define
MEMORY.mdas durable facts + operating state - ✓Define
memory/60-daily/as daily chronology - ✓Define
memory/70-weekly/as synthesis/compression - ✓Define
memory/99-archive/as historical spillover - ✓Enforce checkpoint triggers
- ✓Enforce checkpoint write order
- ✓Enforce retrieval order
- ✓Enforce anti-duplication discipline
- ✓Use
_shared/knowledge/only for canonical cross-agent truth
Compressed Version
If your agent needs a single-paragraph summary to internalize the system:
Note: Minimal Operating Summary
Use a 3-layer memory model. MEMORY.md holds durable facts and active operating state. memory/60-daily/YYYY-MM-DD.md holds same-day chronology. memory/70-weekly/YYYY-WW.md holds weekly synthesis. Use a numbered Obsidian-style vault with 00-home, 10-maps, 15-specs, 20-domains, 30-decisions, 40-research, 50-operations, 60-daily, 70-weekly, and 99-archive. On each checkpoint, write daily note first, then MEMORY.md, then strategic/canonical notes, then shared knowledge if cross-agent. Prefer canonical graph notes over dumping everything into MEMORY.md.
Go Deeper
Want hands-on help with this?
I'll walk you through exactly how I set this up and run it every day.