{
  "markdown": "# Elite Longterm Memory 🧠\n\n**The ultimate memory system for AI agents.** Never lose context again.\n\n[![npm version](https://img.shields.io/npm/v/elite-longterm-memory.svg?style=flat-square)](https://www.npmjs.com/package/elite-longterm-memory)\n[![npm downloads](https://img.shields.io/npm/dm/elite-longterm-memory.svg?style=flat-square)](https://www.npmjs.com/package/elite-longterm-memory)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)\n\n---\n\n## Works With\n\n<p align=\"center\">\n  <img src=\"https://img.shields.io/badge/Claude-AI-orange?style=for-the-badge&logo=anthropic\" alt=\"Claude AI\" />\n  <img src=\"https://img.shields.io/badge/GPT-OpenAI-412991?style=for-the-badge&logo=openai\" alt=\"GPT\" />\n  <img src=\"https://img.shields.io/badge/Cursor-IDE-000000?style=for-the-badge\" alt=\"Cursor\" />\n  <img src=\"https://img.shields.io/badge/LangChain-Framework-1C3C3C?style=for-the-badge\" alt=\"LangChain\" />\n</p>\n\n<p align=\"center\">\n  <strong>Built for:</strong> Clawdbot • Moltbot • Claude Code • Any AI Agent\n</p>\n\n---\n\nCombines 7 proven memory approaches into one bulletproof architecture:\n\n- ✅ **Bulletproof WAL Protocol** — Write-ahead logging survives compaction\n- ✅ **LanceDB Vector Search** — Semantic recall of relevant memories\n- ✅ **Git-Notes Knowledge Graph** — Structured decisions, branch-aware\n- ✅ **File-Based Archives** — Human-readable MEMORY.md + daily logs\n- ✅ **Cloud Backup** — Optional SuperMemory sync\n- ✅ **Memory Hygiene** — Keep vectors lean, prevent token waste\n- ✅ **Mem0 Auto-Extraction** — Automatic fact extraction, 80% token reduction\n\n## Quick Start\n\n```bash\n# Initialize in your workspace\nnpx elite-longterm-memory init\n\n# Check status\nnpx elite-longterm-memory status\n\n# Create today's log\nnpx elite-longterm-memory today\n```\n\n## Architecture\n\n```\n┌─────────────────────────────────────────────────────┐\n│              ELITE LONGTERM MEMORY                  │\n├─────────────────────────────────────────────────────┤\n│  HOT RAM          WARM STORE        COLD STORE     │\n│  SESSION-STATE.md → LanceDB      → Git-Notes       │\n│  (survives         (semantic       (permanent      │\n│   compaction)       search)         decisions)     │\n│         │              │                │          │\n│         └──────────────┼────────────────┘          │\n│                        ▼                           │\n│                   MEMORY.md                        │\n│               (curated archive)                    │\n└─────────────────────────────────────────────────────┘\n```\n\n## The 5 Memory Layers\n\n| Layer | File/System | Purpose | Persistence |\n|-------|-------------|---------|-------------|\n| 1. Hot RAM | SESSION-STATE.md | Active task context | Survives compaction |\n| 2. Warm Store | LanceDB | Semantic search | Auto-recall |\n| 3. Cold Store | Git-Notes | Structured decisions | Permanent |\n| 4. Archive | MEMORY.md + daily/ | Human-readable | Curated |\n| 5. Cloud | SuperMemory | Cross-device sync | Optional |\n\n## The WAL Protocol\n\n**Critical insight:** Write state BEFORE responding, not after.\n\n```\nUser: \"Let's use Tailwind for this project\"\n\nAgent (internal):\n1. Write to SESSION-STATE.md → \"Decision: Use Tailwind\"\n2. THEN respond → \"Got it — Tailwind it is...\"\n```\n\nIf you respond first and crash before saving, context is lost. WAL ensures durability.\n\n## Why Memory Fails (And How to Fix It)\n\n| Problem | Cause | Fix |\n|---------|-------|-----|\n| Forgets everything | memory_search disabled | Enable + add OpenAI key |\n| Repeats mistakes | Lessons not logged | Write to memory/lessons.md |\n| Sub-agents isolated | No context inheritance | Pass context in task prompt |\n| Facts not captured | No auto-extraction | Use Mem0 (see below) |\n\n## Mem0 Integration (Recommended)\n\nAuto-extract facts from conversations. 80% token reduction.\n\n```bash\nnpm install mem0ai\nexport MEM0_API_KEY=\"your-key\"\n```\n\n```javascript\nconst { MemoryClient } = require('mem0ai');\nconst client = new MemoryClient({ apiKey: process.env.MEM0_API_KEY });\n\n// Auto-extracts facts from messages\nawait client.add(messages, { user_id: \"user123\" });\n\n// Retrieve relevant memories  \nconst memories = await client.search(query, { user_id: \"user123\" });\n```\n\n## For Clawdbot/Moltbot Users\n\nAdd to `~/.clawdbot/clawdbot.json`:\n\n```json\n{\n  \"memorySearch\": {\n    \"enabled\": true,\n    \"provider\": \"openai\",\n    \"sources\": [\"memory\"]\n  }\n}\n```\n\n## Files Created\n\n```\nworkspace/\n├── SESSION-STATE.md    # Hot RAM (active context)\n├── MEMORY.md           # Curated long-term memory\n└── memory/\n    ├── 2026-01-30.md   # Daily logs\n    └── ...\n```\n\n## Commands\n\n```bash\nelite-memory init      # Initialize memory system\nelite-memory status    # Check health\nelite-memory today     # Create today's log\nelite-memory help      # Show help\n```\n\n## Links\n\n- [Full Documentation (SKILL.md)](./SKILL.md)\n- [ClawdHub](https://clawdhub.com/skills/elite-longterm-memory)\n- [GitHub](https://github.com/NextFrontierBuilds/elite-longterm-memory)\n\n---\n\nBuilt by [@NextXFrontier](https://x.com/NextXFrontier)\n",
  "bytes": 5073,
  "sha": "17c0c112c1363fe9568fdbd10674660aa6755f6ba454f5d919bc332a34c0c653",
  "repo_slug": "nextfrontierbuilds/elite-longterm-memory",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/skl_nextfrontierbuilds_elite_longterm_memory_44990359/readme"
}