# Local Memory [Health: Active]

**Category:** 🗄️ Databases  
**Repository:** https://github.com/studiomeyer-io/local-memory-mcp  
**GitHub Stars:** 15  
**npm Downloads (last month):** 900  
**Views:** 17  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/local-memory

## Description
Persistent local AI memory. SQLite + FTS5 + vector search, knowledge graph. No cloud, no API keys.

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

```json
"mcpServers": {
  "local-memory": {
    "command": "npx",
    "args": ["-y","@studiomeyer/local-memory-mcp"],
    "env": {
      "MEMORY_EMBED_DISABLED": "",
      "MEMORY_EMBED_MODEL": "",
      "MEMORY_EMBED_CACHE_DIR": "",
      "MEMORY_EMBED_DTYPE": ""
    }
  }
}
```

**Requires environment variables:** `MEMORY_EMBED_DISABLED`, `MEMORY_EMBED_MODEL`, `MEMORY_EMBED_CACHE_DIR`, `MEMORY_EMBED_DTYPE` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Local Memory does

Local Memory stores assistant memory on the machine that runs the MCP process. Learnings, decisions, mistakes, people, projects, tools, and related observations are kept in a SQLite database, giving an agent context that can persist between conversations.

The package combines several memory features in one local store:

- FTS5 full-text search with BM25 ranking
- Local vector embeddings and cosine retrieval
- Reciprocal Rank Fusion for hybrid search
- Duplicate detection before new information is stored
- A knowledge graph built from entities and observations
- Session start and end tracking
- Valid-time queries for viewing an entity as it was known on a chosen date
- JSON export and import for portability

No cloud service or API key is needed. The embedding model runs locally through Transformers.js.

## How it works

Each stored learning, decision, or entity observation can be embedded into a 384-dimensional vector. The default model is `Xenova/multilingual-e5-small`, which is downloaded to a local Transformers.js cache, quantized by default, and executed on the CPU. Entity records themselves are not embedded; their observations provide the searchable semantic content.

`memory_search` uses hybrid retrieval by default. It combines FTS5/BM25 results with vector cosine results using Reciprocal Rank Fusion with `k=60`. Searches can instead use keyword-only or vector-only retrieval. If the SQLite vector extension cannot load, the server falls back to FTS5 search.

Entity observations can carry validity windows. Opening an entity with an `asOf` date returns observations whose `valid_from` and `valid_to` cover that date; without a date, the tool returns the live view. This is valid-time history rather than a separate transaction-time audit axis.

## Setup and configuration

The published npm package runs through `npx` and requires Node.js 22 for the documented Claude Desktop setup. Example client configurations use the command `npx -y @studiomeyer/local-memory-mcp`.

Claude Code can register it with:

```bash
claude mcp add memory -- npx -y @studiomeyer/local-memory-mcp
```

Claude Desktop, Cursor, VS Code, and Codex use their respective MCP configuration files with the same command and package arguments. For Claude Code, adding instructions to call `memory_session_start` at conversation start and `memory_session_end` at completion enables session tracking; a Claude Code `SessionStart` hook can apply the reminder system-wide.

Embedding behavior can be adjusted with these environment variables:

- `MEMORY_EMBED_DISABLED=1` forces FTS5-only retrieval.
- `MEMORY_EMBED_MODEL` selects another Transformers.js feature-extraction model.
- `MEMORY_EMBED_CACHE_DIR` changes the model cache location.
- `MEMORY_EMBED_DTYPE` selects `fp32`, `fp16`, `q8`, or `q4` quantization.

## Tools and capabilities

The package exposes 25 MCP tools. Named tools include:

- `memory_learn` for recording patterns, insights, and mistakes
- `memory_search` for hybrid, FTS5, or vector retrieval
- `memory_entity_observe` for adding facts about entities
- `memory_entity_open` for reading an entity and optionally applying an `asOf` date
- `memory_session_start` and `memory_session_end` for conversation lifecycle tracking

The storage model supports entity relationships, duplicate prevention, fact supersession, lifecycle states, archival, validity intervals, and portable JSON export/import. Hybrid retrieval can bridge different wording and can return relevant material even without exact token overlap. Multilingual embeddings allow queries and stored content to use different supported languages.

## Limitations and notes

Vector retrieval depends on loading the SQLite vector extension and the local embedding model. When vector support is unavailable, keyword search remains available but semantic retrieval is lost. Embedding is CPU-based and the model cache is approximately 30 MB with the default q8 setting.

The default model is multilingual, but its documented strong retrieval coverage is German, English, and Spanish within a broader set of more than 100 languages. Valid-time queries are designed for questions about what the system knew at a date; transaction time is retained in `created_at` but is not exposed as a separate query axis.

The database is local and portable through JSON export/import. Its local-first design suits private memory and offline or air-gapped use, while the optional embedding model can be disabled for environments where model loading is not wanted.

_Full upstream README: https://allmcps.com/mcp/local-memory/readme_

