{
  "markdown": "# claude-memory-fts\n\nLong-term memory MCP server for [Claude Code](https://docs.anthropic.com/en/docs/claude-code). Stores facts in a local SQLite database with hybrid search (FTS5 + semantic vector similarity) and automatic context injection.\n\n## Features\n\n- **Hybrid search** — FTS5 keyword search + semantic vector similarity, merged via Reciprocal Rank Fusion (RRF)\n- **Semantic understanding** — find memories by meaning, not just keywords (powered by all-MiniLM-L6-v2 embeddings)\n- **Auto context injection** — top 30 most important memories injected into every prompt via hook\n- **Importance ranking** — facts ranked by access frequency, recency decay, and category weight\n- **Access tracking** — tracks how often each memory is accessed\n- **Upsert** — automatically updates existing facts instead of duplicating\n- **Categorized** — organize by type: preference, decision, technical, project, workflow, personal, general\n- **MCP Resources** — exposes `memory://context` resource for session context\n- **Zero config** — works out of the box, stores data in `~/.claude/memory.db`\n\n## Install\n\n```bash\n# Add to Claude Code\nclaude mcp add memory -- npx claude-memory-fts\n\n# Auto-configure context injection hook (recommended)\nnpx claude-memory-fts --setup-hook\n```\n\nThe `--setup-hook` command automatically:\n1. Creates `~/.claude/scripts/memory-context.sh`\n2. Adds a `UserPromptSubmit` hook to `~/.claude/settings.json`\n3. Top 30 memories are injected into every prompt automatically\n\n## CLI Commands\n\n| Command | Description |\n|---|---|\n| `npx claude-memory-fts` | Start MCP server (used by Claude Code) |\n| `npx claude-memory-fts --context` | Output top 30 facts (used by hook script) |\n| `npx claude-memory-fts --setup-hook` | Auto-configure context injection hook |\n\n## Configuration\n\n| Environment Variable | Default | Description |\n|---|---|---|\n| `MEMORY_DB_PATH` | `~/.claude/memory.db` | Path to the SQLite database file |\n\nExample with custom path:\n\n```bash\nclaude mcp add memory -e MEMORY_DB_PATH=/path/to/my/memory.db -- npx claude-memory-fts\n```\n\n## Tools\n\n### `memory_save`\n\nSave a fact to long-term memory.\n\n| Parameter | Type | Required | Description |\n|---|---|---|---|\n| `fact` | string | yes | The information to remember |\n| `category` | string | no | One of: `preference`, `decision`, `personal`, `technical`, `project`, `workflow`, `general` |\n\n### `memory_search`\n\nHybrid search: runs FTS5 and semantic search in parallel, merges results with RRF. Falls back to LIKE for partial matches.\n\n| Parameter | Type | Required | Description |\n|---|---|---|---|\n| `keyword` | string | yes | Search keyword or phrase |\n| `limit` | number | no | Max results (default: 10) |\n\n### `memory_update`\n\nUpdate a memory's content or category by ID.\n\n| Parameter | Type | Required | Description |\n|---|---|---|---|\n| `id` | number | yes | Memory ID |\n| `fact` | string | no | New content (omit to keep current) |\n| `category` | string | no | New category (omit to keep current) |\n\n### `memory_list`\n\nList all saved memories grouped by category.\n\n| Parameter | Type | Required | Description |\n|---|---|---|---|\n| `category` | string | no | Filter by category |\n| `limit` | number | no | Max results (default: 50) |\n\n### `memory_delete`\n\nDelete a memory by ID.\n\n| Parameter | Type | Required | Description |\n|---|---|---|---|\n| `id` | number | yes | Memory ID |\n\n## Resources\n\n### `memory://context`\n\nMCP resource exposing top 30 facts ranked by importance score:\n- **Access frequency** — frequently accessed facts score higher (capped at 20 points)\n- **Recency** — recently updated facts score higher (10 points, decays over 90 days)\n- **Category weight** — preference/decision (3), workflow/technical (2), project/personal (1), general (0)\n\n## How It Works\n\n### Search Pipeline\n\n1. **FTS5 + BM25** and **semantic vector similarity** run in parallel\n2. Results are merged and deduplicated using **Reciprocal Rank Fusion** (k=60)\n3. Facts appearing in both lists get naturally boosted\n4. If both return empty, falls back to **LIKE** substring matching\n5. Access count is tracked on every search hit\n\n### Embeddings\n\n- Model: [all-MiniLM-L6-v2](https://huggingface.co/Xenova/all-MiniLM-L6-v2) (384 dimensions, ~23MB)\n- Generated locally via `@xenova/transformers` — no API calls, no data leaves your machine\n- Embeddings are created on save and backfilled on server startup\n- Cosine similarity with 0.3 threshold to filter noise\n\n### Storage\n\n- SQLite with WAL mode for fast concurrent reads/writes\n- FTS5 virtual table synced via triggers for real-time full-text indexing\n- Embeddings stored as BLOB columns alongside facts\n\n## Development\n\n```bash\ngit clone https://github.com/kurovu146/claude-memory-mcp.git\ncd claude-memory-mcp\nnpm install\nnpm run build\nnpm test\n```\n\n## License\n\nMIT\n",
  "bytes": 4791,
  "sha": "0524d544f626d8fa6e1582354d7ad759cc4ad68c10591adfd36b75fcb197c5f8",
  "repo_slug": "kurovu146/claude-memory-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_kurovu146_memory_fts_ed3e77ab/readme"
}