Skip to content
This repository was archived by the owner on Jun 23, 2026. It is now read-only.

Releases: VKirill/TencentDB-Memory-Claude-Code

v0.5.6 — capture pipeline correctness (dedup + SessionEnd + PreCompact)

Choose a tag to compare

@VKirill VKirill released this 17 May 21:43

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 binary

What 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.sh once 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.db files continue working.
  • Tests: new dedup test in capture.test.ts covers first-write / identical-skip / different-append.

v0.5.5 — DeepSeek default + LLM runner cleanup

Choose a tag to compare

@VKirill VKirill released this 17 May 19:19

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

  1. maxTokens=4096 cap 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. With maxTokens undefined, AI SDK omits the parameter and each model uses its own (typically larger) provider-side default. Per-caller and per-config overrides still work.

  2. Dead compatibility: "compatible" option removed (175edc9)
    The field was dropped from OpenAIProviderSettings in @ai-sdk/openai 3.x. Silently ignored at runtime but polluted TypeScript diagnostics. In SDK 3.x the chat endpoint is selected via provider.chat(model) (which the code already does); no extra flag is needed.

Migration notes

  • No DB migration — existing vectors.db files continue working.
  • No env change — OPENROUTER_API_KEY is the same; the model swap is provider-side, both models served via OpenRouter.
  • Config precedence unchanged — your explicit model setting in config.json always wins over the template default.
  • Per-model overrides — you can still set llm.model, extraction.model, persona.model independently 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)

Choose a tag to compare

@VKirill VKirill released this 17 May 14:24

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 McpServer instead for the high-level API. Only use Server for 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.ts from low-level Server to high-level McpServer.
    • Dropped the manual setRequestHandler(ListToolsRequestSchema, ...) and setRequestHandler(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).
  • Tool semantics preserved byte-equivalent: same names, same descriptions, same handler functions, same response shape (content: [{type:"text", text:...}]).

Added

  • zod@4.4.3 promoted to direct production dependency. It was being used via transitive hoisting from @modelcontextprotocol/sdk and @ai-sdk/openai — fragile if either upstream drops it.

Verified

  • 91/91 unit tests pass.
  • JSON-RPC smoke test: initialize returns correct protocolVersion: 2025-06-18, capabilities.tools.listChanged: true, serverInfo: {name:tencentdb-memory, version:0.5.4}. tools/list returns 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

Choose a tag to compare

@VKirill VKirill released this 17 May 14:02

TL;DR

  • install.sh now auto-starts the PM2 scheduler — no manual pm2 start step.
  • Default embedding is now OpenAI text-embedding-3-large @ 1024-d (was Voyage AI voyage-3-lite @ 512-d). Voyage remains supported via config + VOYAGE_API_KEY fallback.
  • Breaking: vector schema is now 1024-d. Existing vectors.db must be archived and recreated.
  • Breaking: new installs require OPENAI_API_KEY in ~/.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.sh auto-starts the PM2 scheduler when pm2 is on PATH. Idempotent — skips if tencentdb-memory-scheduler already running. Error-tolerant — pm2 failures don't abort install. Retains print-instructions fallback for systems without pm2. (5b7fa55)

Changed

  • Default embedding provider switched from Voyage AI to OpenAI. The codebase abstraction is OpenAI-compatible HTTP; Voyage's API rejected the dimensions parameter (Voyage expects output_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-small documented as cheaper alternative. (ab138b7)
  • MCP server version is read dynamically from package.json instead of hardcoded. (5b7fa55)
  • .gitignore extended with a secrets safety-net section.

Breaking

  • Vector schema: 512-d → 1024-d. Existing l1_vec / l0_vec columns will reject 1024-d writes. Migration: stop scheduler → archive vectors.db → restart.
  • Required env var: OPENAI_API_KEY. Falls back to VOYAGE_API_KEY if user keeps Voyage in their config.json.

v0.5.2 — cosmetic loose-ends: dynamic --version, pm2 hints, install paths

Choose a tag to compare

@VKirill VKirill released this 17 May 00:58

[0.5.2] — 2026-05-17

Three cosmetic loose-ends from the v0.5.0/0.5.1 renaming sweep.

Fixed

  • CLI --version output now reads from package.json dynamically
    (was a hardcoded string in src/cli/index.ts, stale after build).
    Future bumps automatically reflect in tencentdb-mem --version once
    rebuilt — no second place to update.
  • install.sh PM2 hint messages now suggest
    --name tencentdb-memory-scheduler (three locations) instead of the
    legacy claude-mem-scheduler name.
  • install.sh "Install first" hint pins the current version
    (#v0.5.2) instead of an older tag.
  • claude-code-integration/scheduler.cjs template install-comment
    references the new path ~/.claude/hooks/tencentdb-memory/... (was
    ~/.claude/hooks/claude-mem/...).

Build

  • Pre-publish npm run build runs as part of prepack; dist artifacts
    bundled match the source version after this release.

v0.5.1 — hooks dir renamed claude-mem → tencentdb-memory

Choose a tag to compare

@VKirill VKirill released this 17 May 00:45

[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.sh default HOOKS_DIR → ~/.claude/hooks/tencentdb-memory
    (still overridable via CLAUDE_HOOKS_DIR env var)
  • install.sh migration block: if a legacy ~/.claude/hooks/claude-mem/
    exists and the new path does not, the folder is mv'd in place
  • install.sh settings.json patch: hook command paths
    hooks/claude-mem/ are rewritten to hooks/tencentdb-memory/
    (backup saved to .bak.before-v0.5.1)

Notes

  • The ~/.claude/claude-mem-projects.txt allowlist filename is not
    renamed; the scheduler still reads from this exact path for
    back-compat with existing user files.
  • If you set CLAUDE_HOOKS_DIR explicitly, the migration is skipped and
    your override is honoured as before.

v0.5.0 — BREAKING: rename binary to tencentdb-mem

Choose a tag to compare

@VKirill VKirill released this 16 May 23:28

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 prefix mcp__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

Choose a tag to compare

@VKirill VKirill released this 16 May 22:00

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: stdio field
  • 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-memory

Verified: 91/91 tests, fresh install + migration + idempotency all pass.

v0.4.2 — rename MCP server to tencentdb-memory

Choose a tag to compare

@VKirill VKirill released this 16 May 21:32

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-mem MCP 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.json

Migration 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/*.md

Verified: 91/91 tests, fresh install + upgrade both produce clean single-key settings.json.

See CHANGELOG.md

v0.4.1 — auto-register project on SessionStart

Choose a tag to compare

@VKirill VKirill released this 16 May 20:56

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 isOurs guard extended to match claude-mem-projects.txt literal — 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.sh

See CHANGELOG.md