feat(mnemosyne): add semantic search using holographic linker similarity #1224

Closed
Rockachopa wants to merge 1 commits from feat/mnemosyne-semantic-search into main
Owner

Closes #1223

Changes

  • archive.py: Added semantic_search() method that scores entries by Jaccard similarity between query tokens and entry tokens, boosted by link connectivity (back-link count) and topic overlap
  • cli.py: Added --semantic flag to mnemosyne search command — shows relevance scores alongside results
  • test_archive.py: 5 new tests covering scored results, similarity ranking, link boost, empty archive, and threshold filtering

How it works

  1. Tokenizes the query using the HolographicLinker's tokenizer
  2. Computes Jaccard similarity between query tokens and each entry's tokens
  3. Boosts score by link connectivity — entries with more back-links (more "holographic") rank higher
  4. Adds topic overlap bonus when query matches entry topic tags
  5. Returns (entry, score) tuples sorted by combined relevance

Tests

All 22 tests pass (17 existing + 5 new).

Closes #1223 ## Changes - **`archive.py`**: Added `semantic_search()` method that scores entries by Jaccard similarity between query tokens and entry tokens, boosted by link connectivity (back-link count) and topic overlap - **`cli.py`**: Added `--semantic` flag to `mnemosyne search` command — shows relevance scores alongside results - **`test_archive.py`**: 5 new tests covering scored results, similarity ranking, link boost, empty archive, and threshold filtering ## How it works 1. Tokenizes the query using the `HolographicLinker`'s tokenizer 2. Computes Jaccard similarity between query tokens and each entry's tokens 3. Boosts score by link connectivity — entries with more back-links (more "holographic") rank higher 4. Adds topic overlap bonus when query matches entry topic tags 5. Returns `(entry, score)` tuples sorted by combined relevance ## Tests All 22 tests pass (17 existing + 5 new).
Rockachopa added 1 commit 2026-04-11 20:15:27 +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 2s
7e40d909bd
Closes #1223

- semantic_search() on MnemosyneArchive: Jaccard similarity + link connectivity boost + topic bonus
- CLI: mnemosyne search --semantic flag shows relevance scores
- 5 new tests: scored results, ranking, link boost, empty archive, threshold filtering
Rockachopa requested review from perplexity 2026-04-11 20:15:27 +00:00
Owner

🤖 Timmy PR Review Bot

This PR has merge conflicts with main. Please rebase or resolve conflicts.

🤖 **Timmy PR Review Bot** This PR has merge conflicts with `main`. Please rebase or resolve conflicts.
claw-code was assigned by Rockachopa 2026-04-11 20:58:14 +00:00
Owner

Blocked: merge conflicts

This PR reports mergeable=False, indicating conflicts with the current main branch. Please rebase onto the latest main to resolve.

To check conflicts locally:

git fetch origin main
git merge-base --is-ancestor origin/main 7e40d909bd07 || echo "needs rebase"

Once conflicts are resolved and the branch is pushed, this PR can be reviewed for merge.

**Blocked: merge conflicts** This PR reports `mergeable=False`, indicating conflicts with the current `main` branch. Please rebase onto the latest `main` to resolve. To check conflicts locally: ```bash git fetch origin main git merge-base --is-ancestor origin/main 7e40d909bd07 || echo "needs rebase" ``` Once conflicts are resolved and the branch is pushed, this PR can be reviewed for merge.
Owner

Blocked: Merge conflict. This PR has mergeable: false — it conflicts with the current main branch. The PR needs to be rebased or have conflicts resolved before it can be merged.

**Blocked: Merge conflict.** This PR has `mergeable: false` — it conflicts with the current `main` branch. The PR needs to be rebased or have conflicts resolved before it can be merged.
Owner

Additional issue: Contains __pycache__/*.pyc files.

This PR adds compiled Python bytecode files that should not be tracked in version control. Remove them before resolving merge conflicts.

**Additional issue: Contains `__pycache__/*.pyc` files.** This PR adds compiled Python bytecode files that should not be tracked in version control. Remove them before resolving merge conflicts.
Member

Closing: Superseded by merged PR #1225 ([claude] Mnemosyne: semantic search via holographic linker similarity). Same feature delivered via the [claude] automated PR flow.

Closing: Superseded by merged PR #1225 ([claude] Mnemosyne: semantic search via holographic linker similarity). Same feature delivered via the [claude] automated PR flow.
perplexity closed this pull request 2026-04-12 03:44:29 +00:00
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 2s

Pull request closed

Sign in to join this conversation.
No Reviewers
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/the-nexus#1224