A browser-side RAG demo — retrieval-augmented generation that runs embeddings
entirely in the browser via transformers.js
(@xenova/transformers). No backend, no API keys, no server round-trips.
React 19 · Vite · TypeScript · transformers.js (WASM/WebGPU embeddings)
npm install
npm run download-model # fetch the embedding model locally
npm run dev # http://localhost:5173- An embedding model is loaded in-browser via transformers.js.
- Documents are chunked and embedded client-side.
- A query is embedded and matched against the chunks by cosine similarity.
- The top chunks are surfaced as retrieval context.
Everything happens on the client — useful for privacy-sensitive RAG, offline demos, and zero-infra prototypes.