Skip to content

Releases: catfish-1234/sessionmem

v1.1.2

Choose a tag to compare

@catfish-1234 catfish-1234 released this 28 Jun 20:36

What's new since v1.0.6

Features

  • Session lifecycle hooks (session-start / session-end): Claude Code auto-injects memories at start, summarizes on end via ~/.claude/settings.json hooks
  • Generic MCP adapter base class; existing adapters refactored onto it
  • projectId derivation: basename + SHA-256(normalized path).slice(0,8), Windows/UNC normalization, SESSIONMEM_PROJECT_ID env override
  • injectionCap config key: sessionmem config set injectionCap <100-10000>
  • listMemories pagination: optional limit (default 200, max 1000), response includes total
  • Lossless export/import: exportMemories/getMemory/storeMemory return full content, no 2000-char truncation
  • ingestSessionEvents dedup: INSERT OR IGNORE + unique index (migration 009)
  • FTS5 recency filter fix: corrected datetime format mismatch
  • Re-embed on redact: redactExisting re-embeds after content scrub
  • Atomic policy config writes: temp-file + renameSync
  • Error hardening: fs paths no longer leaked to MCP clients
  • Startup injection sanitization: control chars stripped, kind validated against allow-list
  • Extended redaction: Stripe live keys and npm tokens, bounded quantifiers (no ReDoS)

Security hardening (21-round audit)

  • sessionId/memoryId/originProjectId capped at 200 chars
  • ingestSessionEvents array capped at 500 events
  • sourceAdapter validated against control-char regex
  • fetch_memories query bounded min(1)/max(1000)
  • Semgrep path-traversal false positives suppressed inline

CI / deps

  • actions/checkout v7, actions/setup-node v6, typescript-eslint 8.61.1
  • workflow_dispatch with OTP input for npm 2FA
  • Trivy v0.36.0

Tests

  • 449 tests, 85 test files (+13 new)
  • Integration: Claude Code hook install/uninstall, FTS fallback union
  • Unit: session-start/end, projectId, ingestSessionEvents cap+idempotency, listMemories pagination, full-content export round-trip, Stripe/npm redaction

Upgrade

npm install -g sessionmem@1.1.2
sessionmem install claude-code # re-run to add session hooks

v1.0.6- Major Bug Fixes and Optimization

Choose a tag to compare

@catfish-1234 catfish-1234 released this 21 Jun 14:00

What's Changed

Bug Fixes (22 issues)

Core Engine & Retrieval

  • Replace word-split countTokens with shared BPE tokenizer from tokenBudget.ts
  • Add WAL mode + performance pragmas (busy_timeout, cache_size) to openDb
  • Replace 4-band step-function recency scoring with smooth exponential decay (14-day half-life)
  • Add MAX_SEMANTIC_CANDIDATES=2000 limit to searchMemoryCandidates
  • Wire unused decayOldBoosts into retrieval pipeline before scoring
  • Add embedding version mismatch awareness — stale embeddings get neutral 0.5 score; added sessionmem re-embed CLI command

Summarization & Cloud

  • Implement real cloud summarization via Anthropic SDK (was a non-functional stub)
  • Default model set to claude-sonnet-4-6, centralized in policyConfig.ts
  • Record cloud summarizer failures in summarization_failures table before local fallback (was silently swallowed)

Code Quality

  • Extract magic numbers to policyConfig.ts (MIN_IMPORTANCE, MAX_IMPORTANCE, CRITICAL_WARNING_IMPORTANCE_THRESHOLD, DEEP_MODE_RETRIEVAL_CAP)
  • Add per-session write soft limit (SESSION_WRITE_SOFT_LIMIT=50) with warning in warningCodes
  • Record manual_delete feedback in memory_feedback table on forgetMemory
  • Fix stale CLI output tests — add missing fields, correct column index, export MemoryTableRow

CI/CD & Distribution

  • Fix GitHub Actions versions (checkout@v4, setup-node@v5) across all workflows
  • Replace hardcoded .mcp.json with portable .mcp.json.example using npx
  • Delete duplicate publish.yml workflow — only release.yml publishes now
  • Pin trivy-action to v0.28.0 (was unpinned @master)
  • Sync all manifest versions + add postversion npm hook for automatic syncing
  • Dockerfile: pin package version @1.0.6, add non-root sessionmem user

Adapter & CLI

  • Expand startup log with db path, project ID; stderr debug output gated by SESSIONMEM_DEBUG=1
  • Wire fallback tools (fetch_memories, startup_inject_memories) into MCP server with real execute bodies

Performance Optimizations

  • Statement caching — WeakMap-based prepared statement caching across all 6 storage repo files. Each SQL statement compiled once per DB lifetime, not once per call.
  • Batch storebatchStoreMemory wraps multiple inserts in single SQLite transaction. Registered as batchStoreMemories MCP tool. ~10x faster for session-end writes.
  • SQL pre-filter — Candidate loading now filters at SQL level: keeps importance >= 8 OR updated_at within 90 days. Excludes stale low-signal memories before cosine similarity.
  • FTS5 pre-filtering — Full-text search narrows candidates to ~50 FTS matches before cosine similarity computation. Falls back to full scan when keyword overlap is poor.

Stats

  • Tests: 370 passing across 72 files
  • New migrations: 007 (feedback manual_delete), 008 (FTS5 search)
  • New dependency: @anthropic-ai/sdk (cloud summarization)

Full Changelog: v1.0.0...v1.0.6

v1.0.0 — Initial release

Choose a tag to compare

@catfish-1234 catfish-1234 released this 12 Jun 18:53

sessionmem v1.0.0

First public release of sessionmem — a local-first MCP memory layer that gives your AI coding assistant a persistent memory across sessions, stored entirely on your own computer.

What's included

  • Session memory — automatically captures what happens in your coding sessions and summarizes the important parts (decisions, warnings, key facts)
    • Cross-tool support — works with Claude Code, Cursor, Codex, Cline, Windsurf, Antigravity, QCoder, and any other MCP-compatible host
    • Privacy-first — everything stored in a single SQLite file on your machine; no account, no cloud, no telemetry
    • Secret redaction — API keys, tokens, and passwords are scrubbed before anything is saved (on by default)
    • Token-budgeted injection — memories are trimmed to ~230 tokens so they don't bloat your context (85.6% reduction vs. carrying full history)
    • Retention pruning — stale memories are automatically cleaned up to prevent "memory rot"
    • Team mode — optional shared-path team memory via a folder you already control
    • Cloud summarization — optional opt-in via Anthropic API for higher-quality summaries
    • Full CLIinstall, search, list, forget, export, import, stats, redact-scan, and more

Quickstart

npm install -g sessionmem
sessionmem install   # register with your AI tool

See the README for full documentation.

Benchmark highlights

Metric Result
Token reduction ~85.6%
Retrieval hit-rate 100%
Recall 100%

Links