do-me/SemanticFinder: SemanticFinder - frontend-only live semantic search with transformers.js
Summary
SemanticFinder is a browser-only semantic search and chat-with-your-documents app built on transformers.js, with Wasm and WebGPU backends.
Embeddings never leave the browser.
transformers.js runs feature-extraction models locally; Wasm covers the model set, WebGPU is the fast path.
Calculates the embeddings and cosine similarity client-side without server-side inferencing
Data privacy-friendly - your input text data is not sent to a server, it stays in your browser!
Segment size trades recall for speed.
Longer chunks finish faster; only changing segment length forces a full re-embed because embeddings are cached per segment.
Pre-indexed catalogues beat cold starts.
Shared JSON.gz indices for large books let subsequent queries finish in about two seconds after the model loads.
Following queries take only ~2 seconds!
Hybrid search and a threshold gate results.
Semantic plus full-text ranking, with a similarity cutoff deciding how many highlights appear.
For libraries, use a real vector DB.
Moby Dick-scale one-shot indexing works in-browser; sustained multi-book libraries need an external vector store.
Read the original ↗Save to your Sponge
Summarized with Sponge. Quotes are the author’s own words.