Skip to content

keylimesoda/narrative-memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Narrative Memory

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

What's Included

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

Quick Start

  1. Install via ClawHub: clawhub install narrative-memory
  2. Copy templates to your workspace (see SKILL.md)
  3. Add fragments to your heartbeat, AGENTS.md, and SOUL.md
  4. Optionally set up rotation crons for automated consolidation

Architecture

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.

Why This Approach

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.

Origin

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?

License

MIT

About

Psychologically-grounded memory architecture for stateless AI agents. Conway/Damasio/Rathbone/Bruner frameworks for durable, identity-coherent long-term memory.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors