โ† All docs

๐Ÿง  Elite Longterm Memory

The ultimate memory system for AI agents. Combines 5 proven approaches into one bulletproof architecture.

flowchart TB
  subgraph ELITE["๐Ÿง  Elite Longterm Memory"]
    direction LR
    HOT["๐Ÿ”ฅ Hot RAM
SESSION-STATE.md
survives compaction"] WARM["๐ŸŒก๏ธ Warm Store
LanceDB vectors
semantic search"] COLD["๐ŸงŠ Cold Store
Git-notes graph
permanent decisions"] end MEM["๐Ÿ“– MEMORY.md + daily/
curated ยท human-readable"] HOT --> MEM WARM --> MEM COLD --> MEM

The 5 Memory Layers

Layer 1: Hot RAM (SESSION-STATE.md)

Active working memory that survives compaction. Uses Write-Ahead Log protocol.

# SESSION-STATE.md โ€” Active Working Memory

## Current Task
[What we're working on RIGHT NOW]

## Key Context
- User preference: ...
- Decision made: ...
- Blocker: ...

## Pending Actions
- [ ] ...

Rule: Write BEFORE responding. If you respond first and crash, context is lost.

Layer 2: Warm Store (LanceDB Vectors)

Semantic search across all memories. Auto-recall injects relevant context.

# Auto-recall (happens automatically)
memory_recall query="project status" limit=5

# Manual store
memory_store text="User prefers dark mode" category="preference" importance=0.9

Layer 3: Cold Store (Git-Notes Knowledge Graph)

Structured decisions, learnings, and context. Branch-aware and tamper-evident.

# Store a decision (SILENT - never announce)
python3 memory.py -p $DIR remember '{"type":"decision","content":"Use React"}' -t tech -i h

# Retrieve context
python3 memory.py -p $DIR get "frontend"

Layer 4: Curated Archive (MEMORY.md + daily/)

Human-readable long-term memory. Daily logs plus distilled wisdom.

workspace/
โ”œโ”€โ”€ MEMORY.md              # Curated long-term (the good stuff)
โ””โ”€โ”€ memory/
    โ”œโ”€โ”€ 2026-07-04.md      # Daily log
    โ”œโ”€โ”€ 2026-07-03.md
    โ””โ”€โ”€ topics/            # Topic-specific files

Layer 5: Cloud Backup (Optional)

Cross-device sync via SuperMemory API. Chat with your knowledge base from anywhere.

The WAL Protocol

Write-Ahead Log: Write state BEFORE responding, not after.

Trigger Action
User states preferenceWrite to SESSION-STATE.md โ†’ then respond
User makes decisionWrite to SESSION-STATE.md โ†’ then respond
User gives deadlineWrite to SESSION-STATE.md โ†’ then respond
User corrects youWrite to SESSION-STATE.md โ†’ then respond

Why? If you respond first and crash/compact before saving, context is lost. WAL ensures durability.

โ† Back to Neo