Overview
RuVector is a vector store written in Rust and aimed squarely at one job: giving an agent memory that survives between sessions. It combines local semantic embeddings, persistent vector retrieval, graph relationships between records, explicit feedback learning and memory lifecycle controls in a single embeddable library rather than a server you have to operate.
The default retrieval path runs entirely on the local machine. The first semantic command downloads and caches an all-MiniLM-L6-v2 model, so there is no database server to start and no API key to configure; hosted services are optional and, as the project puts it, create a separate data boundary. Learning is driven by recorded outcomes and feedback rather than by reads alone.
Three interfaces sit on the same core: a Rust crate (ruvector-core), a Node.js package with an OnnxEmbedder and VectorDB class, and an npx-runnable CLI whose hooks subcommands remember and recall directly from the shell. Storage is a file you point at, and reopening the same path recovers the vectors, metadata, configuration and searchability. The project is MIT-licensed.
What it does
- Local semantic embeddings from a bundled ONNX all-MiniLM-L6-v2 model, cached on first use — no embedding API required
- Persistent on-disk store: reopen the same path in another process and vectors, metadata and configuration come back
- Metadata filters and graph relationships alongside plain similarity search, so recall can be scoped by tenant, kind or time
- Feedback learning that adapts ranking from recorded outcomes rather than from reads
- Three surfaces over one engine — Rust crate, Node.js package and an npx CLI with remember/recall hooks
- Memory lifecycle controls and optional shared memory for multi-agent setups
Getting started
Nothing needs to be installed or provisioned to try it: the CLI runs through npx and needs no database server or API key.
Remember and recall from the shell
The first semantic command downloads and caches the local embedding model. Memory is stored under the current project and stays available to later processes.
npx ruvector hooks remember --semantic --type decision \
"The customer requires all inference to remain in Canada."
npx ruvector hooks recall --semantic --top-k 3 \
"Where may customer data be processed?"Inspect the store
Keep one embedding model and dimension per store; run reembed before switching an existing store from hash to semantic embeddings.
npx ruvector hooks statsEmbed it in Node.js
Initialise the embedder, open a VectorDB at a storage path, insert vectors with metadata, then search with a filter. Scores are distances, so lower is closer.
const { OnnxEmbedder, VectorDB } = require('ruvector');
const embedder = new OnnxEmbedder();
await embedder.init();
const db = new VectorDB({
dimensions: 384,
distanceMetric: 'cosine',
storagePath: './agent-memory.db',
});
const vector = await embedder.embedPassage('The Toronto pilot passed its privacy review on Tuesday.');
await db.insert({ id: 'episode-1', vector, metadata: { tenant: 'acme' } });
const query = await embedder.embedQuery('Where may the customer data be processed?');
const results = await db.search({ vector: query, k: 3, filter: { tenant: 'acme' } });Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Add cross-session memory to a coding agent without standing up a vector database service
- Keep embeddings and recall entirely on the local machine when the data cannot leave it
- Store decisions, episodes and procedures as typed records and retrieve them by similarity plus metadata filters
- Build a Rust agent that needs an embedded vector index rather than a network hop per query
How RuVector compares
RuVector alongside other open-source vector databases tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Supabase | ★ 110k | Managed Postgres backend whose Vector toolkit (pgvector) stores, indexes, and queries embeddings next to transactional data. |
| Redis Cloud | ★ 76.4k | Fully-managed Redis with built-in vector search, offering low-latency similarity and hybrid queries over any embeddings. |
| Milvus | ★ 46.2k | A distributed vector database for storing and searching billions of embeddings at scale, with multiple index types and Kubernetes-native deployment. |
| FAISS | ★ 40.9k | A library from Meta for efficient similarity search and clustering of dense vectors, with both exact and approximate indexes. |
| Qdrant | ★ 34.7k | A Rust-based vector search engine that stores embeddings with rich payload filtering for semantic search and recommendation systems. |
| Chroma | ★ 29.3k | A developer-focused vector database designed for quickly building retrieval and RAG features with a simple Python and JavaScript API. |
| pgvector | ★ 23.1k | A PostgreSQL extension that adds a vector data type and similarity search so you can store and query embeddings inside an existing Postgres database. |
| RuVector | ★ 4.5k | A Rust vector store built as persistent memory for agents |