经 AI Skill Hub 精选评估,MCP工具 获评「推荐使用」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。
MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/TT-Wang/memem
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"mcp--": {
"command": "npx",
"args": ["-y", "memem"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 MCP工具 执行以下任务... Claude: [自动调用 MCP工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"mcp__": {
"command": "npx",
"args": ["-y", "memem"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
Persistent, self-evolving memory for Claude Code. Stop re-explaining your project every session.
For LLM/AI tool discovery, see llms.txt.
███╗ ███╗███████╗███╗ ███╗███████╗███╗ ███╗
████╗ ████║██╔════╝████╗ ████║██╔════╝████╗ ████║
██╔████╔██║█████╗ ██╔████╔██║█████╗ ██╔████╔██║
██║╚██╔╝██║██╔══╝ ██║╚██╔╝██║██╔══╝ ██║╚██╔╝██║
██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║
╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
persistent memory for Claude Code
v2.4.0 flips the default injection mode from auto to tool: Claude no longer receives memory context on every prompt automatically. Instead, it pulls memory on demand via memory_search, memory_get, and active_memory_slice. This eliminates ~85% per-turn noise that was masking v2.3.0's ranking improvements. At session start, Claude now receives a ## Episode index section listing up to 50 episodic memories by title — a clean menu without a full content dump. Every retrieval is logged to ~/.memem/.recall_log.jsonl; run python3 -m memem.server --analyze-recalls to inspect recall patterns. All 5 MCP tool descriptions have been rewritten to be trigger-explicit so Claude knows when to call each tool. Existing users with MEMEM_INJECTION_MODE=auto in their shell profile are unaffected; see the CHANGELOG breaking change banner to restore old behavior.
active_memory_slice now uses a two-stage hybrid retrieval pipeline: BM25 + cosine Reciprocal Rank Fusion (RRF) builds a top-20 candidate pool, then Maximal Marginal Relevance (MMR, λ=0.7) selects the final 8 results to suppress near-duplicate memories. Access writeback is on by default (MEMEM_WRITEBACK_ENABLED=1); each recall fires a daemon thread that increments access_count in a JSON sidecar at ~/.memem/telemetry.json (NOT in memory frontmatter — deliberate, to keep load_vault_index's mtime cache stable). Net benchmark result: 75.3% precision (+1.3 pp vs v2.0.0 baseline), 133ms warm latency. Recency decay scoring was prototyped but reverted due to a negative-cosine ranking regression — see CHANGELOG for details.
Two architectural additions targeting the episodic-query gap vs everme. (a) retrieve.py parses temporal phrases in queries ("yesterday" / "last week" / "N days ago") and re-ranks candidates by created: proximity (+0.2 boost). Zero behavior change for non-temporal queries. (b) mine_delta.py emits one per-session "episode" memory after substantive Stop events (tagged type:episodic, Haiku-generated 100-word narrative). Benchmark is unchanged at 74% in this release — the gains are forward-looking and accrue as the vault accumulates v2.2.0-shaped episodes. Backward-compat is 100%.
The miner daemon is gone. miner_daemon.py, miner-wrapper.sh, miner_circuit_breaker.py, miner_errors.py, and miner_protocol.py (~1,500 LOC) have been deleted. Mining now triggers on every Claude Code Stop event via a detached subprocess.
hooks/stop-mine.sh) spawns mine_delta as a detached background process on every Stop event. Hook overhead is ~50ms; extraction happens in background after the hook returns.memem/mine_delta.py — new module (~200 LOC): reads the JSONL session file from a byte offset tracked per session, filters to new turns since the last invocation, calls the same Haiku extract_from_text function, and marks the session in ~/.memem/.mined_sessions.SessionStart hook now scans for JSONL files older than 10 min that aren't in .mined_sessions and spawns up to 3 parallel mine_delta processes. Catches sessions where Stop never fired (Claude crash, kill -9, network drop).mine_delta acquires an fcntl.flock on a lock file per session so concurrent Stop events on the same session don't race.extract_from_text function from mining.py are used. The 18-query benchmark still passes at ≥70% precision.BREAKING — schema rebuild from 18 sections → 2 (Working + Relevant). Retrieval pipeline rewritten from ~12,400 LOC to ~210 LOC (POC v3b architecture). Net delete: 87 files, +915 / -19,941 LOC.
memem/retrieve.py (~145 LOC) + memem/render.py (~65 LOC) — query → embed → cosine top-K + FTS-conditional supplement for version/date literals, then a 2-section renderer. Pure embedding similarity, no scope filter, no kind classifier, no LLM judge, no daemon.## Working (current state) + ## Relevant (ranked list). The v1.13 schema (Anchors / Episodic / Skills / Cases / Working / Pending) is gone.active_memory_slice MCP tool slimmed from 8 params to 2 (query, task_mode). Backward-incompatible.MEMEM_USE_LLM_JUDGE, MEMEM_USE_EMBEDDINGS, MEMEM_RENDER_LEGACY, MEMEM_LLM_JUDGE_TIMEOUT, MEMEM_AUTO_SLICE_DAEMON — all no-op now).slice_daemon and MEMEM_AUTO_SLICE_DAEMON removed. Retrieval is now in-process via memem.retrieve; the hook spawns python directly per prompt. After upgrade run pkill -f slice_daemon once to clear any old process.embeddings.npy via tmpfile + os.replace, embedding_ids.json written first so readers never see torn-write or shape mismatch.Two release pair (v1.9.3 + v1.9.4) targeting silent-corruption paths. All changes are no-ops on the happy path.
atomic_write_text helper (tempfile + fsync + os.replace) applied to 5 previously non-atomic data paths (embedding ID map, tournament cache, lesson frontmatter, dreamer output, mined-sessions reset). MEMEM_FSYNC=0 opts out per-call. Power-loss / NFS-jitter / SIGKILL no longer torn-writes vault data.graph.db and search.db now use journal_mode=WAL + synchronous=NORMAL + busy_timeout=5000, matching session_state_db.py since v1.6. Concurrent reads from the slice engine no longer race with miner writes. New memem --integrity-check CLI command (also called from --doctor) runs PRAGMA integrity_check on all three DBs.--- frontmatter are no longer silently ingested with schema_version=0. New MEMEM_FRONTMATTER_STRICT env var: quarantine (default — move to ~/.memem/quarantine/<hash>_<name>), skip (log + ignore), or raise.commit_deltas hashes (scope_id, dry_run, auto_only, deltas, DELTA_WRITEBACK_VERSION) on entry; matching hits return cached result with deduped: True markers. Cache at ~/.memem/writeback-idempotency.json. Dry-runs and partial-failure batches are not cached. force_writeback=True bypasses the lookup. RMW guarded by fcntl.flock.mine_session's in-process timeout cap. Now the daemon itself increments timeout_failures and permanently skips after MEMEM_MAX_SESSION_TIMEOUTS (default 3).Four layered gating heuristics between the UserPromptSubmit hook and the active-slice engine, plus a new MEMEM_INJECTION_MODE env (auto / hybrid / tool). Hybrid mode reduces hook overhead on trivial turns via: (1) trivial-query regex EN+ZH, (2) per-session turn cadence (MEMEM_INJECT_CADENCE, default 2), (3) empty-streak exponential backoff (MEMEM_EMPTY_STREAK_MAX, default 8), (4) topic-shift cosine via cached query embedding (MEMEM_TOPIC_SHIFT_THRESHOLD, default 0.85). Persistent slice daemon since v1.8 eliminates cold-start cost. See CLAUDE.md for the full tunables table.
memory_save accepts an optional layer param (Claude can override) and auto-classifies otherwise. The slice engine pins L0 (project identity) on every prompt and gates L3 (rare archival) behind explicit search.memory_search, memory_get, memory_timeline, memory_recall, and context_assemble all return slice-formatted output via a single render_slice_markdown dispatcher. context_assemble composes via active_memory_slice rather than rolling its own briefing.A 16-module refactor closed the entire spawn-storm class of bugs that had previously taken down hosts. The miner now uses start_new_session=True + os.killpg for process-group cleanup on timeout, an inverted TransientError/PermanentError taxonomy with PermanentError as default, persisted attempt counters with DLQ at MAX_FAILURES, a SIGTERM-drained graceful shutdown, SQLite WAL state storage, a hand-rolled circuit breaker, structured JSON logs with RotatingFileHandler, and a 5-in-60s wrapper crash guard.
uv (auto-installed by bootstrap.sh on first run)claude CLI on PATH (optional — required for Haiku-powered assembly; degraded mode works without it)Copy-paste:
claude plugin marketplace add TT-Wang/memem
claude plugin install memem@memem-marketplace
If you already added the marketplace once, future installs only need the second command.
Then:
That's it. On first run, bootstrap.sh self-heals everything:
uv python install 3.11 if your system Python is too olduv if missing (via the official Astral installer).venv (hash-cached against uv.lock)~/.memem/ and ~/obsidian-brain/~/.memem/.capabilities (used for degraded-mode decisions)First run: ~5 seconds. Every run after: ~100ms. No separate pip install step.
Nothing mines until you opt in. memem is strictly opt-in as of v0.9.0 — install does not start the miner or touch your sessions. Type /memem to see status and choose what to do next. You can start mining two ways:
/memem-mine — mine new sessions only (from now on)/memem-mine-history — mine everything, including past history (uses Haiku API credits)Or just tell Claude "start mining new sessions" / "start mining everything including history" — it knows what to do.
claude plugin marketplace add TT-Wang/memem
claude plugin install memem@memem-marketplace
Then in Claude Code:
/memem
And choose one:
/memem-mine
or
/memem-mine-history
memem works without Obsidian — it just writes markdown. But Obsidian gives you graph view and backlinks for free:
~/obsidian-brain as a vaultmemem/memories/, playbooks in memem/playbooks/related field| Env var | Default | Purpose |
|---|---|---|
MEMEM_DIR | ~/.memem | State directory (PID files, search DB, logs) |
MEMEM_OBSIDIAN_VAULT | ~/obsidian-brain | Vault location |
MEMEM_EXTRA_SESSION_DIRS | (none) | Colon-separated extra session dirs to mine |
MEMEM_MINER_SETTLE_SECONDS | 1800 | (legacy) Settle-window seconds. In v2.1.0 both the Stop hook AND --mine-all bypass this gate; retained only for forward-compat with future tooling that may opt into it. |
MEMEM_SKIP_SYNC | 0 | Bootstrap skips uv sync when set to 1 (dev only) |
memem enters degraded mode — it still works, just without Haiku-powered context assembly and smart recall. You get FTS-only keyword recall instead of query-tailored briefings. Every session shows [memem] N memories · miner OK · assembly degraded (claude CLI missing — FTS-only recall) at the top of the context, so you know why.
This is by design: missing optional dependencies should degrade, not fail.
Claude Code Stop event fires → stop-mine.sh hook spawns mine_delta (detached, ~50ms)
→ mine_delta reads session JSONL from byte offset (new turns only)
→ Filters to human messages + assistant prose (strips tool calls, system reminders)
→ One Haiku call with the delta context: "extract durable lessons"
→ Haiku returns JSON array of memory candidates
→ Each candidate runs: security scan → dedup check → contradiction detection → save
→ Offset advanced; session marked in ~/.memem/.mined_sessions
→ SessionStart stale-sweep catches any sessions where Stop never fired (crash, kill -9)
First message in a new session → auto-recall.sh hook fires
→ Reads ~/.memem/.capabilities for status banner
→ Builds an active memory slice from recall candidates + graph/playbook/transcript context
→ Emits a structured "Active Memory Slice" prompt block
→ If the slice engine is unavailable → falls back to compact recall
→ Either way, Claude starts its reply with active work-state context already loaded
高质量的MCP工具,实现Claude持久化存储
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:MCP工具 的核心功能完整,质量良好。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | memem |
| 原始描述 | 开源MCP工具:A Claude Code plugin that gives Claude persistent memory across sessions — store。⭐33 · Python |
| Topics | anthropicclaude-codemcppython |
| GitHub | https://github.com/TT-Wang/memem |
| License | MIT |
| 语言 | Python |
收录时间:2026-06-09 · 更新时间:2026-06-09 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端