Skip to main content
@moss-dev/moss-web brings semantic search directly into the browser. Queries run locally on WebAssembly, so once an index is loaded there are no server round-trips and no data leaves the device. This is the in-browser, client-side SDK. For server-side (Node.js) workloads, use @moss-dev/moss instead. See Browser vs Node to pick the right one.

Features

  • In-browser vector search with zero network latency once an index is loaded
  • Semantic and hybrid search that goes beyond keyword matching
  • Multi-index support for isolated search spaces
  • Full CRUD for indexes and documents from the browser
  • Privacy-first: queries run entirely in the browser

Install

The package depends on @moss-dev/moss-wasm, which is installed automatically. The WebAssembly module and embedding model download on first use.

Quickstart

Create a client, create an index, load it into the browser, then query it. Querying always requires a loaded index, so call loadIndex before query.
Always call loadIndex before query. Querying runs against an index that has been loaded into the browser; there is no query path that skips loading.

Reference

  • MossClient - the in-browser client: create a client, manage indexes and documents, load indexes locally, and query them.
  • Browser vs Node - when to use the browser SDK versus the Node SDK.