data-ai MCP Server
Persistent long-term memory for Claude Code via MCP — captures coding decisions, bugfixes, and context across sessions. Hybrid FTS5 + TF-IDF search with episode batching. Single SQLite DB, no external services. Alternative to claude-mem with 600x lower cost.
Discovered via github-topic:mcp and last synced 1w ago.
1. Install the package
npx claude-mem-lite
2. Add to claude_desktop_config.json
{
"mcpServers": {
"claude-mem-lite": {
"command": "npx",
"args": [
"claude-mem-lite"
]
}
}
}Config file location: ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) / %APPDATA%\Claude\claude_desktop_config.json (Windows)
claude-mem-lite
CLI equivalent
Winner
FTS5 full-text search with BM25 ranking. Filters by type, project, date range, importance level.
Sees full diffs, but rarely useful for memory search
Browse observations chronologically around an anchor point.
`claude-mem-lite update <id>`
Status
Manually save a memory/observation. Accepts `closes_deferred` array for transactional closure of deferred work.
`claude-mem-lite fts-check <check\
recent
Retrieve full details for specific observation IDs (includes importance and related_ids).
`claude-mem-lite export`
Enable debug logging (`1` to enable).
`claude-mem-lite maintain scan --ops dedup,decay`
Drop a deferred item without fixing it; requires a `reason` for the audit trail.
Show most recent observations, ordered by time. Quick snapshot of latest activity.
Mark work for a future session (v2.70+). First-class carry-forward signal, surfaced in SessionStart `### Deferred Work` block.
`claude-mem-lite compress`
Description
Recall observations related to a file. Use before editing to surface past bugfixes and context.
`claude-mem-lite optimize`
LLM model for background calls (episode extraction, session summaries). Accepts `haiku` or `sonnet`.
Custom data directory. All databases, runtime files, and managed resources are stored here.
See Core above — the broadest injection-volume switch.
List open deferred items for the current project.
Anthropic API key. When set, all background LLM calls go directly to the Anthropic Messages API (with prompt caching). Highest priority.
`claude-mem-lite stats`
`claude-mem-lite browse`
Silences the one-line "Invited-memory 未启用:`claude-mem-lite adopt`…" hint that SessionStart appends when the current project hasn't been adopted. Since v2.82.1 auto-adopt runs on every SessionStart for any install path, so this hint typically surfaces only when you've explicitly opted out (`MEM_NO_AUTO_ADOPT=1` or `claude-mem-lite adopt --disable`).
Global opt-out for auto-adopt (v2.82.0+). `1` prevents the per-SessionStart auto-write of the `CLAUDE.md` managed block across **all** projects. For per-project opt-out use `claude-mem-lite adopt --disable` instead (writes a durable `<memdir>/.mem-no-auto-adopt` sentinel that survives marker deletion).
Fully compatible (Intel and Apple Silicon)
`claude-mem-lite delete <id>`
`claude-mem-lite registry <action>`
Generic graph nodes
`, the *fraction* of all gold sessions retrieved), the lexical stack scores @1 = 52.9% / @5 = 87.8% / @10 = 91.0%. The whole gap is the 65% of questions with multiple gold sessions — any-hit needs one, fractional needs them all, and @1 is capped at 1/
_MCP only_
OpenRouter API key (OpenAI-compatible). Used for background LLM calls when `ANTHROPIC_API_KEY` is **not** set. If neither key is set, calls fall back to the `claude -p` CLI.
Users search semantic concepts ("auth bug"), not code lines
Linux under the hood, so it should behave as the Linux row; nobody has reported either way
does not happen
What happens now
compact
Update mechanism
Score (production-hybrid)
Overrides the OpenRouter model slug for **all** background calls (e.g. `openai/gpt-4o-mini`, `qwen/qwen-2.5-72b-instruct`). When unset, the `CLAUDE_MEM_MODEL` tier maps to `anthropic/claude-haiku-4.5` (haiku) or `anthropic/claude-sonnet-4.5` (sonnet).
`1` exposes all 18 MCP tools in `tools/list` instead of the 9 core ones (pre-v2.34.0 behavior). The 9 hidden tools stay callable by exact name either way.
`0` disables the file-intel block injected before `Read` (past observations about the file you are about to open).
Files smaller than this stay silent — file-intel only pays for itself on large files.
`0` disables the warning when the same file is read twice in a session. Never fires on `offset`/`limit` paging.
Token floor below which the re-read guard stays silent.
`1` extends the pre-tool recall nudge from `Read` to other tools.
`1` keeps low-signal observations that the deterministic filter would otherwise drop before dedup/vector work.
`1` stops SessionStart from refreshing the adopted `CLAUDE.md` managed block when the shipped template changes.
Relevance floor for the error-recall surface (memories injected after a failed Bash command). **Off by default.** Setting it to `10.5` (the calibrated value) makes the surface stay silent when its best-matching memory is not actually about the failure — the whole set is dropped, never trimmed row-by-row. **It is a real trade, not a free win:** measured on a live database at that threshold, injections fall ~37% and ~39% of firings go silent, concentrated in projects with few memories. Off by default because nothing shows the dropped rows were noise. Explore with `node benchmark/error-recall-suite.mjs --sweep`.
`off` suppresses the one-line caveat appended to a multi-variant deep result. The caveat exists because deep search fills the page even when the corpus cannot answer — measured at 10 of 10 slots on queries whose answers had been removed (`benchmark/deep-search-holdout.mjs`) — and `deep` is AUTO by default on the MCP surface, i.e. it escalates precisely when the honest answer is "nothing". It does not change retrieval, ranking, or which rows are returned.
`1` fully silences the cite-back nudge.
Restore the pre-v5.4.0 behaviour where `Stop` deletes the session file. Documented revert path for the session-lifecycle change, not a supported configuration: it re-mints a mem session per turn and makes the `/clear` handoff unreachable again. Only reach for it on a host that fires `Stop` once per session rather than once per turn.
`1` disables the one-shot retry that re-asks for a missing `lesson_learned`.
Max memories injected per prompt.
`0` disables the bypass that lets an exact identifier match skip the score floors.
`0` disables the same auto-escalation on the CLI path only.
Minimum injection volume before the ratio gate is judged at all.
Skip auto-compression of old observations.
`0` restores always-search; by default the prompt must carry an explicit retrieval signal.
How many past-prompt rows the fallback arm may return.
`1` stops environment-scoped observations from firing on file-triggered recall. They stay reachable via search. **Leave it off**: on the face it gates, `environment` is not the low-relevance class its premise assumes — it cites at least as well as `project` (47.5% vs 44.3%, intervals overlapping), and an earlier measurement left 173 recall groups empty with it on.
Consecutive low-cite sessions before the nudge goes quiet; `0` = never silence.
Skip the 24h auto-maintain pass (decay, purge, backup).
`on`/`1` injects the single most relevant lesson at prompt position under an imperative template.
BM25 relevance floor for a result to be injected.
Fraction of query terms a memory must cover to qualify (∈ [0,1]).
An episode flush collects `reads-<project>.txt` only when it will actually save an observation, so a flush that records nothing no longer discards the Read paths it swept up (42.2% of the paths a flush consumed, measured over 1122 transcripts). `0` restores the pre-v3.83.0 behaviour.
Stop credits an `access_count` to a memory the session cited only when something made that memory relevant to the session — it was injected, or you typed its `#NN` yourself. `off` restores the pre-v3.84.0 behaviour of crediting every `#NN` the assistant wrote, which over-counts sessions that discuss memories in prose (release notes, audit reports): measured on real transcripts, 267 of 859 credited (id, session) pairs — 31.1% — were mentions nothing had put in front of the model. Superseded citations are redirected to their keeper on both settings.
Skip the LLM optimization pass (re-enrich, normalize, cluster-merge).
Dispatch-time memory injection for subagents.
Looser floor for follow-up prompts inside an already-injected session.
Multiplier for matches from other projects (∈ [0,1]); raise it for installs that want more cross-project sharing.
The `subagent` injection face feeds the decay loop: memories handed to a dispatched agent enter the denominator, and the citation that agent makes in its own transcript counts as the numerator. `0` returns the face to metered-but-never-decaying (v3.77–v3.82).
Skip the MinHash near-duplicate pass, keeping exact dedup.
Selects a comprehension-bridge arm (`bridge`, `bind`); unset = current default behavior.
Floor applied to the OR-fallback arm (looser query, needs a stricter floor).
Max query tokens allowed into the OR fallback (∈ [0,50]).
`1` disables both the access-count bump and the decay loop — no citation bookkeeping at all.
`1` records feature-injection counters surfaced by `claude-mem-lite stats`.
Skip the runtime-marker sweep. **Must be exactly `1`** — unlike the other `CLAUDE_MEM_SKIP_*` flags, which accept any truthy value, this one compares against the string `1`. That is deliberate: a truthy check makes `=0` mean "skip", which is the opposite of what anyone typing it intends.
Enables decay of file↔observation edges.
Minimum score for the top hit; `0` disables (useful on tiny test corpora).
Precision floor for CJK segmentation candidates.
`1` disables only the decay writes, keeping access-count bumps.
Skip the 24h auto-update check against GitHub Releases.
Edge-decay threshold when the flag above is on (clamped to ≥1).
Reference corpus size the score floors are normalized against, so a fresh install with few rows is not silently gated to zero injections. Shared by every floor-bearing surface, including error-recall below.
`off` restores the flat keyword ordering of the error-recall surface. **On by default**, and unlike the floor above it removes nothing: memories that share only the failed command's vocabulary are demoted below memories that mention the failure itself, and when a project has none of the latter the result is unchanged. Measured on a live database over 52 real failing commands × 15 projects: the lead memory matched no error term in 42.3% of firings before, 21.5% after, with the injected row count identical.
`off` stops the plugin from recalling memories when a Bash command **fails at the host level**. On by default. Claude Code delivers failed tool calls to a separate `PostToolUseFailure` hook event, so before this the surface only ever saw commands that exited `0` while printing error-ish text — a genuinely failing build recalled nothing. Denials from your own guardrails (sandbox, policy hooks, declined permission prompts) and commands you interrupted are never recalled for.
`0` disables automatic deep-search escalation (one Haiku call rewriting a weak query into keyword/concept/HyDE variants). Explicit `deep: true` still works.
`off` suppresses the one-line note that fires when a search's reported `total` exceeds what its pagination can hand back. The candidate pool is sized from `limit` alone and deliberately does not grow with `offset` (D#30 — an offset-scaled pool re-ranks its own prefix under RRF, so pages overlapped and gapped), while `total` is the full match count. Measured on a 128-row corpus: at the default limit of 20 the last non-empty offset is 59, so 60 of 128 rows are unreachable at any offset. The note reports that; it does not change retrieval, ranking, or which rows are returned. It stays **silent** when a filter you asked for (`tier`, or the CJK precision gate on prompts) removed rows after the count was taken — that gap is your filter, not the pool, and raising the limit would not recover it.
`1` restores the pre-fix behaviour where the daily unattended `normalize` runs ONCE over every project's concepts at the same time. That is how one project's stored content could steer synonym groups applied to another project's rows, so the default is now one scoped pass per project (bounded to 8 per run). The cost of the default is that `k8s` in one project and `kubernetes` in another are no longer unified automatically. Note that EVERY unscoped run fans out, including an explicit `optimize --run --task normalize` with no `--project` — this variable is the only route back to the single cross-project pass. A foreground `optimize` run prints a warning when it is set; the daily unattended pass cannot (its worker is spawned with stderr closed), so `claude-mem-lite doctor` reports it as a ⚠ instead.
**Removed — inert.** Tuned the per-project adoption gate, which is gone (D#204). Setting it warns on stderr and changes nothing.
Cite-rate below which the nudge fires.
`1` judges the wide cite-recall ratio (every `#NN`-shaped token the model saw) instead of the lessons the hooks injected. **Half of the revert**: the threshold moved too, so pre-v6.6.0 gating needs this **and** `CLAUDE_MEM_CITE_NUDGE_THRESHOLD=0.6`. This switch alone gives you the wide ratio judged at 0.4, which is neither release's behaviour.
Skip the background LLM session summary at **both** of its spawn sites — `Stop`, and the SessionStart `/clear`-handoff path. Until v5.3.0 only the `Stop` one honoured it.
Skip LLM extraction on episode flush — observations are still batched, just not summarized.
Skip the background Haiku call that backfills `lesson_learned` / search aliases after a save.
Skip Ed25519 signature verification of a downloaded update. **Escape hatch — leaves updates unauthenticated.**
Seconds the Stop hook waits for pending episode flushes.
Disk budget for backup snapshots; the next maintain/save evicts oldest snapshots past the 7-day undo grace.