Ultimate AI agent memory system. Combines bulletproof WAL protocol, vector search, git-based knowledge graphs, cloud backup, and maintenance hygiene. Never lose context again.
npm install elite-longterm-memoryThe ultimate memory system for AI agents. Never lose context again.



---
Built for: Clawdbot ⢠Moltbot ⢠Claude Code ⢠Any AI Agent
---
Combines 7 proven memory approaches into one bulletproof architecture:
- ā
Bulletproof WAL Protocol ā Write-ahead logging survives compaction
- ā
LanceDB Vector Search ā Semantic recall of relevant memories
- ā
Git-Notes Knowledge Graph ā Structured decisions, branch-aware
- ā
File-Based Archives ā Human-readable MEMORY.md + daily logs
- ā
Cloud Backup ā Optional SuperMemory sync
- ā
Memory Hygiene ā Keep vectors lean, prevent token waste
- ā
Mem0 Auto-Extraction ā Automatic fact extraction, 80% token reduction
``bashInitialize in your workspace
npx elite-longterm-memory init
Architecture
`
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ELITE LONGTERM MEMORY ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā¤
ā HOT RAM WARM STORE COLD STORE ā
ā SESSION-STATE.md ā LanceDB ā Git-Notes ā
ā (survives (semantic (permanent ā
ā compaction) search) decisions) ā
ā ā ā ā ā
ā āāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāā ā
ā ā¼ ā
ā MEMORY.md ā
ā (curated archive) ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
`The 5 Memory Layers
| Layer | File/System | Purpose | Persistence |
|-------|-------------|---------|-------------|
| 1. Hot RAM | SESSION-STATE.md | Active task context | Survives compaction |
| 2. Warm Store | LanceDB | Semantic search | Auto-recall |
| 3. Cold Store | Git-Notes | Structured decisions | Permanent |
| 4. Archive | MEMORY.md + daily/ | Human-readable | Curated |
| 5. Cloud | SuperMemory | Cross-device sync | Optional |
The WAL Protocol
Critical insight: Write state BEFORE responding, not after.
`
User: "Let's use Tailwind for this project"Agent (internal):
1. Write to SESSION-STATE.md ā "Decision: Use Tailwind"
2. THEN respond ā "Got it ā Tailwind it is..."
`If you respond first and crash before saving, context is lost. WAL ensures durability.
Why Memory Fails (And How to Fix It)
| Problem | Cause | Fix |
|---------|-------|-----|
| Forgets everything | memory_search disabled | Enable + add OpenAI key |
| Repeats mistakes | Lessons not logged | Write to memory/lessons.md |
| Sub-agents isolated | No context inheritance | Pass context in task prompt |
| Facts not captured | No auto-extraction | Use Mem0 (see below) |
Mem0 Integration (Recommended)
Auto-extract facts from conversations. 80% token reduction.
`bash
npm install mem0ai
export MEM0_API_KEY="your-key"
``javascript
const { MemoryClient } = require('mem0ai');
const client = new MemoryClient({ apiKey: process.env.MEM0_API_KEY });// Auto-extracts facts from messages
await client.add(messages, { user_id: "user123" });
// Retrieve relevant memories
const memories = await client.search(query, { user_id: "user123" });
`For Clawdbot/Moltbot Users
Add to
~/.clawdbot/clawdbot.json:`json
{
"memorySearch": {
"enabled": true,
"provider": "openai",
"sources": ["memory"]
}
}
`Files Created
`
workspace/
āāā SESSION-STATE.md # Hot RAM (active context)
āāā MEMORY.md # Curated long-term memory
āāā memory/
āāā 2026-01-30.md # Daily logs
āāā ...
`Commands
`bash
elite-memory init # Initialize memory system
elite-memory status # Check health
elite-memory today # Create today's log
elite-memory help # Show help
``- Full Documentation (SKILL.md)
- ClawdHub
- GitHub
---
Built by @NextXFrontier