Skip to main content
Moss loads an index into memory and runs embedding and search in-process, so a query is a local call with no network round trip per operation. The pattern is the same in every SDK: load the index once, then query it.
Queries run against the in-memory index and embed the query text with a local model.

The query pipeline

Query text is embedded locally, retrieved from an in-process loaded index, optionally reranked, and returned as resultsQuery text is embedded locally, retrieved from an in-process loaded index, optionally reranked, and returned as results
  • Load the index once, then query it in-process.
  • Optional background sync to the cloud.
  • Query pipeline: text -> embed -> retrieve -> rerank (optional).

Prerequisites

  • Node.js 18+ or Python 3.10+
  • Moss credentials: MOSS_PROJECT_ID, MOSS_PROJECT_KEY
  • An index to query (create faqs via the Quickstart if you don’t have one yet)

Steps

1

Export credentials (and index if different)

2

Ensure the index exists

Ensure the index exists (see Quickstart to create faqs).
3

Run one of the snippets below

Run one of the snippets below.

Run the sample (JavaScript or Python)

The sample loads your index into memory and returns the top matches. An index must be loaded with loadIndex / load_index (or opened as a session) before you can query it.