Front end-only live semantic search with transformers.js (do-me.github.io)

🤖 AI Summary
transformers.js now enables true front-end–only semantic search: embeddings and cosine-similarity ranking run entirely in the browser so no server-side inferencing or data uploads are required. Users can paste text or load PDFs/web pages, set chunk sizes for finer or coarser matching, and index large books that become searchable in under two seconds. A WebGPU-accelerated build is offered for best performance, and a catalogue of pre-indexed examples (The Bible, Les Misérables, IPCC Report 2023, etc.) is available on Hugging Face. This is significant because it brings privacy-preserving, low-latency semantic search to anyone with a modern browser—reducing cloud costs, eliminating data exfiltration concerns, and enabling offline or client-only workflows. Key technical takeaways: embeddings are computed client-side (no back end), similarity is measured with cosine distance, chunking controls granularity of retrieval, and WebGPU/WebAssembly execution accelerates throughput. The project is open on GitHub and invites contributions of document indices or source URLs, making it easy to share prebuilt indexes while keeping raw data local. Practical limits remain tied to local device memory and compute, but for many use cases this is a lightweight, accessible way to deploy semantic retrieval without servers.
Loading comments...
loading comments...