Long-term memory for AI coding tools via vector search (Qdrant).
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag — we're steadily working through the catalog.
💡 Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Long-term memory for AI coding tools.
Your AI forgets everything when the session ends. NaN Forget fixes that.
That's it. The wizard installs Ollama, embeddings, Claude hooks, MCP config, and a project AGENTS.md for Codex-style agents. Restart Claude Code or reopen Codex. Your AI now remembers.
No API keys needed. No Docker needed. Runs locally. Free forever.
~/.nan-forget/memories.db. Aging memories get automatically compacted into long-term entries.You never call save or search manually. Here's what happens behind the scenes:
| Event | What fires | What happens |
|---|---|---|
| Session starts | memory_sync | Lightweight handshake — checks health, loads stats, lists projects. No heavy search. |
| You send a message | UserPromptSubmit hook | nan-forget recall auto-searches memory for relevant context and injects it into the conversation. |
| You discuss a topic | memory_search | Claude searches the DB dynamically whenever relevant context might exist — like how you recall things on-demand. |
| Claude learns something | memory_save | Claude saves decisions, preferences, and facts immediately. Tool descriptions tell Claude "you MUST call this." |
Claude writes a .md file | PostToolUse hook | memory-sync.js intercepts the write, parses frontmatter, and auto-saves it to SQLite via nan-forget add. |
| Session ends | SessionEnd hook | session-end.js scans the conversation transcript for unsaved decisions/facts and saves the top 5 to the DB. |
| Every 10 saves or 24h | Auto-consolidate | Aging memories get clustered and compacted into long-term entries. Originals are archived. |
Four layers of protection ensure nothing is lost:
Codex and similar agents work well with nan-forget, but they usually need instruction files or shell/API fallbacks instead of Claude's hook model:
npx nan-forget setupAGENTS.md in your repo. It tells Codex-style agents to sync, search, save, and checkpoint automatically.localhost:3456 or local commands like nan-forget sync, nan-forget search, nan-forget add, and nan-forget checkpoint.The REST API and CLI now mirror the important memory workflows closely enough that memories saved by Claude are searchable from Codex and vice versa.
Type these in Claude Code:
| Command | What it does |
|---|---|
/nan-forget | Load context from past sessions |
/nan-forget stats | Show memory health |
/nan-forget clean | Run garbage collection |
/nan-forget compact | Force memory consolidation |
/nan-forget health | Check if services are running |
/nan-forget start | Start all services |
Claude uses MCP. Codex can use AGENTS.md plus CLI/REST fallback:
Codex, Cursor, and Claude all share the same memory database.
Everything below is for developers who want to understand how nan-forget works under the hood.
LLMs have no memory between sessions. Every conversation starts from zero. You re-explain your stack, Claude contradicts decisions from last month, and context disappears when the session ends.
Existing solutions (Mem0) target app developers embedding memory into products. We target you — the developer using AI tools daily who wants AI that just remembers.
Short-term memory = Claude's built-in .md files. Disposable. Current session only.
Long-term memory = SQLite database with sqlite-vec vector search. Single file. Permanent. Searchable across all sessions, all projects, all LLM tools.
Three hooks handle memory automatically:
.md file writes and saves them to the DB.nan-forget recall on every user message, auto-searching memory for relevant context.Memory search follows the same path as human recall:
| Stage | What happens | Cost |
|---|---|---|
| Recognition (blur) | Prefetch 50 candidates, return top 5 summaries. Cheap. | 1 vector search |
| Recall (clarity) | Fetch full content. Expand search cross-project (no project filter). | N point lookups |
| Association | Centroid-based related-memory search over sqlite-vec. Spreading activation from positive IDs. | 1 vector search |
Scoring formula:
High-confidence memories (debate-validated, human-approved) decay much slower and rank higher. A core memory at 0.85 confidence decays at ~15% of normal rate — effectively permanent unless superseded. Cross-project search means auth decisions from Project A surface when you work on Project B.
Aging memories don't just get deleted — they get compacted into long-term entries:
Triggers automatically after every 10 saves or 24 hours. No user action needed.
| Tool | Purpose |
|---|---|
memory_sync | Lightweight session handshake: health check + stats + project list |
memory_save | Save a memory (auto-called by Claude, proactively) |
memory_search | Semantic search with 3-stage retrieval (depth 1-3) |
memory_get | Fetch a specific memory by ID |
memory_update | Change content, type, or tags |
memory_archive | Soft-delete (hidden from search, never truly deleted) |
memory_consolidate | Force consolidation of aging memories |
memory_clean | Garbage collection (decay, dedup, expiry, MEMORY.md sync) |
memory_stats | Memory health dashboard |
memory_health | Check if Ollama, REST API are running |
memory_start | Boot Ollama + REST API |
memory_checkpoint | Save full problem→solution context after completing a task |
memory_compress | Compress persisted .md memory files to minimal stubs |
memory_save accepts structured fields for richer vector representation:
Factual signals from GitHub, npm, and our automated checks — not a rating.
No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/nan-forget)<a href="https://allmcps.com/mcp/nan-forget"><img src="https://allmcps.com/api/badge/nan-forget?style=directory" alt="Nan Forget on AllMCPs" /></a>