Library / SDK
usemoss/moss avatar
usemoss/moss

Moss: an in-process retrieval runtime that trades a vector database for a loaded index

The retrieval layer for production AI systems. Lightning-fast (<10ms) search without vector databases. Built for browser, edge, on-device, and cloud.

679 stars97 forksPythonBSD-2-Clause

At a glance

What is it?
Moss is a Python-first SDK that embeds semantic and keyword search inside your process instead of calling a remote vector database. The pitch is latency in the single-digit milliseconds, and the cost is that you stop treating retrieval as a database problem.
Who is it for?
Adopt Moss if your agent loop already holds the corpus in memory and the network round trip is the thing breaking your latency target, and if you can accept that the index is loaded rather than queried remotely. Do not adopt it if you need a shared, multi-writer store that several services mutate concurrently, because the README describes a runtime you load an index into, not a database with replication semantics.
Can I use it commercially?
Yes. BSD-2-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 7 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The round trip Moss is trying to delete

The README states the problem directly: most retrieval stacks call out to a remote vector database, and the round trip alone runs 200 to 500 ms, which it calls enough to break a real-time conversation. That framing is narrower than general RAG. It targets conversational agents, voice bots, and copilots where a human is waiting on the other end of the turn, and where a few hundred milliseconds of retrieval latency is audible. Moss runs search and embedding inside your process, so there is no network hop on the hot path. The intended user is the engineer wiring retrieval into a latency-sensitive loop, not the team building an offline document pipeline. The repository topics reinforce this: voice-ai, real-time, ai-agents, retrieval.

What actually runs when you call query

The architecture visible in the material is a client object bound to a project, an index created from a list of documents, and a load step before querying. The Python quickstart creates a client with a project_id and project_key, calls create_index with a name and a list of objects carrying id and text, then calls load_index, then query with a QueryOptions(top_k=3). Results come back with a score per document and a time_taken_ms field on the result set. The load step is the part that separates Moss from a database client: the index is brought into the process before queries run, which is consistent with the README's claim that search and embedding happen in-process. Hybrid retrieval combines semantic and keyword matching in a single query, and metadata filtering uses operators listed as $eq, $and, $in, and $near. Embedding models are built in, so no external embedding key is required, though the examples directory includes custom_embedding_sample.py and custom_embedding_sample.ts for bringing your own. The README also describes a separate WebAssembly SDK, @moss-dev/moss-web, for client-side search with no server, and a C library, libmoss, distributed through GitHub releases.

Install and first query, in the order the README gives them

Python is pip install moss, and the README puts the floor at Python 3.10 or Node.js 20 or above. The TypeScript package is @moss-dev/moss, installed with npm install. Before any of that, the quickstart says to sign up at moss.dev for a project_id and project_key, and notes a free tier. The client constructor takes those two strings. Index creation takes a name and a list of documents, each with an id and a text field. Querying takes the index name, the query string, and an options object (top_k in Python, topK in TypeScript). The README's own example asks how long refunds take and prints each returned document with its score formatted to three decimals. The repository also ships a CLI under packages/moss-cli for managing indexes and querying from the terminal, and database connectors under packages/moss-data-connector for ingesting from SQLite, MongoDB, MySQL, and Supabase. If your corpus already lives in one of those four, the connector path avoids hand-building the document list.

The benchmark table, and what it does not cover

The README publishes end-to-end query latency on 100,000 documents, 750 measured queries, top_k=5, on an M4 Pro MacBook with 24GB, and reports Moss at 3.1 ms P50 and 5.4 ms P99 against Pinecone at 432.6 ms P50 and Qdrant at 597.6 ms P50. Two footnotes matter more than the numbers. First, Moss includes embedding in the measurement while the competitors use an external embedding service, so the comparison is not like for like on that axis. Second, Pinecone and Qdrant are measured against cloud search, which means the gap is largely the network hop the project exists to remove. The honest reading is that the table demonstrates the thesis (in-process beats remote) rather than proving Moss is a faster search algorithm than Qdrant. The README points to a benchmarks directory for reproduction, and that directory is where you should look before quoting any of these figures internally. A single-machine result at 100,000 documents says nothing about behavior at ten million, and the material does not address that scale.

Where the runtime model becomes the wrong tool

The README is explicit that Moss is not a database: you do not manage clusters, tune HNSW parameters, or worry about sharding. That is the selling point and also the constraint. A loaded index means the corpus has to fit wherever the process runs, and the project targets browser, edge, on-device, and cloud, which are memory-constrained environments. The material does not state an upper bound on index size, nor how updates propagate after load_index. If your documents change continuously and several services need to see the change immediately, a runtime you load is a different operational shape than a database you query, and the README does not describe a mechanism for that. The quickstart also depends on a hosted control plane for project credentials, so a fully air-gapped deployment is not something the supplied material supports. Finally, the latency claim is a claim about the hot path. Ingestion, index creation, and loading are separate steps and their cost is not quantified anywhere in the material.

Against pgvector or a managed vector database

The natural alternative is a vector database you already operate, whether that is pgvector inside Postgres or a managed service like Pinecone. The difference is not primarily speed, it is where the data lives. With pgvector, retrieval is a SQL query against a table that your existing backups, migrations, and access controls already cover, and every service that can reach Postgres sees the same data with no load step. You pay a network round trip and you inherit the operational surface of the database. Moss inverts both: no round trip, but the index is process-local and the credentials come from moss.dev. If your retrieval corpus is small, changes rarely, and you already run Postgres, pgvector removes an entire dependency at the cost of latency you may not care about. If your agent is on a phone or in a browser tab and the corpus is bounded, Moss addresses a problem pgvector cannot reach at all, because there is no Postgres on the device. The choice follows from deployment target, not from benchmark position.

Licence, releases, and the cost of staying current

Moss is BSD-2-Clause, a permissive licence that allows modification and redistribution with the copyright notice and disclaimer retained. That matters here because the runtime ships as SDKs in four languages plus a WebAssembly build, and a permissive licence lets you vendor libmoss or the WASM bundle into a client application without a copyleft obligation. This is not legal advice; read the LICENSE file for the actual terms. On maintenance, the repository is not archived and the last push recorded is 2026-09-08. The three most recent releases are v0.6.0, v0.6.1, and v0.6.2, all from 2026-06-29, and all labelled as the Moss iOS SDK, which suggests the release tags in this repository are not tracking the Python or TypeScript SDKs. That is a real friction point for dependency management: if you pin moss in requirements.txt or @moss-dev/moss in package.json, the GitHub release list will not tell you what changed. Check PyPI and npm for the package versions you actually install. The upgrade cost is otherwise low, since the API surface shown is a client, create_index, load_index, and query, but a runtime that loads an index means a version bump can change memory behavior without changing the call signature.

Editorial conclusion

Adopt Moss if your agent loop already holds the corpus in memory and the network round trip is the thing breaking your latency target, and if you can accept that the index is loaded rather than queried remotely. Do not adopt it if you need a shared, multi-writer store that several services mutate concurrently, because the README describes a runtime you load an index into, not a database with replication semantics. Verify two things before committing: that your document count and embedding model fit the memory of every target (browser and edge included), and that the free-tier project_id and project_key path at moss.dev covers your load, since the quickstart assumes both.

Official sources

  1. License: BSD-2-Clause
  2. Project website
  3. README
  4. Releases
  5. usemoss/moss on GitHub
Community notes

Community notes