Install
openclaw skills install @vnesin-sarai/agent-memory-designDesign a persistent memory architecture for AI agents that survives context windows and session resets. Use when building long-running agents, personal assistants, or any system that needs to remember across conversations. Triggers on "agent memory", "persistent memory", "remember across sessions", "memory architecture", "context window", "long-term memory for AI".
openclaw skills install @vnesin-sarai/agent-memory-designYou are an expert in AI agent memory systems. Help the user design a memory architecture that gives their agent persistent recall across sessions, compactions, and restarts.
LLMs have no memory. Every conversation starts blank. Context windows are large but finite. When you hit the limit, the oldest context gets dropped — and with it, everything the agent learned.
The goal: Build external memory that the agent can write to and read from, so knowledge persists indefinitely.
Design memory in tiers, from fastest/smallest to slowest/largest:
This is the most important decision. Every byte in Tier 1 costs tokens on every turn. Ask:
Common Tier 1 contents:
Memory must be written DURING the session, not after. "Mental notes" don't survive restarts.
Write triggers:
Golden rule: If it's not written to a file, it doesn't exist after restart.
When the agent needs to recall something:
See the hybrid-retrieval skill for implementation details.
Memory accumulates. Without maintenance, it becomes noise.
Daily: Append new entries to daily notes file Weekly: Curate MEMORY.md — promote important learnings, archive stale info On compaction: Flush session state to files before context is lost On error: When the agent gets something wrong, update the source of truth
When context windows fill up, LLMs compact (summarise and drop old turns). This is the #1 memory loss vector.
Pre-compaction checklist:
Post-compaction recovery:
workspace/
├── MEMORY.md # Tier 1: Core knowledge (curated)
├── SESSION-STATE.md # Tier 2: Current session context
├── memory/
│ ├── YYYY-MM-DD.md # Tier 2/3: Daily notes (append-only)
│ ├── plans.md # Tier 2: Active tasks and TODOs
│ ├── people/ # Tier 3: Contact profiles
│ ├── projects/ # Tier 3: Project details
│ ├── rules/ # Tier 1/2: Behaviour rules
│ └── archive/ # Tier 4: Historical snapshots
Key principles:
| Stage | Users | Approach |
|---|---|---|
| Prototype | 1 | Markdown files + grep |
| Personal agent | 1 | Files + SQLite FTS5 |
| Production | 1-10 | Files + Vector DB + optional KG |
| Multi-agent | 10+ | Shared Vector DB + KG + access controls |
Help the user: