Skip to content

fix: conversation search fallback to memories + provenance-free cross-layer dedup - #4

Merged
DottytheHomeless merged 1 commit into
mainfrom
fix/conversations-fallback-and-dedup
Jul 11, 2026
Merged

DottytheHomeless merged 1 commit into
mainfrom
fix/conversations-fallback-and-dedup

Conversation

@DottytheHomeless

Copy link
Copy Markdown
Contributor

What

  1. Conversation-search blind spot: search_misses showed 42 misses/7d, all source='search_conversations' with hit_count=0 — the conversations table has 0 rows (nothing ingests it), so daily-review flows were flying blind. searchConversations() now falls back to memory recall (marked source='memories_fallback', note='conversation_search_fallback: memories'); a miss is recorded only when the fallback also returns nothing.
  2. Cross-layer dedup: the markdown importer (migrate-claude-memories.mjs) deduped by summary only for source='manual' rows, so native store_memory rows were invisible to it → markdown/native duplicate drift. Dedup now matches active memories by content_hash/exact content across all sources; summary matching kept only for legacy importer idempotency.

Evidence

  • Pre-fix read-only check on live DB: [{"source":"search_conversations","count":42,"zero_hits":42}], conversations=0
  • Write-time near-dup in index.mjs was already provenance-independent; the gap was importer-side only

Tests

node conversation-fallback-dedup.test.mjs — 5 passed / 0 failed (fallback hit, fallback metadata, no-miss-on-fallback-hit, importer idempotency, provenance-free skip)

🤖 Generated with Claude Code

@DottytheHomeless
DottytheHomeless merged commit 9e85309 into main Jul 11, 2026
2 checks passed
@DottytheHomeless
DottytheHomeless deleted the fix/conversations-fallback-and-dedup branch July 11, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant