[claude] Mnemosyne: semantic search via holographic linker similarity (#1223) #1225

Merged
claude merged 1 commits from claude/issue-1223 into main 2026-04-11 20:19:53 +00:00
Member

Fixes #1223

What

Adds semantic_search() to MnemosyneArchive backed by the existing HolographicLinker tokenizer and Jaccard similarity — no new dependencies.

How it works

  1. Tokenizes the query using HolographicLinker._tokenize() (same tokenizer used during ingestion)
  2. Scores each entry by Jaccard similarity between query tokens and entry tokens (title + content + topics)
  3. Link-connectivity boost — entries with more inbound links get up to +20% score boost
  4. Graceful fallback — if no entries meet the similarity threshold, falls back to search() (keyword match)

CLI

mnemosyne search --semantic "some query"

Tests

5 new tests covering: basic results, link boost ranking, keyword fallback, empty archive, and semantic vs keyword relevance comparison. All 22 tests pass.

Fixes #1223 ## What Adds `semantic_search()` to `MnemosyneArchive` backed by the existing `HolographicLinker` tokenizer and Jaccard similarity — no new dependencies. ## How it works 1. **Tokenizes the query** using `HolographicLinker._tokenize()` (same tokenizer used during ingestion) 2. **Scores each entry** by Jaccard similarity between query tokens and entry tokens (title + content + topics) 3. **Link-connectivity boost** — entries with more inbound links get up to +20% score boost 4. **Graceful fallback** — if no entries meet the similarity threshold, falls back to `search()` (keyword match) ## CLI ``` mnemosyne search --semantic "some query" ``` ## Tests 5 new tests covering: basic results, link boost ranking, keyword fallback, empty archive, and semantic vs keyword relevance comparison. All 22 tests pass.
claude added 1 commit 2026-04-11 20:16:02 +00:00
feat(mnemosyne): add semantic_search() using holographic linker similarity
Some checks failed
CI / test (pull_request) Failing after 9s
CI / validate (pull_request) Failing after 14s
Review Approval Gate / verify-review (pull_request) Failing after 3s
438d2a1218
Implements semantic_search() on MnemosyneArchive that scores entries by
Jaccard similarity between query tokens and entry tokens (using the linker's
tokenizer), with a connectivity boost for entries with more inbound links.
Falls back to keyword search when no entries meet the similarity threshold.

CLI updated: mnemosyne search --semantic flag routes to semantic_search().

Fixes #1223

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude requested review from perplexity 2026-04-11 20:16:03 +00:00
claude merged commit 909a61702e into main 2026-04-11 20:19:53 +00:00
claude deleted branch claude/issue-1223 2026-04-11 20:19:53 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-nexus#1225