{"id":"947fbe9e-f832-408a-a2a8-eff63b3839f2","entityType":"agent","slug":"clawhub-nextfrontierbuilds-elite-longterm-memory-2","name":"Elite Longterm Memory","canonicalUrl":"https://www.xpersona.co/agent/clawhub-nextfrontierbuilds-elite-longterm-memory-2","canonicalPath":"/agent/clawhub-nextfrontierbuilds-elite-longterm-memory-2","generatedAt":"2026-10-09T10:25:41.807Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-05-21T06:30:03.356Z","emptyReason":null},"description":"Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready. Skill: Elite Longterm Memory Owner: nextfrontierbuilds Summary: Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready. Tags: latest:1.2.3, ai:0.1.0, clawdbot:0.1.0, long-term:0.1.0, memory:0.1.0, openclaw:0.1.0, persistence:0.1.0 Version history: v1.2.3 | 2026-02-11T08:37:00.241Z | auto - Expanded des","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 58.9K downloads reported by the source. Last updated 5/21/2026.","installCommand":"clawhub skill install s173crrwz6a8ksnw7w0q36yky18408nb:elite-longterm-memory","sourceUrl":"https://clawhub.ai/nextfrontierbuilds/elite-longterm-memory","homepage":"https://clawhub.ai/nextfrontierbuilds/elite-longterm-memory","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/nextfrontierbuilds/elite-longterm-memory","kind":"source"}],"safetyScore":84,"overallRank":62,"popularityScore":95,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-c"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-05-21T06:30:03.356Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-05-21T06:30:03.356Z","emptyReason":null},"stars":null,"forks":null,"downloads":58856,"packageName":null,"latestVersion":"1.2.3","tractionLabel":"58.9K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-05-21T06:30:03.297Z","emptyReason":null},"lastUpdatedAt":"2026-05-21T06:30:03.356Z","lastCrawledAt":"2026-05-21T06:30:03.297Z","lastIndexedAt":null,"nextCrawlAt":"2026-05-22T06:30:03.297Z","lastVerifiedAt":null,"highlights":[{"version":"1.2.3","createdAt":"2026-02-11T08:37:00.241Z","changelog":"- Expanded description and keywords for improved discoverability, highlighting ChatGPT, Copilot, Cursor, and developer tooling. - Updated version to 1.2.3. - Clarified compatibility and marketing text in SKILL.md. - No functional or implementation changes to code logic.","fileCount":5,"zipByteSize":9526},{"version":"1.2.2","createdAt":"2026-02-04T15:59:05.664Z","changelog":"Rebranded to OpenClaw","fileCount":5,"zipByteSize":9444},{"version":"1.2.1","createdAt":"2026-02-04T15:44:05.285Z","changelog":"SEO update: added claude-code, cursor, copilot, agentic keywords","fileCount":5,"zipByteSize":9450},{"version":"0.1.0","createdAt":"2026-02-02T16:37:23.398Z","changelog":"**Major upgrade: Combines 6 advanced memory systems for AI agents into a single robust architecture.** - Integrates Write-Ahead Log session memory, LanceDB vector search, git-notes knowledge graphs, curated long-term logs, cloud backup, and optional auto-extraction. - Adds new auto-extraction tier (Mem0) for fact preference/decision extraction, enabling 80% token reduction. - Provides clear agent usage protocols to maintain durability and prevent context loss. - Extensive setup and workflow guides for seamless deployment with Clawdbot, Moltbot, Claude, and GPT agents.","fileCount":5,"zipByteSize":9422}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s173crrwz6a8ksnw7w0q36yky18408nb:elite-longterm-memory","setupComplexity":"low","setupSteps":["Node.js workspace detected. Install dependencies securely: run `npm ci --ignore-scripts` to prevent post-install lifecycle triggers from running arbitrary code, then selectively audit the dependency tree.","Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nextfrontierbuilds-elite-longterm-memory-2/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nextfrontierbuilds-elite-longterm-memory-2/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nextfrontierbuilds-elite-longterm-memory-2/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-nextfrontierbuilds-elite-longterm-memory-2/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-nextfrontierbuilds-elite-longterm-memory-2/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-nextfrontierbuilds-elite-longterm-memory-2/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-09T10:25:41.806Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nextfrontierbuilds-elite-longterm-memory-2/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nextfrontierbuilds-elite-longterm-memory-2/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nextfrontierbuilds-elite-longterm-memory-2/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-nextfrontierbuilds-elite-longterm-memory-2/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-05-21T06:30:03.356Z","emptyReason":null},"readme":"Skill: Elite Longterm Memory\n\nOwner: nextfrontierbuilds\n\nSummary: Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.\n\nTags: latest:1.2.3, ai:0.1.0, clawdbot:0.1.0, long-term:0.1.0, memory:0.1.0, openclaw:0.1.0, persistence:0.1.0\n\nVersion history:\n\nv1.2.3 | 2026-02-11T08:37:00.241Z | auto\n\n- Expanded description and keywords for improved discoverability, highlighting ChatGPT, Copilot, Cursor, and developer tooling.\n- Updated version to 1.2.3.\n- Clarified compatibility and marketing text in SKILL.md.\n- No functional or implementation changes to code logic.\n\nv1.2.2 | 2026-02-04T15:59:05.664Z | user\n\nRebranded to OpenClaw\n\nv1.2.1 | 2026-02-04T15:44:05.285Z | user\n\nSEO update: added claude-code, cursor, copilot, agentic keywords\n\nv0.1.0 | 2026-02-02T16:37:23.398Z | auto\n\n**Major upgrade: Combines 6 advanced memory systems for AI agents into a single robust architecture.**\n\n- Integrates Write-Ahead Log session memory, LanceDB vector search, git-notes knowledge graphs, curated long-term logs, cloud backup, and optional auto-extraction.\n- Adds new auto-extraction tier (Mem0) for fact preference/decision extraction, enabling 80% token reduction.\n- Provides clear agent usage protocols to maintain durability and prevent context loss.\n- Extensive setup and workflow guides for seamless deployment with Clawdbot, Moltbot, Claude, and GPT agents.\n\nArchive index:\n\nArchive v1.2.3: 5 files, 9526 bytes\n\nFiles: bin/elite-memory.js (4875b), package.json (1288b), README.md (5593b), SKILL.md (12723b), _meta.json (140b)\n\nFile v1.2.3:SKILL.md\n\n---\nname: elite-longterm-memory\nversion: 1.2.3\ndescription: \"Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.\"\nauthor: NextFrontierBuilds\nkeywords: [memory, ai-agent, ai-coding, long-term-memory, vector-search, lancedb, git-notes, wal, persistent-context, claude, claude-code, gpt, chatgpt, cursor, copilot, github-copilot, openclaw, moltbot, vibe-coding, agentic, ai-tools, developer-tools, devtools, typescript, llm, automation]\nmetadata:\n  openclaw:\n    emoji: \"🧠\"\n    requires:\n      env:\n        - OPENAI_API_KEY\n      plugins:\n        - memory-lancedb\n---\n\n# Elite Longterm Memory 🧠\n\n**The ultimate memory system for AI agents.** Combines 6 proven approaches into one bulletproof architecture.\n\nNever lose context. Never forget decisions. Never repeat mistakes.\n\n## Architecture Overview\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                    ELITE LONGTERM MEMORY                        │\n├─────────────────────────────────────────────────────────────────┤\n│                                                                 │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐             │\n│  │   HOT RAM   │  │  WARM STORE │  │  COLD STORE │             │\n│  │             │  │             │  │             │             │\n│  │ SESSION-    │  │  LanceDB    │  │  Git-Notes  │             │\n│  │ STATE.md    │  │  Vectors    │  │  Knowledge  │             │\n│  │             │  │             │  │  Graph      │             │\n│  │ (survives   │  │ (semantic   │  │ (permanent  │             │\n│  │  compaction)│  │  search)    │  │  decisions) │             │\n│  └─────────────┘  └─────────────┘  └─────────────┘             │\n│         │                │                │                     │\n│         └────────────────┼────────────────┘                     │\n│                          ▼                                      │\n│                  ┌─────────────┐                                │\n│                  │  MEMORY.md  │  ← Curated long-term           │\n│                  │  + daily/   │    (human-readable)            │\n│                  └─────────────┘                                │\n│                          │                                      │\n│                          ▼                                      │\n│                  ┌─────────────┐                                │\n│                  │ SuperMemory │  ← Cloud backup (optional)     │\n│                  │    API      │                                │\n│                  └─────────────┘                                │\n│                                                                 │\n└─────────────────────────────────────────────────────────────────┘\n```\n\n## The 5 Memory Layers\n\n### Layer 1: HOT RAM (SESSION-STATE.md)\n**From: bulletproof-memory**\n\nActive working memory that survives compaction. Write-Ahead Log protocol.\n\n```markdown\n# SESSION-STATE.md — Active Working Memory\n\n## Current Task\n[What we're working on RIGHT NOW]\n\n## Key Context\n- User preference: ...\n- Decision made: ...\n- Blocker: ...\n\n## Pending Actions\n- [ ] ...\n```\n\n**Rule:** Write BEFORE responding. Triggered by user input, not agent memory.\n\n### Layer 2: WARM STORE (LanceDB Vectors)\n**From: lancedb-memory**\n\nSemantic search across all memories. Auto-recall injects relevant context.\n\n```bash\n# Auto-recall (happens automatically)\nmemory_recall query=\"project status\" limit=5\n\n# Manual store\nmemory_store text=\"User prefers dark mode\" category=\"preference\" importance=0.9\n```\n\n### Layer 3: COLD STORE (Git-Notes Knowledge Graph)\n**From: git-notes-memory**\n\nStructured decisions, learnings, and context. Branch-aware.\n\n```bash\n# Store a decision (SILENT - never announce)\npython3 memory.py -p $DIR remember '{\"type\":\"decision\",\"content\":\"Use React for frontend\"}' -t tech -i h\n\n# Retrieve context\npython3 memory.py -p $DIR get \"frontend\"\n```\n\n### Layer 4: CURATED ARCHIVE (MEMORY.md + daily/)\n**From: OpenClaw native**\n\nHuman-readable long-term memory. Daily logs + distilled wisdom.\n\n```\nworkspace/\n├── MEMORY.md              # Curated long-term (the good stuff)\n└── memory/\n    ├── 2026-01-30.md      # Daily log\n    ├── 2026-01-29.md\n    └── topics/            # Topic-specific files\n```\n\n### Layer 5: CLOUD BACKUP (SuperMemory) — Optional\n**From: supermemory**\n\nCross-device sync. Chat with your knowledge base.\n\n```bash\nexport SUPERMEMORY_API_KEY=\"your-key\"\nsupermemory add \"Important context\"\nsupermemory search \"what did we decide about...\"\n```\n\n### Layer 6: AUTO-EXTRACTION (Mem0) — Recommended\n**NEW: Automatic fact extraction**\n\nMem0 automatically extracts 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// Conversations auto-extract facts\nawait client.add(messages, { user_id: \"user123\" });\n\n// Retrieve relevant memories\nconst memories = await client.search(query, { user_id: \"user123\" });\n```\n\nBenefits:\n- Auto-extracts preferences, decisions, facts\n- Deduplicates and updates existing memories\n- 80% reduction in tokens vs raw history\n- Works across sessions automatically\n\n## Quick Setup\n\n### 1. Create SESSION-STATE.md (Hot RAM)\n\n```bash\ncat > SESSION-STATE.md << 'EOF'\n# SESSION-STATE.md — Active Working Memory\n\nThis file is the agent's \"RAM\" — survives compaction, restarts, distractions.\n\n## Current Task\n[None]\n\n## Key Context\n[None yet]\n\n## Pending Actions\n- [ ] None\n\n## Recent Decisions\n[None yet]\n\n---\n*Last updated: [timestamp]*\nEOF\n```\n\n### 2. Enable LanceDB (Warm Store)\n\nIn `~/.openclaw/openclaw.json`:\n\n```json\n{\n  \"memorySearch\": {\n    \"enabled\": true,\n    \"provider\": \"openai\",\n    \"sources\": [\"memory\"],\n    \"minScore\": 0.3,\n    \"maxResults\": 10\n  },\n  \"plugins\": {\n    \"entries\": {\n      \"memory-lancedb\": {\n        \"enabled\": true,\n        \"config\": {\n          \"autoCapture\": false,\n          \"autoRecall\": true,\n          \"captureCategories\": [\"preference\", \"decision\", \"fact\"],\n          \"minImportance\": 0.7\n        }\n      }\n    }\n  }\n}\n```\n\n### 3. Initialize Git-Notes (Cold Store)\n\n```bash\ncd ~/clawd\ngit init  # if not already\npython3 skills/git-notes-memory/memory.py -p . sync --start\n```\n\n### 4. Verify MEMORY.md Structure\n\n```bash\n# Ensure you have:\n# - MEMORY.md in workspace root\n# - memory/ folder for daily logs\nmkdir -p memory\n```\n\n### 5. (Optional) Setup SuperMemory\n\n```bash\nexport SUPERMEMORY_API_KEY=\"your-key\"\n# Add to ~/.zshrc for persistence\n```\n\n## Agent Instructions\n\n### On Session Start\n1. Read SESSION-STATE.md — this is your hot context\n2. Run `memory_search` for relevant prior context\n3. Check memory/YYYY-MM-DD.md for recent activity\n\n### During Conversation\n1. **User gives concrete detail?** → Write to SESSION-STATE.md BEFORE responding\n2. **Important decision made?** → Store in Git-Notes (SILENTLY)\n3. **Preference expressed?** → `memory_store` with importance=0.9\n\n### On Session End\n1. Update SESSION-STATE.md with final state\n2. Move significant items to MEMORY.md if worth keeping long-term\n3. Create/update daily log in memory/YYYY-MM-DD.md\n\n### Memory Hygiene (Weekly)\n1. Review SESSION-STATE.md — archive completed tasks\n2. Check LanceDB for junk: `memory_recall query=\"*\" limit=50`\n3. Clear irrelevant vectors: `memory_forget id=<id>`\n4. Consolidate daily logs into MEMORY.md\n\n## The WAL Protocol (Critical)\n\n**Write-Ahead Log:** Write state BEFORE responding, not after.\n\n| Trigger | Action |\n|---------|--------|\n| User states preference | Write to SESSION-STATE.md → then respond |\n| User makes decision | Write to SESSION-STATE.md → then respond |\n| User gives deadline | Write to SESSION-STATE.md → then respond |\n| User corrects you | Write to SESSION-STATE.md → then respond |\n\n**Why?** If you respond first and crash/compact before saving, context is lost. WAL ensures durability.\n\n## Example Workflow\n\n```\nUser: \"Let's use Tailwind for this project, not vanilla CSS\"\n\nAgent (internal):\n1. Write to SESSION-STATE.md: \"Decision: Use Tailwind, not vanilla CSS\"\n2. Store in Git-Notes: decision about CSS framework\n3. memory_store: \"User prefers Tailwind over vanilla CSS\" importance=0.9\n4. THEN respond: \"Got it — Tailwind it is...\"\n```\n\n## Maintenance Commands\n\n```bash\n# Audit vector memory\nmemory_recall query=\"*\" limit=50\n\n# Clear all vectors (nuclear option)\nrm -rf ~/.openclaw/memory/lancedb/\nopenclaw gateway restart\n\n# Export Git-Notes\npython3 memory.py -p . export --format json > memories.json\n\n# Check memory health\ndu -sh ~/.openclaw/memory/\nwc -l MEMORY.md\nls -la memory/\n```\n\n## Why Memory Fails\n\nUnderstanding the root causes helps you fix them:\n\n| Failure Mode | Cause | Fix |\n|--------------|-------|-----|\n| Forgets everything | `memory_search` disabled | Enable + add OpenAI key |\n| Files not loaded | Agent skips reading memory | Add to AGENTS.md rules |\n| Facts not captured | No auto-extraction | Use Mem0 or manual logging |\n| Sub-agents isolated | Don't inherit context | Pass context in task prompt |\n| Repeats mistakes | Lessons not logged | Write to memory/lessons.md |\n\n## Solutions (Ranked by Effort)\n\n### 1. Quick Win: Enable memory_search\n\nIf you have an OpenAI key, enable semantic search:\n\n```bash\nopenclaw configure --section web\n```\n\nThis enables vector search over MEMORY.md + memory/*.md files.\n\n### 2. Recommended: Mem0 Integration\n\nAuto-extract facts from conversations. 80% token reduction.\n\n```bash\nnpm install mem0ai\n```\n\n```javascript\nconst { MemoryClient } = require('mem0ai');\n\nconst client = new MemoryClient({ apiKey: process.env.MEM0_API_KEY });\n\n// Auto-extract and store\nawait client.add([\n  { role: \"user\", content: \"I prefer Tailwind over vanilla CSS\" }\n], { user_id: \"ty\" });\n\n// Retrieve relevant memories\nconst memories = await client.search(\"CSS preferences\", { user_id: \"ty\" });\n```\n\n### 3. Better File Structure (No Dependencies)\n\n```\nmemory/\n├── projects/\n│   ├── strykr.md\n│   └── taska.md\n├── people/\n│   └── contacts.md\n├── decisions/\n│   └── 2026-01.md\n├── lessons/\n│   └── mistakes.md\n└── preferences.md\n```\n\nKeep MEMORY.md as a summary (<5KB), link to detailed files.\n\n## Immediate Fixes Checklist\n\n| Problem | Fix |\n|---------|-----|\n| Forgets preferences | Add `## Preferences` section to MEMORY.md |\n| Repeats mistakes | Log every mistake to `memory/lessons.md` |\n| Sub-agents lack context | Include key context in spawn task prompt |\n| Forgets recent work | Strict daily file discipline |\n| Memory search not working | Check `OPENAI_API_KEY` is set |\n\n## Troubleshooting\n\n**Agent keeps forgetting mid-conversation:**\n→ SESSION-STATE.md not being updated. Check WAL protocol.\n\n**Irrelevant memories injected:**\n→ Disable autoCapture, increase minImportance threshold.\n\n**Memory too large, slow recall:**\n→ Run hygiene: clear old vectors, archive daily logs.\n\n**Git-Notes not persisting:**\n→ Run `git notes push` to sync with remote.\n\n**memory_search returns nothing:**\n→ Check OpenAI API key: `echo $OPENAI_API_KEY`\n→ Verify memorySearch enabled in openclaw.json\n\n---\n\n## Links\n\n- bulletproof-memory: https://clawdhub.com/skills/bulletproof-memory\n- lancedb-memory: https://clawdhub.com/skills/lancedb-memory\n- git-notes-memory: https://clawdhub.com/skills/git-notes-memory\n- memory-hygiene: https://clawdhub.com/skills/memory-hygiene\n- supermemory: https://clawdhub.com/skills/supermemory\n\n---\n\n*Built by [@NextXFrontier](https://x.com/NextXFrontier) — Part of the Next Frontier AI toolkit*\n\nFile v1.2.3:README.md\n\n# 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\nFile v1.2.3:_meta.json\n\n{\n  \"ownerId\": \"kn7ewywaj7mf48drbjw1baa5298016yv\",\n  \"slug\": \"elite-longterm-memory\",\n  \"version\": \"1.2.3\",\n  \"publishedAt\": 1770799020241\n}\n\nFile v1.2.3:package.json\n\n{\n  \"name\": \"elite-longterm-memory\",\n  \"version\": \"1.2.3\",\n  \"description\": \"Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol, vector search, git-based knowledge graphs, cloud backup. Never lose context again.\",\n  \"keywords\": [\n    \"memory\",\n    \"ai-agent\",\n    \"long-term-memory\",\n    \"vector-search\",\n    \"lancedb\",\n    \"git-notes\",\n    \"wal\",\n    \"persistent-context\",\n    \"claude\",\n    \"gpt\",\n    \"chatgpt\",\n    \"openclaw\",\n    \"moltbot\",\n    \"cursor\",\n    \"copilot\",\n    \"github-copilot\",\n    \"ai\",\n    \"llm\",\n    \"automation\",\n    \"context-management\",\n    \"mem0\",\n    \"auto-extraction\",\n    \"fact-extraction\",\n    \"vibe-coding\",\n    \"ai-tools\",\n    \"developer-tools\",\n    \"devtools\",\n    \"typescript\"\n  ],\n  \"optionalDependencies\": {\n    \"mem0ai\": \"^1.0.0\"\n  },\n  \"author\": \"NextFrontierBuilds\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory\"\n  },\n  \"homepage\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory\",\n  \"bugs\": {\n    \"url\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory/issues\"\n  },\n  \"bin\": {\n    \"elite-memory\": \"./bin/elite-memory.js\"\n  },\n  \"files\": [\n    \"SKILL.md\",\n    \"bin/\",\n    \"templates/\",\n    \"README.md\"\n  ]\n}\n\nArchive v1.2.2: 5 files, 9444 bytes\n\nFiles: bin/elite-memory.js (4875b), package.json (1183b), README.md (5593b), SKILL.md (12634b), _meta.json (140b)\n\nFile v1.2.2:SKILL.md\n\n---\nname: elite-longterm-memory\nversion: 1.2.1\ndescription: \"Ultimate AI agent memory system. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Works with Claude, Cursor, GPT, OpenClaw agents.\"\nauthor: NextFrontierBuilds\nkeywords: [memory, ai-agent, ai-coding, long-term-memory, vector-search, lancedb, git-notes, wal, persistent-context, claude, claude-code, gpt, cursor, copilot, openclaw, moltbot, openclaw, vibe-coding, agentic]\nmetadata:\n  openclaw:\n    emoji: \"🧠\"\n    requires:\n      env:\n        - OPENAI_API_KEY\n      plugins:\n        - memory-lancedb\n---\n\n# Elite Longterm Memory 🧠\n\n**The ultimate memory system for AI agents.** Combines 6 proven approaches into one bulletproof architecture.\n\nNever lose context. Never forget decisions. Never repeat mistakes.\n\n## Architecture Overview\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                    ELITE LONGTERM MEMORY                        │\n├─────────────────────────────────────────────────────────────────┤\n│                                                                 │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐             │\n│  │   HOT RAM   │  │  WARM STORE │  │  COLD STORE │             │\n│  │             │  │             │  │             │             │\n│  │ SESSION-    │  │  LanceDB    │  │  Git-Notes  │             │\n│  │ STATE.md    │  │  Vectors    │  │  Knowledge  │             │\n│  │             │  │             │  │  Graph      │             │\n│  │ (survives   │  │ (semantic   │  │ (permanent  │             │\n│  │  compaction)│  │  search)    │  │  decisions) │             │\n│  └─────────────┘  └─────────────┘  └─────────────┘             │\n│         │                │                │                     │\n│         └────────────────┼────────────────┘                     │\n│                          ▼                                      │\n│                  ┌─────────────┐                                │\n│                  │  MEMORY.md  │  ← Curated long-term           │\n│                  │  + daily/   │    (human-readable)            │\n│                  └─────────────┘                                │\n│                          │                                      │\n│                          ▼                                      │\n│                  ┌─────────────┐                                │\n│                  │ SuperMemory │  ← Cloud backup (optional)     │\n│                  │    API      │                                │\n│                  └─────────────┘                                │\n│                                                                 │\n└─────────────────────────────────────────────────────────────────┘\n```\n\n## The 5 Memory Layers\n\n### Layer 1: HOT RAM (SESSION-STATE.md)\n**From: bulletproof-memory**\n\nActive working memory that survives compaction. Write-Ahead Log protocol.\n\n```markdown\n# SESSION-STATE.md — Active Working Memory\n\n## Current Task\n[What we're working on RIGHT NOW]\n\n## Key Context\n- User preference: ...\n- Decision made: ...\n- Blocker: ...\n\n## Pending Actions\n- [ ] ...\n```\n\n**Rule:** Write BEFORE responding. Triggered by user input, not agent memory.\n\n### Layer 2: WARM STORE (LanceDB Vectors)\n**From: lancedb-memory**\n\nSemantic search across all memories. Auto-recall injects relevant context.\n\n```bash\n# Auto-recall (happens automatically)\nmemory_recall query=\"project status\" limit=5\n\n# Manual store\nmemory_store text=\"User prefers dark mode\" category=\"preference\" importance=0.9\n```\n\n### Layer 3: COLD STORE (Git-Notes Knowledge Graph)\n**From: git-notes-memory**\n\nStructured decisions, learnings, and context. Branch-aware.\n\n```bash\n# Store a decision (SILENT - never announce)\npython3 memory.py -p $DIR remember '{\"type\":\"decision\",\"content\":\"Use React for frontend\"}' -t tech -i h\n\n# Retrieve context\npython3 memory.py -p $DIR get \"frontend\"\n```\n\n### Layer 4: CURATED ARCHIVE (MEMORY.md + daily/)\n**From: OpenClaw native**\n\nHuman-readable long-term memory. Daily logs + distilled wisdom.\n\n```\nworkspace/\n├── MEMORY.md              # Curated long-term (the good stuff)\n└── memory/\n    ├── 2026-01-30.md      # Daily log\n    ├── 2026-01-29.md\n    └── topics/            # Topic-specific files\n```\n\n### Layer 5: CLOUD BACKUP (SuperMemory) — Optional\n**From: supermemory**\n\nCross-device sync. Chat with your knowledge base.\n\n```bash\nexport SUPERMEMORY_API_KEY=\"your-key\"\nsupermemory add \"Important context\"\nsupermemory search \"what did we decide about...\"\n```\n\n### Layer 6: AUTO-EXTRACTION (Mem0) — Recommended\n**NEW: Automatic fact extraction**\n\nMem0 automatically extracts 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// Conversations auto-extract facts\nawait client.add(messages, { user_id: \"user123\" });\n\n// Retrieve relevant memories\nconst memories = await client.search(query, { user_id: \"user123\" });\n```\n\nBenefits:\n- Auto-extracts preferences, decisions, facts\n- Deduplicates and updates existing memories\n- 80% reduction in tokens vs raw history\n- Works across sessions automatically\n\n## Quick Setup\n\n### 1. Create SESSION-STATE.md (Hot RAM)\n\n```bash\ncat > SESSION-STATE.md << 'EOF'\n# SESSION-STATE.md — Active Working Memory\n\nThis file is the agent's \"RAM\" — survives compaction, restarts, distractions.\n\n## Current Task\n[None]\n\n## Key Context\n[None yet]\n\n## Pending Actions\n- [ ] None\n\n## Recent Decisions\n[None yet]\n\n---\n*Last updated: [timestamp]*\nEOF\n```\n\n### 2. Enable LanceDB (Warm Store)\n\nIn `~/.openclaw/openclaw.json`:\n\n```json\n{\n  \"memorySearch\": {\n    \"enabled\": true,\n    \"provider\": \"openai\",\n    \"sources\": [\"memory\"],\n    \"minScore\": 0.3,\n    \"maxResults\": 10\n  },\n  \"plugins\": {\n    \"entries\": {\n      \"memory-lancedb\": {\n        \"enabled\": true,\n        \"config\": {\n          \"autoCapture\": false,\n          \"autoRecall\": true,\n          \"captureCategories\": [\"preference\", \"decision\", \"fact\"],\n          \"minImportance\": 0.7\n        }\n      }\n    }\n  }\n}\n```\n\n### 3. Initialize Git-Notes (Cold Store)\n\n```bash\ncd ~/clawd\ngit init  # if not already\npython3 skills/git-notes-memory/memory.py -p . sync --start\n```\n\n### 4. Verify MEMORY.md Structure\n\n```bash\n# Ensure you have:\n# - MEMORY.md in workspace root\n# - memory/ folder for daily logs\nmkdir -p memory\n```\n\n### 5. (Optional) Setup SuperMemory\n\n```bash\nexport SUPERMEMORY_API_KEY=\"your-key\"\n# Add to ~/.zshrc for persistence\n```\n\n## Agent Instructions\n\n### On Session Start\n1. Read SESSION-STATE.md — this is your hot context\n2. Run `memory_search` for relevant prior context\n3. Check memory/YYYY-MM-DD.md for recent activity\n\n### During Conversation\n1. **User gives concrete detail?** → Write to SESSION-STATE.md BEFORE responding\n2. **Important decision made?** → Store in Git-Notes (SILENTLY)\n3. **Preference expressed?** → `memory_store` with importance=0.9\n\n### On Session End\n1. Update SESSION-STATE.md with final state\n2. Move significant items to MEMORY.md if worth keeping long-term\n3. Create/update daily log in memory/YYYY-MM-DD.md\n\n### Memory Hygiene (Weekly)\n1. Review SESSION-STATE.md — archive completed tasks\n2. Check LanceDB for junk: `memory_recall query=\"*\" limit=50`\n3. Clear irrelevant vectors: `memory_forget id=<id>`\n4. Consolidate daily logs into MEMORY.md\n\n## The WAL Protocol (Critical)\n\n**Write-Ahead Log:** Write state BEFORE responding, not after.\n\n| Trigger | Action |\n|---------|--------|\n| User states preference | Write to SESSION-STATE.md → then respond |\n| User makes decision | Write to SESSION-STATE.md → then respond |\n| User gives deadline | Write to SESSION-STATE.md → then respond |\n| User corrects you | Write to SESSION-STATE.md → then respond |\n\n**Why?** If you respond first and crash/compact before saving, context is lost. WAL ensures durability.\n\n## Example Workflow\n\n```\nUser: \"Let's use Tailwind for this project, not vanilla CSS\"\n\nAgent (internal):\n1. Write to SESSION-STATE.md: \"Decision: Use Tailwind, not vanilla CSS\"\n2. Store in Git-Notes: decision about CSS framework\n3. memory_store: \"User prefers Tailwind over vanilla CSS\" importance=0.9\n4. THEN respond: \"Got it — Tailwind it is...\"\n```\n\n## Maintenance Commands\n\n```bash\n# Audit vector memory\nmemory_recall query=\"*\" limit=50\n\n# Clear all vectors (nuclear option)\nrm -rf ~/.openclaw/memory/lancedb/\nopenclaw gateway restart\n\n# Export Git-Notes\npython3 memory.py -p . export --format json > memories.json\n\n# Check memory health\ndu -sh ~/.openclaw/memory/\nwc -l MEMORY.md\nls -la memory/\n```\n\n## Why Memory Fails\n\nUnderstanding the root causes helps you fix them:\n\n| Failure Mode | Cause | Fix |\n|--------------|-------|-----|\n| Forgets everything | `memory_search` disabled | Enable + add OpenAI key |\n| Files not loaded | Agent skips reading memory | Add to AGENTS.md rules |\n| Facts not captured | No auto-extraction | Use Mem0 or manual logging |\n| Sub-agents isolated | Don't inherit context | Pass context in task prompt |\n| Repeats mistakes | Lessons not logged | Write to memory/lessons.md |\n\n## Solutions (Ranked by Effort)\n\n### 1. Quick Win: Enable memory_search\n\nIf you have an OpenAI key, enable semantic search:\n\n```bash\nopenclaw configure --section web\n```\n\nThis enables vector search over MEMORY.md + memory/*.md files.\n\n### 2. Recommended: Mem0 Integration\n\nAuto-extract facts from conversations. 80% token reduction.\n\n```bash\nnpm install mem0ai\n```\n\n```javascript\nconst { MemoryClient } = require('mem0ai');\n\nconst client = new MemoryClient({ apiKey: process.env.MEM0_API_KEY });\n\n// Auto-extract and store\nawait client.add([\n  { role: \"user\", content: \"I prefer Tailwind over vanilla CSS\" }\n], { user_id: \"ty\" });\n\n// Retrieve relevant memories\nconst memories = await client.search(\"CSS preferences\", { user_id: \"ty\" });\n```\n\n### 3. Better File Structure (No Dependencies)\n\n```\nmemory/\n├── projects/\n│   ├── strykr.md\n│   └── taska.md\n├── people/\n│   └── contacts.md\n├── decisions/\n│   └── 2026-01.md\n├── lessons/\n│   └── mistakes.md\n└── preferences.md\n```\n\nKeep MEMORY.md as a summary (<5KB), link to detailed files.\n\n## Immediate Fixes Checklist\n\n| Problem | Fix |\n|---------|-----|\n| Forgets preferences | Add `## Preferences` section to MEMORY.md |\n| Repeats mistakes | Log every mistake to `memory/lessons.md` |\n| Sub-agents lack context | Include key context in spawn task prompt |\n| Forgets recent work | Strict daily file discipline |\n| Memory search not working | Check `OPENAI_API_KEY` is set |\n\n## Troubleshooting\n\n**Agent keeps forgetting mid-conversation:**\n→ SESSION-STATE.md not being updated. Check WAL protocol.\n\n**Irrelevant memories injected:**\n→ Disable autoCapture, increase minImportance threshold.\n\n**Memory too large, slow recall:**\n→ Run hygiene: clear old vectors, archive daily logs.\n\n**Git-Notes not persisting:**\n→ Run `git notes push` to sync with remote.\n\n**memory_search returns nothing:**\n→ Check OpenAI API key: `echo $OPENAI_API_KEY`\n→ Verify memorySearch enabled in openclaw.json\n\n---\n\n## Links\n\n- bulletproof-memory: https://clawdhub.com/skills/bulletproof-memory\n- lancedb-memory: https://clawdhub.com/skills/lancedb-memory\n- git-notes-memory: https://clawdhub.com/skills/git-notes-memory\n- memory-hygiene: https://clawdhub.com/skills/memory-hygiene\n- supermemory: https://clawdhub.com/skills/supermemory\n\n---\n\n*Built by [@NextXFrontier](https://x.com/NextXFrontier) — Part of the Next Frontier AI toolkit*\n\nFile v1.2.2:README.md\n\n# 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\nFile v1.2.2:_meta.json\n\n{\n  \"ownerId\": \"kn7ewywaj7mf48drbjw1baa5298016yv\",\n  \"slug\": \"elite-longterm-memory\",\n  \"version\": \"1.2.2\",\n  \"publishedAt\": 1770220745664\n}\n\nFile v1.2.2:package.json\n\n{\n  \"name\": \"elite-longterm-memory\",\n  \"version\": \"1.2.2\",\n  \"description\": \"Ultimate AI agent memory system. Combines bulletproof WAL protocol, vector search, git-based knowledge graphs, cloud backup, and maintenance hygiene. Never lose context again.\",\n  \"keywords\": [\n    \"memory\",\n    \"ai-agent\",\n    \"long-term-memory\",\n    \"vector-search\",\n    \"lancedb\",\n    \"git-notes\",\n    \"wal\",\n    \"persistent-context\",\n    \"claude\",\n    \"gpt\",\n    \"openclaw\",\n    \"moltbot\",\n    \"openclaw\",\n    \"cursor\",\n    \"copilot\",\n    \"ai\",\n    \"llm\",\n    \"automation\",\n    \"context-management\",\n    \"mem0\",\n    \"auto-extraction\",\n    \"fact-extraction\"\n  ],\n  \"optionalDependencies\": {\n    \"mem0ai\": \"^1.0.0\"\n  },\n  \"author\": \"NextFrontierBuilds\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory\"\n  },\n  \"homepage\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory\",\n  \"bugs\": {\n    \"url\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory/issues\"\n  },\n  \"bin\": {\n    \"elite-memory\": \"./bin/elite-memory.js\"\n  },\n  \"files\": [\n    \"SKILL.md\",\n    \"bin/\",\n    \"templates/\",\n    \"README.md\"\n  ]\n}\n\nArchive v1.2.1: 5 files, 9450 bytes\n\nFiles: bin/elite-memory.js (4875b), package.json (1179b), README.md (5593b), SKILL.md (12634b), _meta.json (140b)\n\nFile v1.2.1:SKILL.md\n\n---\nname: elite-longterm-memory\nversion: 1.2.1\ndescription: \"Ultimate AI agent memory system. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Works with Claude, Cursor, GPT, Clawdbot agents.\"\nauthor: NextFrontierBuilds\nkeywords: [memory, ai-agent, ai-coding, long-term-memory, vector-search, lancedb, git-notes, wal, persistent-context, claude, claude-code, gpt, cursor, copilot, clawdbot, moltbot, openclaw, vibe-coding, agentic]\nmetadata:\n  clawdbot:\n    emoji: \"🧠\"\n    requires:\n      env:\n        - OPENAI_API_KEY\n      plugins:\n        - memory-lancedb\n---\n\n# Elite Longterm Memory 🧠\n\n**The ultimate memory system for AI agents.** Combines 6 proven approaches into one bulletproof architecture.\n\nNever lose context. Never forget decisions. Never repeat mistakes.\n\n## Architecture Overview\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                    ELITE LONGTERM MEMORY                        │\n├─────────────────────────────────────────────────────────────────┤\n│                                                                 │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐             │\n│  │   HOT RAM   │  │  WARM STORE │  │  COLD STORE │             │\n│  │             │  │             │  │             │             │\n│  │ SESSION-    │  │  LanceDB    │  │  Git-Notes  │             │\n│  │ STATE.md    │  │  Vectors    │  │  Knowledge  │             │\n│  │             │  │             │  │  Graph      │             │\n│  │ (survives   │  │ (semantic   │  │ (permanent  │             │\n│  │  compaction)│  │  search)    │  │  decisions) │             │\n│  └─────────────┘  └─────────────┘  └─────────────┘             │\n│         │                │                │                     │\n│         └────────────────┼────────────────┘                     │\n│                          ▼                                      │\n│                  ┌─────────────┐                                │\n│                  │  MEMORY.md  │  ← Curated long-term           │\n│                  │  + daily/   │    (human-readable)            │\n│                  └─────────────┘                                │\n│                          │                                      │\n│                          ▼                                      │\n│                  ┌─────────────┐                                │\n│                  │ SuperMemory │  ← Cloud backup (optional)     │\n│                  │    API      │                                │\n│                  └─────────────┘                                │\n│                                                                 │\n└─────────────────────────────────────────────────────────────────┘\n```\n\n## The 5 Memory Layers\n\n### Layer 1: HOT RAM (SESSION-STATE.md)\n**From: bulletproof-memory**\n\nActive working memory that survives compaction. Write-Ahead Log protocol.\n\n```markdown\n# SESSION-STATE.md — Active Working Memory\n\n## Current Task\n[What we're working on RIGHT NOW]\n\n## Key Context\n- User preference: ...\n- Decision made: ...\n- Blocker: ...\n\n## Pending Actions\n- [ ] ...\n```\n\n**Rule:** Write BEFORE responding. Triggered by user input, not agent memory.\n\n### Layer 2: WARM STORE (LanceDB Vectors)\n**From: lancedb-memory**\n\nSemantic search across all memories. Auto-recall injects relevant context.\n\n```bash\n# Auto-recall (happens automatically)\nmemory_recall query=\"project status\" limit=5\n\n# Manual store\nmemory_store text=\"User prefers dark mode\" category=\"preference\" importance=0.9\n```\n\n### Layer 3: COLD STORE (Git-Notes Knowledge Graph)\n**From: git-notes-memory**\n\nStructured decisions, learnings, and context. Branch-aware.\n\n```bash\n# Store a decision (SILENT - never announce)\npython3 memory.py -p $DIR remember '{\"type\":\"decision\",\"content\":\"Use React for frontend\"}' -t tech -i h\n\n# Retrieve context\npython3 memory.py -p $DIR get \"frontend\"\n```\n\n### Layer 4: CURATED ARCHIVE (MEMORY.md + daily/)\n**From: Clawdbot native**\n\nHuman-readable long-term memory. Daily logs + distilled wisdom.\n\n```\nworkspace/\n├── MEMORY.md              # Curated long-term (the good stuff)\n└── memory/\n    ├── 2026-01-30.md      # Daily log\n    ├── 2026-01-29.md\n    └── topics/            # Topic-specific files\n```\n\n### Layer 5: CLOUD BACKUP (SuperMemory) — Optional\n**From: supermemory**\n\nCross-device sync. Chat with your knowledge base.\n\n```bash\nexport SUPERMEMORY_API_KEY=\"your-key\"\nsupermemory add \"Important context\"\nsupermemory search \"what did we decide about...\"\n```\n\n### Layer 6: AUTO-EXTRACTION (Mem0) — Recommended\n**NEW: Automatic fact extraction**\n\nMem0 automatically extracts 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// Conversations auto-extract facts\nawait client.add(messages, { user_id: \"user123\" });\n\n// Retrieve relevant memories\nconst memories = await client.search(query, { user_id: \"user123\" });\n```\n\nBenefits:\n- Auto-extracts preferences, decisions, facts\n- Deduplicates and updates existing memories\n- 80% reduction in tokens vs raw history\n- Works across sessions automatically\n\n## Quick Setup\n\n### 1. Create SESSION-STATE.md (Hot RAM)\n\n```bash\ncat > SESSION-STATE.md << 'EOF'\n# SESSION-STATE.md — Active Working Memory\n\nThis file is the agent's \"RAM\" — survives compaction, restarts, distractions.\n\n## Current Task\n[None]\n\n## Key Context\n[None yet]\n\n## Pending Actions\n- [ ] None\n\n## Recent Decisions\n[None yet]\n\n---\n*Last updated: [timestamp]*\nEOF\n```\n\n### 2. Enable LanceDB (Warm Store)\n\nIn `~/.clawdbot/clawdbot.json`:\n\n```json\n{\n  \"memorySearch\": {\n    \"enabled\": true,\n    \"provider\": \"openai\",\n    \"sources\": [\"memory\"],\n    \"minScore\": 0.3,\n    \"maxResults\": 10\n  },\n  \"plugins\": {\n    \"entries\": {\n      \"memory-lancedb\": {\n        \"enabled\": true,\n        \"config\": {\n          \"autoCapture\": false,\n          \"autoRecall\": true,\n          \"captureCategories\": [\"preference\", \"decision\", \"fact\"],\n          \"minImportance\": 0.7\n        }\n      }\n    }\n  }\n}\n```\n\n### 3. Initialize Git-Notes (Cold Store)\n\n```bash\ncd ~/clawd\ngit init  # if not already\npython3 skills/git-notes-memory/memory.py -p . sync --start\n```\n\n### 4. Verify MEMORY.md Structure\n\n```bash\n# Ensure you have:\n# - MEMORY.md in workspace root\n# - memory/ folder for daily logs\nmkdir -p memory\n```\n\n### 5. (Optional) Setup SuperMemory\n\n```bash\nexport SUPERMEMORY_API_KEY=\"your-key\"\n# Add to ~/.zshrc for persistence\n```\n\n## Agent Instructions\n\n### On Session Start\n1. Read SESSION-STATE.md — this is your hot context\n2. Run `memory_search` for relevant prior context\n3. Check memory/YYYY-MM-DD.md for recent activity\n\n### During Conversation\n1. **User gives concrete detail?** → Write to SESSION-STATE.md BEFORE responding\n2. **Important decision made?** → Store in Git-Notes (SILENTLY)\n3. **Preference expressed?** → `memory_store` with importance=0.9\n\n### On Session End\n1. Update SESSION-STATE.md with final state\n2. Move significant items to MEMORY.md if worth keeping long-term\n3. Create/update daily log in memory/YYYY-MM-DD.md\n\n### Memory Hygiene (Weekly)\n1. Review SESSION-STATE.md — archive completed tasks\n2. Check LanceDB for junk: `memory_recall query=\"*\" limit=50`\n3. Clear irrelevant vectors: `memory_forget id=<id>`\n4. Consolidate daily logs into MEMORY.md\n\n## The WAL Protocol (Critical)\n\n**Write-Ahead Log:** Write state BEFORE responding, not after.\n\n| Trigger | Action |\n|---------|--------|\n| User states preference | Write to SESSION-STATE.md → then respond |\n| User makes decision | Write to SESSION-STATE.md → then respond |\n| User gives deadline | Write to SESSION-STATE.md → then respond |\n| User corrects you | Write to SESSION-STATE.md → then respond |\n\n**Why?** If you respond first and crash/compact before saving, context is lost. WAL ensures durability.\n\n## Example Workflow\n\n```\nUser: \"Let's use Tailwind for this project, not vanilla CSS\"\n\nAgent (internal):\n1. Write to SESSION-STATE.md: \"Decision: Use Tailwind, not vanilla CSS\"\n2. Store in Git-Notes: decision about CSS framework\n3. memory_store: \"User prefers Tailwind over vanilla CSS\" importance=0.9\n4. THEN respond: \"Got it — Tailwind it is...\"\n```\n\n## Maintenance Commands\n\n```bash\n# Audit vector memory\nmemory_recall query=\"*\" limit=50\n\n# Clear all vectors (nuclear option)\nrm -rf ~/.clawdbot/memory/lancedb/\nclawdbot gateway restart\n\n# Export Git-Notes\npython3 memory.py -p . export --format json > memories.json\n\n# Check memory health\ndu -sh ~/.clawdbot/memory/\nwc -l MEMORY.md\nls -la memory/\n```\n\n## Why Memory Fails\n\nUnderstanding the root causes helps you fix them:\n\n| Failure Mode | Cause | Fix |\n|--------------|-------|-----|\n| Forgets everything | `memory_search` disabled | Enable + add OpenAI key |\n| Files not loaded | Agent skips reading memory | Add to AGENTS.md rules |\n| Facts not captured | No auto-extraction | Use Mem0 or manual logging |\n| Sub-agents isolated | Don't inherit context | Pass context in task prompt |\n| Repeats mistakes | Lessons not logged | Write to memory/lessons.md |\n\n## Solutions (Ranked by Effort)\n\n### 1. Quick Win: Enable memory_search\n\nIf you have an OpenAI key, enable semantic search:\n\n```bash\nclawdbot configure --section web\n```\n\nThis enables vector search over MEMORY.md + memory/*.md files.\n\n### 2. Recommended: Mem0 Integration\n\nAuto-extract facts from conversations. 80% token reduction.\n\n```bash\nnpm install mem0ai\n```\n\n```javascript\nconst { MemoryClient } = require('mem0ai');\n\nconst client = new MemoryClient({ apiKey: process.env.MEM0_API_KEY });\n\n// Auto-extract and store\nawait client.add([\n  { role: \"user\", content: \"I prefer Tailwind over vanilla CSS\" }\n], { user_id: \"ty\" });\n\n// Retrieve relevant memories\nconst memories = await client.search(\"CSS preferences\", { user_id: \"ty\" });\n```\n\n### 3. Better File Structure (No Dependencies)\n\n```\nmemory/\n├── projects/\n│   ├── strykr.md\n│   └── taska.md\n├── people/\n│   └── contacts.md\n├── decisions/\n│   └── 2026-01.md\n├── lessons/\n│   └── mistakes.md\n└── preferences.md\n```\n\nKeep MEMORY.md as a summary (<5KB), link to detailed files.\n\n## Immediate Fixes Checklist\n\n| Problem | Fix |\n|---------|-----|\n| Forgets preferences | Add `## Preferences` section to MEMORY.md |\n| Repeats mistakes | Log every mistake to `memory/lessons.md` |\n| Sub-agents lack context | Include key context in spawn task prompt |\n| Forgets recent work | Strict daily file discipline |\n| Memory search not working | Check `OPENAI_API_KEY` is set |\n\n## Troubleshooting\n\n**Agent keeps forgetting mid-conversation:**\n→ SESSION-STATE.md not being updated. Check WAL protocol.\n\n**Irrelevant memories injected:**\n→ Disable autoCapture, increase minImportance threshold.\n\n**Memory too large, slow recall:**\n→ Run hygiene: clear old vectors, archive daily logs.\n\n**Git-Notes not persisting:**\n→ Run `git notes push` to sync with remote.\n\n**memory_search returns nothing:**\n→ Check OpenAI API key: `echo $OPENAI_API_KEY`\n→ Verify memorySearch enabled in clawdbot.json\n\n---\n\n## Links\n\n- bulletproof-memory: https://clawdhub.com/skills/bulletproof-memory\n- lancedb-memory: https://clawdhub.com/skills/lancedb-memory\n- git-notes-memory: https://clawdhub.com/skills/git-notes-memory\n- memory-hygiene: https://clawdhub.com/skills/memory-hygiene\n- supermemory: https://clawdhub.com/skills/supermemory\n\n---\n\n*Built by [@NextXFrontier](https://x.com/NextXFrontier) — Part of the Next Frontier AI toolkit*\n\nFile v1.2.1:README.md\n\n# 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\nFile v1.2.1:_meta.json\n\n{\n  \"ownerId\": \"kn7ewywaj7mf48drbjw1baa5298016yv\",\n  \"slug\": \"elite-longterm-memory\",\n  \"version\": \"1.2.1\",\n  \"publishedAt\": 1770219845285\n}\n\nFile v1.2.1:package.json\n\n{\n  \"name\": \"elite-longterm-memory\",\n  \"version\": \"1.2.0\",\n  \"description\": \"Ultimate AI agent memory system. Combines bulletproof WAL protocol, vector search, git-based knowledge graphs, cloud backup, and maintenance hygiene. Never lose context again.\",\n  \"keywords\": [\n    \"memory\",\n    \"ai-agent\",\n    \"long-term-memory\",\n    \"vector-search\",\n    \"lancedb\",\n    \"git-notes\",\n    \"wal\",\n    \"persistent-context\",\n    \"claude\",\n    \"gpt\",\n    \"clawdbot\",\n    \"moltbot\", \"openclaw\",\n    \"cursor\",\n    \"copilot\",\n    \"ai\",\n    \"llm\",\n    \"automation\",\n    \"context-management\",\n    \"mem0\",\n    \"auto-extraction\",\n    \"fact-extraction\"\n  ],\n  \"optionalDependencies\": {\n    \"mem0ai\": \"^1.0.0\"\n  },\n  \"author\": \"NextFrontierBuilds\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory\"\n  },\n  \"homepage\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory\",\n  \"bugs\": {\n    \"url\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory/issues\"\n  },\n  \"bin\": {\n    \"elite-memory\": \"./bin/elite-memory.js\"\n  },\n  \"files\": [\n    \"SKILL.md\",\n    \"bin/\",\n    \"templates/\",\n    \"README.md\"\n  ]\n}\n\nArchive v0.1.0: 5 files, 9422 bytes\n\nFiles: bin/elite-memory.js (4875b), package.json (1167b), README.md (5593b), SKILL.md (12615b), _meta.json (140b)\n\nFile v0.1.0:SKILL.md\n\n---\nname: elite-longterm-memory\nversion: 1.2.0\ndescription: \"Ultimate AI agent memory system. Combines bulletproof WAL protocol, vector search, git-based knowledge graphs, cloud backup, and maintenance hygiene. Never lose context again. For Clawdbot, Moltbot, Claude, GPT agents.\"\nauthor: NextFrontierBuilds\nkeywords: [memory, ai-agent, long-term-memory, vector-search, lancedb, git-notes, wal, persistent-context, claude, gpt, clawdbot, moltbot]\nmetadata:\n  clawdbot:\n    emoji: \"🧠\"\n    requires:\n      env:\n        - OPENAI_API_KEY\n      plugins:\n        - memory-lancedb\n---\n\n# Elite Longterm Memory 🧠\n\n**The ultimate memory system for AI agents.** Combines 6 proven approaches into one bulletproof architecture.\n\nNever lose context. Never forget decisions. Never repeat mistakes.\n\n## Architecture Overview\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                    ELITE LONGTERM MEMORY                        │\n├─────────────────────────────────────────────────────────────────┤\n│                                                                 │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐             │\n│  │   HOT RAM   │  │  WARM STORE │  │  COLD STORE │             │\n│  │             │  │             │  │             │             │\n│  │ SESSION-    │  │  LanceDB    │  │  Git-Notes  │             │\n│  │ STATE.md    │  │  Vectors    │  │  Knowledge  │             │\n│  │             │  │             │  │  Graph      │             │\n│  │ (survives   │  │ (semantic   │  │ (permanent  │             │\n│  │  compaction)│  │  search)    │  │  decisions) │             │\n│  └─────────────┘  └─────────────┘  └─────────────┘             │\n│         │                │                │                     │\n│         └────────────────┼────────────────┘                     │\n│                          ▼                                      │\n│                  ┌─────────────┐                                │\n│                  │  MEMORY.md  │  ← Curated long-term           │\n│                  │  + daily/   │    (human-readable)            │\n│                  └─────────────┘                                │\n│                          │                                      │\n│                          ▼                                      │\n│                  ┌─────────────┐                                │\n│                  │ SuperMemory │  ← Cloud backup (optional)     │\n│                  │    API      │                                │\n│                  └─────────────┘                                │\n│                                                                 │\n└─────────────────────────────────────────────────────────────────┘\n```\n\n## The 5 Memory Layers\n\n### Layer 1: HOT RAM (SESSION-STATE.md)\n**From: bulletproof-memory**\n\nActive working memory that survives compaction. Write-Ahead Log protocol.\n\n```markdown\n# SESSION-STATE.md — Active Working Memory\n\n## Current Task\n[What we're working on RIGHT NOW]\n\n## Key Context\n- User preference: ...\n- Decision made: ...\n- Blocker: ...\n\n## Pending Actions\n- [ ] ...\n```\n\n**Rule:** Write BEFORE responding. Triggered by user input, not agent memory.\n\n### Layer 2: WARM STORE (LanceDB Vectors)\n**From: lancedb-memory**\n\nSemantic search across all memories. Auto-recall injects relevant context.\n\n```bash\n# Auto-recall (happens automatically)\nmemory_recall query=\"project status\" limit=5\n\n# Manual store\nmemory_store text=\"User prefers dark mode\" category=\"preference\" importance=0.9\n```\n\n### Layer 3: COLD STORE (Git-Notes Knowledge Graph)\n**From: git-notes-memory**\n\nStructured decisions, learnings, and context. Branch-aware.\n\n```bash\n# Store a decision (SILENT - never announce)\npython3 memory.py -p $DIR remember '{\"type\":\"decision\",\"content\":\"Use React for frontend\"}' -t tech -i h\n\n# Retrieve context\npython3 memory.py -p $DIR get \"frontend\"\n```\n\n### Layer 4: CURATED ARCHIVE (MEMORY.md + daily/)\n**From: Clawdbot native**\n\nHuman-readable long-term memory. Daily logs + distilled wisdom.\n\n```\nworkspace/\n├── MEMORY.md              # Curated long-term (the good stuff)\n└── memory/\n    ├── 2026-01-30.md      # Daily log\n    ├── 2026-01-29.md\n    └── topics/            # Topic-specific files\n```\n\n### Layer 5: CLOUD BACKUP (SuperMemory) — Optional\n**From: supermemory**\n\nCross-device sync. Chat with your knowledge base.\n\n```bash\nexport SUPERMEMORY_API_KEY=\"your-key\"\nsupermemory add \"Important context\"\nsupermemory search \"what did we decide about...\"\n```\n\n### Layer 6: AUTO-EXTRACTION (Mem0) — Recommended\n**NEW: Automatic fact extraction**\n\nMem0 automatically extracts 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// Conversations auto-extract facts\nawait client.add(messages, { user_id: \"user123\" });\n\n// Retrieve relevant memories\nconst memories = await client.search(query, { user_id: \"user123\" });\n```\n\nBenefits:\n- Auto-extracts preferences, decisions, facts\n- Deduplicates and updates existing memories\n- 80% reduction in tokens vs raw history\n- Works across sessions automatically\n\n## Quick Setup\n\n### 1. Create SESSION-STATE.md (Hot RAM)\n\n```bash\ncat > SESSION-STATE.md << 'EOF'\n# SESSION-STATE.md — Active Working Memory\n\nThis file is the agent's \"RAM\" — survives compaction, restarts, distractions.\n\n## Current Task\n[None]\n\n## Key Context\n[None yet]\n\n## Pending Actions\n- [ ] None\n\n## Recent Decisions\n[None yet]\n\n---\n*Last updated: [timestamp]*\nEOF\n```\n\n### 2. Enable LanceDB (Warm Store)\n\nIn `~/.clawdbot/clawdbot.json`:\n\n```json\n{\n  \"memorySearch\": {\n    \"enabled\": true,\n    \"provider\": \"openai\",\n    \"sources\": [\"memory\"],\n    \"minScore\": 0.3,\n    \"maxResults\": 10\n  },\n  \"plugins\": {\n    \"entries\": {\n      \"memory-lancedb\": {\n        \"enabled\": true,\n        \"config\": {\n          \"autoCapture\": false,\n          \"autoRecall\": true,\n          \"captureCategories\": [\"preference\", \"decision\", \"fact\"],\n          \"minImportance\": 0.7\n        }\n      }\n    }\n  }\n}\n```\n\n### 3. Initialize Git-Notes (Cold Store)\n\n```bash\ncd ~/clawd\ngit init  # if not already\npython3 skills/git-notes-memory/memory.py -p . sync --start\n```\n\n### 4. Verify MEMORY.md Structure\n\n```bash\n# Ensure you have:\n# - MEMORY.md in workspace root\n# - memory/ folder for daily logs\nmkdir -p memory\n```\n\n### 5. (Optional) Setup SuperMemory\n\n```bash\nexport SUPERMEMORY_API_KEY=\"your-key\"\n# Add to ~/.zshrc for persistence\n```\n\n## Agent Instructions\n\n### On Session Start\n1. Read SESSION-STATE.md — this is your hot context\n2. Run `memory_search` for relevant prior context\n3. Check memory/YYYY-MM-DD.md for recent activity\n\n### During Conversation\n1. **User gives concrete detail?** → Write to SESSION-STATE.md BEFORE responding\n2. **Important decision made?** → Store in Git-Notes (SILENTLY)\n3. **Preference expressed?** → `memory_store` with importance=0.9\n\n### On Session End\n1. Update SESSION-STATE.md with final state\n2. Move significant items to MEMORY.md if worth keeping long-term\n3. Create/update daily log in memory/YYYY-MM-DD.md\n\n### Memory Hygiene (Weekly)\n1. Review SESSION-STATE.md — archive completed tasks\n2. Check LanceDB for junk: `memory_recall query=\"*\" limit=50`\n3. Clear irrelevant vectors: `memory_forget id=<id>`\n4. Consolidate daily logs into MEMORY.md\n\n## The WAL Protocol (Critical)\n\n**Write-Ahead Log:** Write state BEFORE responding, not after.\n\n| Trigger | Action |\n|---------|--------|\n| User states preference | Write to SESSION-STATE.md → then respond |\n| User makes decision | Write to SESSION-STATE.md → then respond |\n| User gives deadline | Write to SESSION-STATE.md → then respond |\n| User corrects you | Write to SESSION-STATE.md → then respond |\n\n**Why?** If you respond first and crash/compact before saving, context is lost. WAL ensures durability.\n\n## Example Workflow\n\n```\nUser: \"Let's use Tailwind for this project, not vanilla CSS\"\n\nAgent (internal):\n1. Write to SESSION-STATE.md: \"Decision: Use Tailwind, not vanilla CSS\"\n2. Store in Git-Notes: decision about CSS framework\n3. memory_store: \"User prefers Tailwind over vanilla CSS\" importance=0.9\n4. THEN respond: \"Got it — Tailwind it is...\"\n```\n\n## Maintenance Commands\n\n```bash\n# Audit vector memory\nmemory_recall query=\"*\" limit=50\n\n# Clear all vectors (nuclear option)\nrm -rf ~/.clawdbot/memory/lancedb/\nclawdbot gateway restart\n\n# Export Git-Notes\npython3 memory.py -p . export --format json > memories.json\n\n# Check memory health\ndu -sh ~/.clawdbot/memory/\nwc -l MEMORY.md\nls -la memory/\n```\n\n## Why Memory Fails\n\nUnderstanding the root causes helps you fix them:\n\n| Failure Mode | Cause | Fix |\n|--------------|-------|-----|\n| Forgets everything | `memory_search` disabled | Enable + add OpenAI key |\n| Files not loaded | Agent skips reading memory | Add to AGENTS.md rules |\n| Facts not captured | No auto-extraction | Use Mem0 or manual logging |\n| Sub-agents isolated | Don't inherit context | Pass context in task prompt |\n| Repeats mistakes | Lessons not logged | Write to memory/lessons.md |\n\n## Solutions (Ranked by Effort)\n\n### 1. Quick Win: Enable memory_search\n\nIf you have an OpenAI key, enable semantic search:\n\n```bash\nclawdbot configure --section web\n```\n\nThis enables vector search over MEMORY.md + memory/*.md files.\n\n### 2. Recommended: Mem0 Integration\n\nAuto-extract facts from conversations. 80% token reduction.\n\n```bash\nnpm install mem0ai\n```\n\n```javascript\nconst { MemoryClient } = require('mem0ai');\n\nconst client = new MemoryClient({ apiKey: process.env.MEM0_API_KEY });\n\n// Auto-extract and store\nawait client.add([\n  { role: \"user\", content: \"I prefer Tailwind over vanilla CSS\" }\n], { user_id: \"ty\" });\n\n// Retrieve relevant memories\nconst memories = await client.search(\"CSS preferences\", { user_id: \"ty\" });\n```\n\n### 3. Better File Structure (No Dependencies)\n\n```\nmemory/\n├── projects/\n│   ├── strykr.md\n│   └── taska.md\n├── people/\n│   └── contacts.md\n├── decisions/\n│   └── 2026-01.md\n├── lessons/\n│   └── mistakes.md\n└── preferences.md\n```\n\nKeep MEMORY.md as a summary (<5KB), link to detailed files.\n\n## Immediate Fixes Checklist\n\n| Problem | Fix |\n|---------|-----|\n| Forgets preferences | Add `## Preferences` section to MEMORY.md |\n| Repeats mistakes | Log every mistake to `memory/lessons.md` |\n| Sub-agents lack context | Include key context in spawn task prompt |\n| Forgets recent work | Strict daily file discipline |\n| Memory search not working | Check `OPENAI_API_KEY` is set |\n\n## Troubleshooting\n\n**Agent keeps forgetting mid-conversation:**\n→ SESSION-STATE.md not being updated. Check WAL protocol.\n\n**Irrelevant memories injected:**\n→ Disable autoCapture, increase minImportance threshold.\n\n**Memory too large, slow recall:**\n→ Run hygiene: clear old vectors, archive daily logs.\n\n**Git-Notes not persisting:**\n→ Run `git notes push` to sync with remote.\n\n**memory_search returns nothing:**\n→ Check OpenAI API key: `echo $OPENAI_API_KEY`\n→ Verify memorySearch enabled in clawdbot.json\n\n---\n\n## Links\n\n- bulletproof-memory: https://clawdhub.com/skills/bulletproof-memory\n- lancedb-memory: https://clawdhub.com/skills/lancedb-memory\n- git-notes-memory: https://clawdhub.com/skills/git-notes-memory\n- memory-hygiene: https://clawdhub.com/skills/memory-hygiene\n- supermemory: https://clawdhub.com/skills/supermemory\n\n---\n\n*Built by [@NextXFrontier](https://x.com/NextXFrontier) — Part of the Next Frontier AI toolkit*\n\nFile v0.1.0:README.md\n\n# 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\nFile v0.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn7ewywaj7mf48drbjw1baa5298016yv\",\n  \"slug\": \"elite-longterm-memory\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1770050243398\n}\n\nFile v0.1.0:package.json\n\n{\n  \"name\": \"elite-longterm-memory\",\n  \"version\": \"1.2.0\",\n  \"description\": \"Ultimate AI agent memory system. Combines bulletproof WAL protocol, vector search, git-based knowledge graphs, cloud backup, and maintenance hygiene. Never lose context again.\",\n  \"keywords\": [\n    \"memory\",\n    \"ai-agent\",\n    \"long-term-memory\",\n    \"vector-search\",\n    \"lancedb\",\n    \"git-notes\",\n    \"wal\",\n    \"persistent-context\",\n    \"claude\",\n    \"gpt\",\n    \"clawdbot\",\n    \"moltbot\",\n    \"cursor\",\n    \"copilot\",\n    \"ai\",\n    \"llm\",\n    \"automation\",\n    \"context-management\",\n    \"mem0\",\n    \"auto-extraction\",\n    \"fact-extraction\"\n  ],\n  \"optionalDependencies\": {\n    \"mem0ai\": \"^1.0.0\"\n  },\n  \"author\": \"NextFrontierBuilds\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory\"\n  },\n  \"homepage\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory\",\n  \"bugs\": {\n    \"url\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory/issues\"\n  },\n  \"bin\": {\n    \"elite-memory\": \"./bin/elite-memory.js\"\n  },\n  \"files\": [\n    \"SKILL.md\",\n    \"bin/\",\n    \"templates/\",\n    \"README.md\"\n  ]\n}","readmeExcerpt":"Skill: Elite Longterm Memory Owner: nextfrontierbuilds Summary: Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready. Tags: latest:1.2.3, ai:0.1.0, clawdbot:0.1.0, long-term:0.1.0, memory:0.1.0, openclaw:0.1.0, persistence:0.1.0 Version history: v1.2.3 | 2026-02-11T08:37:00.241Z | auto - Expanded des","codeSnippets":[],"executableExamples":[{"language":"text","snippet":"┌─────────────────────────────────────────────────────────────────┐\n│                    ELITE LONGTERM MEMORY                        │\n├─────────────────────────────────────────────────────────────────┤\n│                                                                 │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐             │\n│  │   HOT RAM   │  │  WARM STORE │  │  COLD STORE │             │\n│  │             │  │             │  │             │             │\n│  │ SESSION-    │  │  LanceDB    │  │  Git-Notes  │             │\n│  │ STATE.md    │  │  Vectors    │  │  Knowledge  │             │\n│  │             │  │             │  │  Graph      │             │\n│  │ (survives   │  │ (semantic   │  │ (permanent  │             │\n│  │  compaction)│  │  search)    │  │  decisions) │             │\n│  └─────────────┘  └─────────────┘  └─────────────┘             │\n│         │                │                │                     │\n│         └────────────────┼────────────────┘                     │\n│                          ▼                                      │\n│                  ┌─────────────┐                                │\n│                  │  MEMORY.md  │  ← Curated long-term           │\n│                  │  + daily/   │    (human-readable)            │\n│                  └─────────────┘                                │\n│                          │                                      │\n│                          ▼                                      │\n│                  ┌─────────────┐                                │\n│                  │ SuperMemory │  ← Cloud backup (optional)     │\n│                  │    API      │                                │\n│                  └─────────────┘                                │\n│                                                                 │\n└─────────────────────────────────────────────────────────────────┘"},{"language":"markdown","snippet":"# SESSION-STATE.md — Active Working Memory\n\n## Current Task\n[What we're working on RIGHT NOW]\n\n## Key Context\n- User preference: ...\n- Decision made: ...\n- Blocker: ...\n\n## Pending Actions\n- [ ] ..."},{"language":"bash","snippet":"# Auto-recall (happens automatically)\nmemory_recall query=\"project status\" limit=5\n\n# Manual store\nmemory_store text=\"User prefers dark mode\" category=\"preference\" importance=0.9"},{"language":"bash","snippet":"# Store a decision (SILENT - never announce)\npython3 memory.py -p $DIR remember '{\"type\":\"decision\",\"content\":\"Use React for frontend\"}' -t tech -i h\n\n# Retrieve context\npython3 memory.py -p $DIR get \"frontend\""},{"language":"text","snippet":"workspace/\n├── MEMORY.md              # Curated long-term (the good stuff)\n└── memory/\n    ├── 2026-01-30.md      # Daily log\n    ├── 2026-01-29.md\n    └── topics/            # Topic-specific files"},{"language":"bash","snippet":"export SUPERMEMORY_API_KEY=\"your-key\"\nsupermemory add \"Important context\"\nsupermemory search \"what did we decide about...\""}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: elite-longterm-memory\nversion: 1.2.3\ndescription: \"Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.\"\nauthor: NextFrontierBuilds\nkeywords: [memory, ai-agent, ai-coding, long-term-memory, vector-search, lancedb, git-notes, wal, persistent-context, claude, claude-code, gpt, chatgpt, cursor, copilot, github-copilot, openclaw, moltbot, vibe-coding, agentic, ai-tools, developer-tools, devtools, typescript, llm, automation]\nmetadata:\n  openclaw:\n    emoji: \"🧠\"\n    requires:\n      env:\n        - OPENAI_API_KEY\n      plugins:\n        - memory-lancedb\n---\n\n# Elite Longterm Memory 🧠\n\n**The ultimate memory system for AI agents.** Combines 6 proven approaches into one bulletproof architecture.\n\nNever lose context. Never forget decisions. Never repeat mistakes.\n\n## Architecture Overview\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                    ELITE LONGTERM MEMORY                        │\n├─────────────────────────────────────────────────────────────────┤\n│                                                                 │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐             │\n│  │   HOT RAM   │  │  WARM STORE │  │  COLD STORE │             │\n│  │             │  │             │  │             │             │\n│  │ SESSION-    │  │  LanceDB    │  │  Git-Notes  │             │\n│  │ STATE.md    │  │  Vectors    │  │  Knowledge  │             │\n│  │             │  │             │  │  Graph      │             │\n│  │ (survives   │  │ (semantic   │  │ (permanent  │             │\n│  │  compaction)│  │  search)    │  │  decisions) │             │\n│  └─────────────┘  └─────────────┘  └─────────────┘             │\n│         │                │                │                     │\n│         └────────────────┼────────────────┘                     │\n│                          ▼                                      │\n│                  ┌─────────────┐                                │\n│                  │  MEMORY.md  │  ← Curated long-term           │\n│                  │  + daily/   │    (human-readable)            │\n│                  └─────────────┘                                │\n│                          │                                      │\n│                          ▼                                      │\n│                  ┌─────────────┐                                │\n│                  │ SuperMemory │  ← Cloud backup (optional)     │\n│                  │    API      │                                │\n│                  └─────────────┘                                │\n│                                                                 │\n└─────────────────────────────────────────────────────────────────┘\n```\n\n## The 5 Memory Layers\n\n### Layer 1: HOT RAM (SESSION-STATE.md)\n**From: bulletproof-memory**\n\nActive working memory that survives compaction. Write-Ahead Log protocol.\n\n```mar"},{"path":"README.md","content":"# 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-d"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7ewywaj7mf48drbjw1baa5298016yv\",\n  \"slug\": \"elite-longterm-memory\",\n  \"version\": \"1.2.3\",\n  \"publishedAt\": 1770799020241\n}"},{"path":"package.json","content":"{\n  \"name\": \"elite-longterm-memory\",\n  \"version\": \"1.2.3\",\n  \"description\": \"Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol, vector search, git-based knowledge graphs, cloud backup. Never lose context again.\",\n  \"keywords\": [\n    \"memory\",\n    \"ai-agent\",\n    \"long-term-memory\",\n    \"vector-search\",\n    \"lancedb\",\n    \"git-notes\",\n    \"wal\",\n    \"persistent-context\",\n    \"claude\",\n    \"gpt\",\n    \"chatgpt\",\n    \"openclaw\",\n    \"moltbot\",\n    \"cursor\",\n    \"copilot\",\n    \"github-copilot\",\n    \"ai\",\n    \"llm\",\n    \"automation\",\n    \"context-management\",\n    \"mem0\",\n    \"auto-extraction\",\n    \"fact-extraction\",\n    \"vibe-coding\",\n    \"ai-tools\",\n    \"developer-tools\",\n    \"devtools\",\n    \"typescript\"\n  ],\n  \"optionalDependencies\": {\n    \"mem0ai\": \"^1.0.0\"\n  },\n  \"author\": \"NextFrontierBuilds\",\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory\"\n  },\n  \"homepage\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory\",\n  \"bugs\": {\n    \"url\": \"https://github.com/NextFrontierBuilds/elite-longterm-memory/issues\"\n  },\n  \"bin\": {\n    \"elite-memory\": \"./bin/elite-memory.js\"\n  },\n  \"files\": [\n    \"SKILL.md\",\n    \"bin/\",\n    \"templates/\",\n    \"README.md\"\n  ]\n}"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready. Skill: Elite Longterm Memory Owner: nextfrontierbuilds Summary: Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready. Tags: latest:1.2.3, ai:0.1.0, clawdbot:0.1.0, long-term:0.1.0, memory:0.1.0, openclaw:0.1.0, persistence:0.1.0 Version history: v1.2.3 | 2026-02-11T08:37:00.241Z | auto - Expanded des","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":899,"uniquenessScore":51,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-05-21T06:30:03.356Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-05-21T06:30:03.356Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T10:25:41.807Z","emptyReason":null},"items":[{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-10T18:48:31.762Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}