Releases: VKirill/TencentDB-Memory-Claude-Code
Release list
v0.5.6 — capture pipeline correctness (dedup + SessionEnd + PreCompact)
TL;DR
Capture pipeline correctness fix. The Stop hook in Claude Code fires per-turn (after every Claude response), not per-session — and the wrapper captures the rolling 4 KB transcript tail each fire. Real install showed 40% duplication (269 of 662 L0 rows were exact copies).
This release adds dedup at the capture layer and extends hook coverage to PreCompact + SessionEnd, closing the gap where /clear and /compact previously lost their dialog without being captured.
Drop-in upgrade from 0.5.5 — no DB schema change.
Upgrade from 0.5.5
npm i -g github:VKirill/TencentDB-Memory-Claude-Code#v0.5.6
# Re-run install.sh to pick up new event subscriptions:
bash "$(npm root -g)/@vkirill/tencentdb-memory-claude-code/claude-code-integration/install.sh"
# Restart Claude Code so MCP picks up new binaryWhat changed
Fixed: Dedup in runCapture
Stop hook fires after every Claude response. The wrapper captures the rolling 4 KB transcript tail each time. Without dedup, the same content was recorded 2-5× per session — confirmed on real install:
Walkaround on /home/ubuntu/{*}/.claude/memory/conversations/:
total lines before: 662
total lines after: 393
dropped duplicates: 269 (40%)
runCapture now reads the last user+assistant pair from today's JSONL and compares against the incoming payload. If identical under the same sessionKey, the write is skipped and the call returns { ok: true, l0Recorded: 0 } with a debug log:
[capture] dedup skip — identical to last record
"Nothing changed" is success — hook discipline already requires exit 0.
Added: Subscribe to PreCompact + SessionEnd
Claude Code emits richer lifecycle events the fork was ignoring:
| Event | Fires when | Why it matters |
|---|---|---|
PreCompact |
BEFORE context compaction | Capture full dialogue before nuance is summarized away |
SessionEnd |
On /clear, /compact, /exit, /logout (matcher tells you which) |
Paths that Stop alone never sees |
Stop (existing) |
After every Claude response | Per-turn capture (now deduped) |
All three events share the transcript_path schema, so the existing stop-wrapper.sh handles them with no code change. With the dedup layer above, multiple events firing on overlapping content stay idempotent.
install.sh's existing jq deep-merge unions hook arrays per event name, so the two new subscriptions pass through automatically on next install.sh run — no migration script needed.
Migration notes
- Existing installs: re-run
install.shonce to pick up new event subscriptions in~/.claude/settings.json. Old subscriptions are preserved (merge, not overwrite). - Historical duplicates in JSONL are unaffected — the dedup is only for new writes. A one-shot cleanup can be done with the included logic:
# See dedup walkaround in PR — drops by (sessionId, role, content) tuple - No DB schema change. Existing
vectors.dbfiles continue working. - Tests: new dedup test in
capture.test.tscovers first-write / identical-skip / different-append.
v0.5.5 — DeepSeek default + LLM runner cleanup
TL;DR
Significant LLM pipeline upgrade. Default model swapped tencent/hy3-preview → deepseek/deepseek-v4-flash after side-by-side benchmark showed 8× faster, 6× cheaper, qualitatively better extraction. Plus removed two latent bugs in the LLM runner that were causing silent failures.
This is a drop-in upgrade from 0.5.4 — no DB schema change, no env var change, same OPENROUTER_API_KEY.
Upgrade from 0.5.4
npm i -g github:VKirill/TencentDB-Memory-Claude-Code#v0.5.5
# Restart Claude Code (so MCP picks up new binary)Users with explicit model field in their config.json are unaffected — config wins over template. Fresh installs and template re-generation will use DeepSeek by default.
What changed
The headline: model swap
Side-by-side benchmark on identical L1 extraction prompt:
| tencent/hy3-preview (old) | deepseek/deepseek-v4-flash (new) | |
|---|---|---|
| Latency | 61 seconds | 7 seconds ⚡ |
| Reasoning tokens | 10,955 | 818 |
| Cost per call | $0.003 | $0.0005 💰 |
| Facts extracted | 2 of 3 types | 3 of 3 types ✅ |
| Context window | 32K | 1M |
Native response_format |
❌ | ✅ |
Native structured_outputs |
❌ | ✅ |
Hy3-preview is a reasoning model with always-on chain-of-thought. On real L1-extraction batches (5–15K input tokens), it burned 10K+ output tokens on hidden reasoning before producing the actual JSON — frequently hitting finish_reason=length with empty content. DeepSeek v4-flash is fast inference with optional reasoning (opt-in via reasoning_effort parameter), which we don't enable for extraction.
Latent bugs fixed
-
maxTokens=4096cap removed (db9fe85)
The arbitrary 4096 ceiling was inherited from a gpt-3.5 era. For reasoning models it caused silent failures — model would burn the output budget on hidden reasoning before producing visible content. WithmaxTokensundefined, AI SDK omits the parameter and each model uses its own (typically larger) provider-side default. Per-caller and per-config overrides still work. -
Dead
compatibility: "compatible"option removed (175edc9)
The field was dropped fromOpenAIProviderSettingsin@ai-sdk/openai3.x. Silently ignored at runtime but polluted TypeScript diagnostics. In SDK 3.x the chat endpoint is selected viaprovider.chat(model)(which the code already does); no extra flag is needed.
Migration notes
- No DB migration — existing
vectors.dbfiles continue working. - No env change —
OPENROUTER_API_KEYis the same; the model swap is provider-side, both models served via OpenRouter. - Config precedence unchanged — your explicit
modelsetting inconfig.jsonalways wins over the template default. - Per-model overrides — you can still set
llm.model,extraction.model,persona.modelindependently if you want fine-grained control.
What was NOT changed (intentionally)
- Embedding model and dimensions unchanged (
text-embedding-3-large@ 1024-d from 0.5.3). - MCP server tooling unchanged (4 tools, McpServer migration from 0.5.4 stable).
- Scheduler 30-min cadence unchanged.
v0.5.4 — MCP server modernization (Server → McpServer)
TL;DR
Maintenance release. No behavioral changes — refactors the MCP server's wiring under the hood from the deprecated low-level Server SDK class to the modern high-level McpServer API.
If you're already running v0.5.3, upgrading is drop-in safe — same tool names, same schemas, same behavior. No DB migration, no env changes.
Upgrade from 0.5.3
npm i -g github:VKirill/TencentDB-Memory-Claude-Code#v0.5.4
# Restart Claude Code (so MCP connection picks up the new server binary)That's it. Scheduler, DB, env keys all unchanged.
Why
@modelcontextprotocol/sdk v1.29 marks the low-level Server class deprecated:
"Use
McpServerinstead for the high-level API. Only useServerfor advanced use cases."
We're a plain stdio MCP exposing 4 tools — the canonical high-level use case. This release does the migration before SDK drops the deprecated class entirely.
Changes
Changed
- Migrated
src/mcp/server.tsfrom low-levelServerto high-levelMcpServer.- Dropped the manual
setRequestHandler(ListToolsRequestSchema, ...)andsetRequestHandler(CallToolRequestSchema, ...)switch dispatcher (~60 lines of boilerplate). - Each of the 4 tools (memory_search, conversation_search, recall_persona, recall_scenes) is now declared via a single
server.registerTool(name, config, handler)call. - Zod schemas replace inline JSON Schema for input validation — McpServer auto-converts to draft-07 JSON Schema in the wire response (Claude Code accepts both draft-07 and 2020-12).
- Dropped the manual
- Tool semantics preserved byte-equivalent: same names, same descriptions, same handler functions, same response shape (
content: [{type:"text", text:...}]).
Added
zod@4.4.3promoted to direct production dependency. It was being used via transitive hoisting from@modelcontextprotocol/sdkand@ai-sdk/openai— fragile if either upstream drops it.
Verified
- 91/91 unit tests pass.
- JSON-RPC smoke test:
initializereturns correctprotocolVersion: 2025-06-18,capabilities.tools.listChanged: true,serverInfo: {name:tencentdb-memory, version:0.5.4}.tools/listreturns all 4 tools with proper schemas. - Audit against mcp-builder skill checklist:
- ✅ No stdout pollution (grep clean)
- ✅ Tool names follow SEP-986 (lowercase + underscores)
- ✅ Capabilities advertised correctly (auto by SDK)
- ✅ Error semantics correct (Tool Execution Error vs protocol error — SDK handles)
- ✅ N/A: DNS-rebinding (stdio = local IPC only)
v0.5.3 — PM2 auto-start + OpenAI embedding default
TL;DR
install.shnow auto-starts the PM2 scheduler — no manualpm2 startstep.- Default embedding is now OpenAI
text-embedding-3-large@ 1024-d (was Voyage AIvoyage-3-lite@ 512-d). Voyage remains supported via config +VOYAGE_API_KEYfallback. - Breaking: vector schema is now 1024-d. Existing
vectors.dbmust be archived and recreated. - Breaking: new installs require
OPENAI_API_KEYin~/.claude/claude-mem.env.
Upgrade from 0.5.2
# 1. Reinstall the package
npm i -g github:VKirill/TencentDB-Memory-Claude-Code#v0.5.3
# 2. Add OpenAI key to env file
echo 'OPENAI_API_KEY=sk-...' >> ~/.claude/claude-mem.env
chmod 600 ~/.claude/claude-mem.env
# 3. Stop scheduler + archive old vectors.db in each project + re-run install
pm2 stop tencentdb-memory-scheduler
for p in $(grep -v '^#' ~/.claude/claude-mem-projects.txt | grep -v '^$'); do
mv "$p/.claude/memory/vectors.db" "$p/.claude/memory/vectors.db.bak.0.5.2" 2>/dev/null
done
# 4. Re-run install.sh — it will detect pm2 + start the scheduler automatically
bash "$(npm root -g)/@vkirill/tencentdb-memory-claude-code/claude-code-integration/install.sh"The scheduler will recreate vectors.db per project on the next tick with the new 1024-d schema.
Fresh install
Follow INSTALL.md — same steps as before, but the API key you need is OpenAI now (signup at https://platform.openai.com/api-keys), not Voyage.
Changes
Added
install.shauto-starts the PM2 scheduler whenpm2is onPATH. Idempotent — skips iftencentdb-memory-scheduleralready running. Error-tolerant —pm2failures don't abort install. Retains print-instructions fallback for systems withoutpm2. (5b7fa55)
Changed
- Default embedding provider switched from Voyage AI to OpenAI. The codebase abstraction is OpenAI-compatible HTTP; Voyage's API rejected the
dimensionsparameter (Voyage expectsoutput_dimension), causing all L1 facts to be stored metadata-only with semantic recall inert. Switching default to OpenAI eliminates this mismatch and unlocks vector search by default. (b89f26a) - Default model is
text-embedding-3-large@ 1024-d. Cost: $0.13 per 1M tokens — negligible at hobbyist volume;text-embedding-3-smalldocumented as cheaper alternative. (ab138b7) - MCP server version is read dynamically from
package.jsoninstead of hardcoded. (5b7fa55) .gitignoreextended with a secrets safety-net section.
Breaking
- Vector schema: 512-d → 1024-d. Existing
l1_vec/l0_veccolumns will reject 1024-d writes. Migration: stop scheduler → archivevectors.db→ restart. - Required env var:
OPENAI_API_KEY. Falls back toVOYAGE_API_KEYif user keeps Voyage in theirconfig.json.
v0.5.2 — cosmetic loose-ends: dynamic --version, pm2 hints, install paths
[0.5.2] — 2026-05-17
Three cosmetic loose-ends from the v0.5.0/0.5.1 renaming sweep.
Fixed
- CLI
--versionoutput now reads frompackage.jsondynamically
(was a hardcoded string insrc/cli/index.ts, stale after build).
Future bumps automatically reflect intencentdb-mem --versiononce
rebuilt — no second place to update. install.shPM2 hint messages now suggest
--name tencentdb-memory-scheduler(three locations) instead of the
legacyclaude-mem-schedulername.install.sh"Install first" hint pins the current version
(#v0.5.2) instead of an older tag.claude-code-integration/scheduler.cjstemplate install-comment
references the new path~/.claude/hooks/tencentdb-memory/...(was
~/.claude/hooks/claude-mem/...).
Build
- Pre-publish
npm run buildruns as part ofprepack; dist artifacts
bundled match the source version after this release.
v0.5.1 — hooks dir renamed claude-mem → tencentdb-memory
[0.5.1] — 2026-05-17
Cosmetic follow-up to v0.5.0: align the on-disk hook directory name with
the package identity. The folder ~/.claude/hooks/claude-mem/ from v0.4.x
and earlier is now installed as ~/.claude/hooks/tencentdb-memory/.
Existing installs are migrated transparently — no manual steps required.
Changed
install.shdefaultHOOKS_DIR→~/.claude/hooks/tencentdb-memory
(still overridable viaCLAUDE_HOOKS_DIRenv var)install.shmigration block: if a legacy~/.claude/hooks/claude-mem/
exists and the new path does not, the folder ismv'd in placeinstall.shsettings.json patch: hook command paths
hooks/claude-mem/are rewritten tohooks/tencentdb-memory/
(backup saved to.bak.before-v0.5.1)
Notes
- The
~/.claude/claude-mem-projects.txtallowlist filename is not
renamed; the scheduler still reads from this exact path for
back-compat with existing user files. - If you set
CLAUDE_HOOKS_DIRexplicitly, the migration is skipped and
your override is honoured as before.
v0.5.0 — BREAKING: rename binary to tencentdb-mem
Breaking change. CLI binary renamed claude-mem → tencentdb-mem to eliminate Anthropic brand collision and reflect honest fork attribution to TencentDB (the upstream project).
What changed
- Binary:
claude-mem→tencentdb-mem(all commands) - All hook commands, wrappers, scheduler, MCP registration updated
- All docs reference new binary
Unchanged (intentional)
- npm package
@vkirill/tencentdb-memory-claude-code - GitHub repo
TencentDB-Memory-Claude-Code - MCP server name
tencentdb-memory+ tool prefixmcp__tencentdb-memory__*(already renamed in v0.4.2) ~/.claude/claude-mem.env(env file — kept stable so keys aren't lost)~/.claude/claude-mem-projects.txt(allowlist filename — stable)~/.claude/hooks/claude-mem/(hooks dir, internal path)
Upgrade (mandatory)
# 1. Remove old install (npm doesn't auto-clean bin on rename)
npm uninstall -g @vkirill/tencentdb-memory-claude-code
# 2. Install v0.5.0
npm i -g github:VKirill/TencentDB-Memory-Claude-Code#v0.5.0
# 3. Re-run install.sh — AUTO-MIGRATES old claude-mem references in hooks + MCP config
bash $(npm root -g)/@vkirill/tencentdb-memory-claude-code/claude-code-integration/install.sh
# 4. Restart PM2 + Claude Code
pm2 restart claude-mem-scheduler
# (kill + relaunch Claude Code)
# 5. Verify
tencentdb-mem --version # → 0.5.0
which claude-mem # → (not found — expected)Verified: 91/91 tests, fresh install + migration both pass, MCP server still reports tencentdb-memory.
v0.4.3 — CRITICAL FIX: MCP registration to correct file
Critical bug fix. Anyone who installed v0.4.0, v0.4.1, or v0.4.2 had a non-functional MCP — /mcp UI in Claude Code couldn't see the server.
The bug
install.sh v0.4.0-v0.4.2 wrote MCP to WRONG file (~/.claude/settings.json) instead of the canonical ~/.claude.json.
Fixed in v0.4.3
- Writes to
~/.claude.json(atomic tmp+rename) - Adds
type: stdiofield - Auto-migrates botched v0.4.0-v0.4.2 installs (cleans wrong file)
- Idempotent re-run
- Sibling mcpServers entries preserved
Upgrade (mandatory)
npm i -g github:VKirill/TencentDB-Memory-Claude-Code#v0.4.3
bash $(npm root -g)/@vkirill/tencentdb-memory-claude-code/claude-code-integration/install.sh
# Restart Claude Code → /mcp shows tencentdb-memoryVerified: 91/91 tests, fresh install + migration + idempotency all pass.
v0.4.2 — rename MCP server to tencentdb-memory
Fixes namespace collision with the unrelated thedotmack/claude-mem Claude Code plugin which caused our MCP server not to appear in /mcp UI even though it boots correctly.
What changed
- MCP server name:
claude-mem→tencentdb-memory - Tool prefix:
mcp__claude-mem__*→mcp__tencentdb-memory__* - install.sh: auto-migrates legacy
claude-memMCP key on upgrade (clean removal + new registration, no orphan entries)
Unchanged (no user-facing churn)
- CLI binary still
claude-mem(claude-mem extract,claude-mem mcp serve, etc.) - npm package
@vkirill/tencentdb-memory-claude-code - GitHub repo
TencentDB-Memory-Claude-Code
Upgrade
npm i -g github:VKirill/TencentDB-Memory-Claude-Code#v0.4.2
bash $(npm root -g)/@vkirill/tencentdb-memory-claude-code/claude-code-integration/install.sh
# Restart Claude Code to reload settings.jsonMigration for users with custom agents
If you have custom agents with mcp__claude-mem__* in their tools allowlist, rename to mcp__tencentdb-memory__*:
sed -i 's/mcp__claude-mem__/mcp__tencentdb-memory__/g' ~/.claude/agents/*.mdVerified: 91/91 tests, fresh install + upgrade both produce clean single-key settings.json.
See CHANGELOG.md
v0.4.1 — auto-register project on SessionStart
UX patch: eliminates manual echo $HOME/project >> ~/.claude/claude-mem-projects.txt step.
What changed
- SessionStart hook now has 2 commands: auto-register (idempotent grep-qxF || echo) + recall
- install.sh
isOursguard extended to matchclaude-mem-projects.txtliteral — clean reinstall over v0.4.0 entry - 91/91 tests, idempotency verified (triple-call leaves 1 line), reinstall non-duplicating
Upgrade
npm i -g github:VKirill/TencentDB-Memory-Claude-Code#v0.4.1
bash $(npm root -g)/@vkirill/tencentdb-memory-claude-code/claude-code-integration/install.shSee CHANGELOG.md