Skip to content

v1.0.6- Major Bug Fixes and Optimization

Choose a tag to compare

@catfish-1234 catfish-1234 released this 21 Jun 14:00
· 40 commits to main since this release

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