Rostam¶
A high-performance vector database and sub-microsecond key-value store in a single Go engine — run it as a standalone server, replicate it across a Raft cluster, or embed it directly in your binary with no server at all.
At matched recall it serves ~2× the queries of Milvus and pgvector and ~4× Qdrant, with the fastest load in the set (1M × 768d in 282 s) and the highest recall measured — under VectorDBBench, a neutral third-party harness. See the full comparison.
REST, gRPC and a binary TCP protocol. Talk to it from Python or any language. → Running the server
Per-shard Raft, online resharding, backups to S3, RBAC/JWT/mTLS. → Clustering
Import it into a Go binary. No server, no cgo required. → Deployment modes
Rostam is one Go module that ships two engines:
- Vector search engine (
vector/) — HNSW, IVF, and Vamana indexes with quantization (int8, binary, PQ), hybrid dense+sparse search, BM25 full text, and metadata filtering with an exact filter-first query planner. Depends on nothing else in the repo — vendor it as a pure vector library. - Key-value store (
kv/) — a sharded in-memory store with zero-copy reads, TTL, mmap persistence, optional per-shard Raft replication, and server-side stored procedures (native Go or sandboxed WASM).
Both engines are built for the latency-sensitive end of the spectrum: reads are zero-copy and lock-light, hot paths are allocation-free, and the distance kernels are hand-vectorized (AVX2 with scalar fallback).
Status
Rostam is in beta: actively developed and tested (race-clean, benchmarked). APIs may still change ahead of a 1.0 release.
Choose your entry point¶
| I want to… | Start here |
|---|---|
| Add vector search to a Go program (no server) | Quickstart → Embedded vector search |
| Use a fast in-process KV cache / store in Go | Quickstart → Embedded key-value store |
| Run Rostam as a server and talk REST/gRPC | Quickstart → Run the server |
| Use Rostam from Python | Python client |
| Run a replicated multi-node cluster | Clustering |
| Understand how it all fits together | Architecture |
Feature highlights¶
Vector side
- HNSW index with AVX2 dot/L2 kernels and an allocation-free search path; IVF, Vamana (DiskANN-style), and an optional CUDA exact-KNN index
- Quantization: scalar int8 (4× smaller), binary (32× smaller), PQ/PRQ — all with an exact float32 rescore stage; codes can live in RAM or a memory-mapped file
- Hybrid search: dense + sparse lanes fused via RRF, weighted blend, or DBSF; BM25 full-text search with pluggable analyzers
- Metadata filtering with 22 operators (equality, ranges, datetime, geo, regex) and a payload index + query planner: selective filters take an exact filter-first path instead of degrading graph recall
- Query API: MMR diversified retrieval, recommendation (± examples), discovery (context pairs), group-by, scroll with order-by, multi-stage fusion/rerank
- Three collection families: dense single-vector, multi-vector late interaction (ColBERT-style MaxSim), and named-vector multi-space (Qdrant-style)
- Multi-tenancy, API-key/RBAC/JWT/mTLS auth, per-collection quotas and rate limits, TTL, snapshot/restore, S3 cold tier, Prometheus metrics
Key-value side
- Sharded in-memory store with a slab-pool allocator: ~29 ns
Get, allocation-freeGetInto - Atomic server-side ops: built-in
incrandexpire, plus your own native Go ops or sandboxed, fuel-capped WASM procedures shipped over the wire - mmap-backed persistence with warm restart; per-shard Raft replication with online resharding; smart TCP client with leader routing
Documentation map¶
- Quickstart — install, first search, first KV call, run the server
- Concepts — Architecture · Deployment modes · Collections, tenants & aliases
- Vector engine — Collections & indexes · Search · Filtering · Hybrid & full-text · Quantization · Persistence
- Key-value store — Overview · Custom ops · WASM procedures · Cache tuning
- Server & operations — Running the server · Clustering · Security · Backups & cold tier · Monitoring
- API reference — HTTP · gRPC · Go client · Python client
- Performance · Development
License¶
Rostam is open source under the
Apache License 2.0 —
use, embed, modify, run in production, or offer as a service, with an explicit
patent grant. Redistribution carries the usual Apache-2.0 conditions: a copy of
the licence, the NOTICE file, the existing notices, and a mark on files you
changed.
"Rostam" and the Rostam logo are trademarks of RostamLabs; the licence grants no trademark rights.