AI agents forget between sessions. This repo gives them durable, file-based memory without databases, embeddings, or vector search by default.
It has evolved beyond a simple MEMORY.md note. The current model is MEMOS v3: Relevance Selection + Hot/Cold loading + TTL archiving.
- reads a small, structured memory surface at session start
- loads deeper context only when relevant
- keeps current state and historical record separate
- distills noisy session output into durable memory
- archives aging Topic docs before the vault sprawls
workspace/
βββ SOUL.md
βββ USER.md
βββ AGENTS.md
βββ BOOTSTRAP.md
βββ IDENTITY.md
βββ HEARTBEAT.md
βββ TOOLS.md
βββ System/
β βββ memory-rules.md
β βββ channel-archiving-rules.md
β βββ infrastructure.md
β βββ notion-ids.md
β βββ MISSION.md
βββ skills/
βββ scripts/
βββ docs/
vault/
βββ Archive/
βββ Channels/
βββ Daily/
βββ Memory/
β βββ MEMORY.md
β βββ MEMORY_INBOX.md
β βββ State/
β βββ Log/
β βββ Patterns/
βββ Sessions/
βββ System/
βββ Tickets/
βββ Topics/
Instead of one growing memory file, memory is split by role:
Memory/MEMORY.mdfor the pointer-first master overviewMemory/State/*.mdfor current domain stateMemory/Log/YYYY-MM.mdfor append-only milestonesMemory/Patterns/for reusable learned patterns and casesMemory/MEMORY_INBOX.mdfor pre-distillation intake
The agent should not load everything every session.
Typical startup flow:
- scan Channel abstracts
- read the current channel
- read
Tickets/INDEX.md - read
Memory/MEMORY.md - load only relevant
Memory/State/{domain}.md - keep
Topics/and mostSystem/docs cold unless explicitly needed
This reduces context waste and keeps session start lean.
Hot: identity, user, channel scan, current channel, ticket index, master memory, relevant state files.
Cold: Topics, detailed System docs, monthly logs, pattern libraries, individual ticket files.
Topics should load only when:
- the user directly mentions the topic
- the active ticket explicitly links it
- the agent decides it is necessary and states why
Some Topic docs are temporary by nature. Add:
archive_after: YYYY-MM-DDThen a periodic cleanup can move expired Topics into Archive/deprecated-topics/.
This keeps design residue from silently bloating active memory.
- Files over databases
- Single source of truth
- Current state vs historical record separation
- Distillation over accumulation
- Bounded growth
- Canonical-first references
git clone https://github.com/ReS0421/claw-memory-os.git ~/.openclaw/workspacecp -r vault-template/ ~/vaults/my-workspace/
cd ~/vaults/my-workspace
git init
git add -A
git commit -m "init: memory vault"Your vault repo should be private. It contains real memory data.
Customize:
SOUL.mdUSER.mdAGENTS.mdSystem/MISSION.md
Recommended recurring jobs:
- daily-log
- memory-distill
- vault-backup
- archive-cleanup
If you open vault-template/ for the first time, start here:
Memory/MEMORY.mdβ the lightweight master entry pointMemory/State/β current truth by domainMemory/Log/β append-only monthly milestonesMemory/Patterns/β reusable patterns and problemβsolution casesMemory/MEMORY_INBOX.mdβ pre-distillation queueChannels/β current conversation stateTickets/β active execution stateTopics/β durable design and knowledge docs
A simple rule of thumb:
- current truth β
State/ - historical milestones β
Log/ - reusable lessons β
Patterns/ - uncertain intake β
MEMORY_INBOX.md
That split is the heart of MEMOS v3.
| Memory size | Suggested behavior |
|---|---|
| under 1k lines | read almost everything |
| 1k to 5k | rely on channel abstracts and selective state loading |
| 5k+ | tighten archive rules, consolidate Topics, consider semantic retrieval |
This repository is the public template / operating model.
Your real vault is separate, private, and should contain your actual:
- Channels
- Tickets
- Topics
- Logs
- durable memory
MIT
Built with OpenClaw πΎ