← Back to archive

Repo of the Day

not-pizza/victor

Published: Jun 29, 2025

Open repository ↗

Web-optimized vector database (written in Rust). When using this in the browser it uses WASM and the origin private file system to store files. Really interesting and kind of a cool idea. I could do vector embeddings client side, get the results and send them to a prompt for llm without any vector db running server side. Might try this out one of these days.

Summary

Victor is a vector database written in Rust that targets both native and browser environments through a WASM build. It exposes two APIs (a Rust API using the local filesystem or an in-memory filesystem, and a JavaScript API using the browser's Private Origin File System) and includes a PCA-based compression path for shrinking stored vectors when space is constrained.

What it is useful for

Engineers who need to store and search embeddings directly in the browser without sending vectors to a server. The README's storage figure is concrete: a 1536-dimensional vector takes 1.5 KB in Victor's packed format versus 20.6 KB when naively JSON-encoded, which matters for OPFS-backed apps where quota can be tight. The tag-filtering surface (db.search(embedding, ["tags"], 10)) is useful when you want coarse pre-filtering before nearest-neighbor search, for example narrowing semantic results to a specific document collection or category. The Rust API, which can auto-embed text via fastembed-rs using the BAAI/bge-small-en-v1.5 model, is more useful for CLI tools, native experiments, and the WASM build pipeline itself.

How engineers can use it

JavaScript (browser): Install with npm install victor-db. The README shows instantiating Db with await Db.new(), inserting with await db.insert(content, embedding, tags), and searching with await db.search(embedding, tags, k). The JS API takes a Float64Array embedding, so you supply vectors yourself; the README points to www/ for a fuller example that fetches embeddings from OpenAI.

Rust (native): Install with cargo add victor-db. The example uses victor_db::native::Db backed by a path, calls add(docs, tags) to insert, and search(query, tags, k) to retrieve. Documents are embedded automatically through fastembed-rs; you can run the example with cargo run --example native_filesystem after cloning.

Building the WASM package: Install wasm-pack, then wasm-pack build --target web. The browser demo lives in www/ and is started with npm i followed by npm run start.

Documented limitations: The repository declares NOASSERTION for its license, so reuse terms are not clarified in the source. No performance benchmarks, indexing algorithms, or scale limits are documented beyond the per-vector storage figure, so for production sizing you would need to test directly against the README's example. Setup details beyond the above are not provided, so consult the README for the latest instructions.