ferroveclive demo ← Overview GitHub

Real WASM · no server · no network

Semantic search, running entirely in this browser tab.

Everything below is the actual ferrovec Rust→WebAssembly core — the same 77 KB crate published to npm — doing live approximate-nearest-neighbour search over 24 sentence embeddings. The WASM binary and the vectors are baked into this single HTML file. Nothing is fetched; close your Wi-Fi and it still works.

statusbooting WASM… core77 KB wasm dims vectors metriccosine

Search

pick a query →

These queries are pre-embedded with all-MiniLM-L6-v2. Click one — the ranking is computed live by the WASM core, not looked up. Note how matches share almost no words with the query.

  • Pick a query above to run the WASM core.

The index

24 notes

    How this runs with zero backend

    01 · the core

    Rust → WASM, inlined

    The published ferrovec crate compiled to a 77 KB .wasm, base64-embedded in this page and instantiated with WebAssembly.instantiate. The HNSW graph, SIMD distances and search all execute in your browser's WASM sandbox.

    02 · the vectors

    MiniLM embeddings

    Each note was embedded once with all-MiniLM-L6-v2 (384-dim, mean-pooled, normalised) and stored as plain numbers in the page. In a real app, transformers.js does this in a Web Worker on the fly.

    03 · the search

    Live k-NN ranking

    On each query the core walks the HNSW graph and returns the nearest neighbours by cosine similarity — in well under a millisecond — exactly as it would over millions of vectors on a server or the edge.

    // In a real app the same core drives a three-line API (npm: ferrovec):
    import { Ferrovec } from 'ferrovec';
    
    const db = await Ferrovec.open('notes');        // worker + model + OPFS
    await db.insert('the cat curled up in the sun'); // embed + index
    const hits = await db.query('a sleepy kitten', 5); // → ranked, nearest-first