# nan-forget [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/NaNMesh/nan-forget  
**GitHub Stars:** 5  
**npm Downloads (last month):** 371  
**Views:** 4  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/nan-forget

## Description
Long-term memory for AI coding tools via vector search (Qdrant).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "nan-forget": {
    "command": "npx",
    "args": ["-y","nan-forget"]
  }
}
```

## Documentation

## What the nan-forget MCP server does

The nan-forget MCP server stores information learned during AI-assisted coding and makes it available after a session ends. Memories include project facts, technical decisions, preferences, and other context that an agent may need later. Data is kept in a local SQLite database at `~/.nan-forget/memories.db`, with sqlite-vec providing vector-based retrieval.

Memory is shared across supported workflows, so information saved while using Claude can be searched from Codex or Cursor. The system also separates short-lived Markdown context from persistent memory: session-oriented `.md` files can be intercepted and added to the database for later retrieval.

## How it works

Claude Code can use three hooks to automate memory handling. A prompt submission triggers a recall search, a post-tool hook watches Markdown writes, and a session-end hook scans the transcript for decisions or facts that were not saved. The `memory_sync` operation performs a lightweight session handshake, while search and save operations handle retrieval and persistence.

Retrieval has multiple stages. Initial vector matching identifies candidate summaries, a recall step fetches full entries and can expand across projects, and an association step searches for related memories. Results are ranked using similarity, memory age, access frequency, and confidence. Older related entries may be consolidated after every ten saves or after 24 hours; the system can summarize them when an OpenAI key is available or merge them deterministically without one.

## Setup and configuration

Run `npx nan-forget setup` to start the guided installation. The setup process installs or configures Ollama and embeddings, adds Claude hooks, writes MCP configuration, and creates a project-level `AGENTS.md` for Codex-style agents. Restart Claude Code or reopen Codex after setup.

The nan-forget MCP server runs locally and does not require an API key or Docker for its standard setup. To use non-Claude agents, start the local API with `nan-forget api`; `nan-forget prompt` prints instructions describing the available REST workflow. The API listens on `localhost:3456` according to the documented examples.

## Tools and capabilities

Documented MCP and workflow capabilities include:

- `memory_sync` for a health check, statistics, and project listing during session startup.
- `memory_search` for finding relevant stored context.
- `memory_save` for recording decisions, facts, and preferences.
- CLI commands including `add`, `search`, `stats`, `sync`, and `checkpoint`.
- REST endpoints for memory search, synchronization, and checkpoints.
- Slash commands for loading context, checking health, starting services, cleaning data, and forcing consolidation in Claude Code.

Agents using Codex-style instruction files can follow the generated `AGENTS.md` guidance. CLI and REST fallbacks cover workflows where Claude’s hook model is unavailable.

## Limitations and notes

Automatic behavior differs by client. Claude Code receives the documented hook-based recall and save flow, while Codex, Cursor, and similar tools generally rely on `AGENTS.md`, CLI commands, or the local REST API. The documented design uses one local SQLite database shared across projects and tools, so it is intended for local development rather than a hosted multi-user memory service.

Consolidation can archive original memories after creating a compacted entry.

_Full upstream README: https://allmcps.com/mcp/nan-forget/readme_

