Semantic vector search in the browser. No backend, no API keys.
init
architecture
Main Thread Web Worker Application Code search('query', corpus) → [{ text, score, index }] index.ts Public API search() similarity() embed() Semvec WeakMap cache check semvec.ts Pipeline Orchestrator init queue · corpus mgmt · add/remove texts[] chunker.ts Auto ≤256 tok: pass · >256: split engine.ts Inference lazy singleton · q8 dtype postMessage @huggingface/transformers ONNX Runtime · Tokenizer WebGPU ↔ WASM fallback Arctic-Embed-S 33M params · 384-dim · 30 MB worker.ts RPC Blob URL · Transferable Float32Array Browser Cache API Model binary cached after first download math.ts Scoring cosineSim · topK · L2norm embeddings[] store.ts Persistence namespace + model scoped IndexedDB or in-memory content-hash keyed errors.ts SemvecError MODEL_OFFLINE · FETCH_FAILED ingest.ts Semvec.fromURL() JSON · Markdown · text · auto-detect Data flow: query → chunk → embed (worker) → cosine rank → results sync async / data