Skip to content

feat(search): client-side hybrid lexical + semantic tool search - #12

Merged
nx10 merged 1 commit into
mainfrom
feat/semantic-tool-search
Jun 8, 2026
Merged

feat(search): client-side hybrid lexical + semantic tool search#12
nx10 merged 1 commit into
mainfrom
feat/semantic-tool-search

Conversation

@nx10

@nx10 nx10 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Upgrade the QuickSelector from boolean substring matching to a hybrid
search that blends lexical relevance with semantic (embedding cosine)
ranking, so capability/synonym queries ("skull strip" -> fsl/bet,
"remove noise" -> ants/DenoiseImage) work, not just exact names.

- New src/lib/services/search/: lexical scoring, a pure cosine+blend core
  (kept DOM/Svelte-free so it can later move to a shared package both the
  hub and niwrap-mcp import), a version-keyed index loader that validates
  the matched-pair invariant, and an embedder worker (transformers.js,
  Xenova/all-MiniLM-L6-v2) that lazily loads the model on first search.
- Tool vectors are fetched from the published per-version embeddings
  artifacts on Pages (see niwrap-mcp/docs/embeddings-contract.md); every
  failure path degrades to lexical.
- On-by-default, opt-out gating: capable desktops auto-run semantic;
  mobile/save-data/slow/low-memory default to lexical. Auto/On/Off toggle
  persisted to localStorage.
- Lexical renders instantly; the list upgrades to the blended ranking
  when the query embedding resolves (debounced, stale-query guarded).
- Catalog store now exposes tool refs (with descriptions) + the
  embeddings announce.
@nx10
nx10 merged commit 85f4450 into main Jun 8, 2026
4 checks passed
@nx10
nx10 deleted the feat/semantic-tool-search branch June 8, 2026 21:05
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