Skip to main content
Run indexing and queries inside a browser extension using the @moss-dev/moss-web SDK. The background service worker hosts the Moss client and the index; content scripts message the worker to run queries. The index persists in extension storage or IndexedDB, so queries resolve in the browser without a network call and the indexed data stays in the browser. A million 256-dimension vectors compress to roughly 500 MB; most extensions need far less.

Architecture

A browser content script queries a background worker, which owns the Moss client and a local index in IndexedDB or extension storageA browser content script queries a background worker, which owns the Moss client and a local index in IndexedDB or extension storage
  • Background service worker hosts a Moss client (use the browser SDK, @moss-dev/moss-web)
  • Content scripts post messages to the background worker for index/query
  • Persist the index using extension storage or IndexedDB

Example (background worker)

Browser SDK

The in-browser @moss-dev/moss-web client.

Local embeddings

Embed on-device for privacy.