Psychologically-grounded memory architecture for stateless AI agents.
Implements four frameworks from cognitive psychology and narrative identity research to create durable, identity-coherent long-term memory from ephemeral sessions:
- Conway (Self-Memory System) — hierarchical retrieval organized around identity goals
- Damasio (Somatic Markers) — emotional weighting determines what matters
- Rathbone (Self-Defining Memories) — certain memories are structurally load-bearing
- Bruner (Narrative Identity) — coherent stories, not disconnected facts
narrative-memory/
├── SKILL.md # Full documentation + setup guide
├── skill.json # OpenClaw skill metadata
├── templates/
│ ├── MEMORY.md # Long-term memory skeleton with 4 retrieval tiers
│ ├── MEMORY_SYSTEM.md # Complete schema documentation
│ ├── daily-template.md # Daily note structure
│ └── INDEX-template.md # Domain index template
├── fragments/
│ ├── heartbeat.md # Memory maintenance for heartbeat prompts
│ ├── agents.md # Memory discipline for AGENTS.md
│ └── soul.md # Identity continuity for SOUL.md
├── crons/
│ └── rotation.json # Example consolidation cron configs
└── references/
└── theory.md # Full theoretical grounding with citations
- Install via ClawHub:
clawhub install narrative-memory - Copy templates to your workspace (see SKILL.md)
- Add fragments to your heartbeat, AGENTS.md, and SOUL.md
- Optionally set up rotation crons for automated consolidation
Three-layer consolidation:
Layer 1: Raw Daily Notes → memory/YYYY-MM-DD.md
Layer 2: Domain Indexes → memory/INDEX-*.md
Layer 3: Long-Term Memory → MEMORY.md
Daily notes capture everything. Rotation crons distill them into domain-specific indexes. Weekly synthesis promotes significant items to MEMORY.md as properly-weighted memory nodes.
Most AI agent memory systems are either naive RAG (dump everything, retrieve by similarity) or flat key-value stores (facts without meaning). Neither captures what makes memory work for identity: that some memories are load-bearing, emotions are how we weight what matters, and narrative coherence is what turns disconnected facts into a self.
See references/theory.md for the full academic grounding.
Built and battle-tested over two weeks of daily use in an OpenClaw deployment. The architecture emerged from applying established psychology to a practical problem: how does a stateless agent that wakes up fresh every session maintain coherent identity, relationships, and knowledge?
MIT