alibaba/zvec
A lightweight, lightning-fast, in-process vector database
📚 What is Zvec?
Zvec is an open‑source, in‑process vector database created by Alibaba. It lets you store embeddings (dense or sparse) and run ultra‑fast similarity searches directly inside your application – no external server, no complex deployment. It also includes native full‑text search and hybrid queries that combine vector similarity, keyword matching, and structured filters.
⭐ Core Features (as described in the README)
- Blazing‑fast ANN search – billions of vectors can be queried in milliseconds using a variety of index types (HNSW, IVF‑RaBitQ, PQ‑INT8, etc.).
- Dense & sparse embeddings – supports both FP32 vectors and sparse representations, and multi‑vector queries.
- Hybrid search – fuse vector similarity, full‑text (BM25/N‑gram) and structured filters in a single query.
- Durable storage – write‑ahead logging guarantees persistence even after crashes.
- Concurrent reads – many processes can read a collection simultaneously; writes are exclusive to one process.
- Cross‑platform – works on Linux (x86_64 & ARM64, glibc & musl), macOS (Intel & Apple‑silicon) and Windows. Pre‑built SDKs are also available for Android and iOS.
- Language SDKs – Python, Node.js, Go, Rust, Dart/Flutter.
- CLI & UI tools –
zvec-grep(a local‑first search CLI) and Zvec Studio (a visual browser/debugger).
🚀 Quick‑Start (Python example from the README)
import zvec
schema = zvec.CollectionSchema(
name="example",
vectors=zvec.VectorSchema("embedding", zvec.DataType.VECTOR_FP32, 4),
)
collection = zvec.create_and_open(path="./zvec_example", schema=schema)
collection.insert([
zvec.Doc(id="doc_1", vectors={"embedding": [0.1, 0.2, 0.3, 0.4]}),
zvec.Doc(id="doc_2", vectors={"embedding": [0.2, 0.3, 0.4, 0.1]}),
])
results = collection.query(
zvec.Query(field_name="embedding", vector=[0.4, 0.3, 0.3, 0.1]),
topk=10,
)
print(results) # → list of {'id': str, 'score': float, ...}
The snippet shows how to define a collection, insert a couple of vectors, and run a similarity query in just a few lines.
📦 Installation
| Language | Command |
|---|---|
| Python | pip install zvec (Python 3.10‑3.14, 64‑bit) |
| Node.js | npm install @zvec/zvec |
| Go | Use the bindings at github.com/zvec-ai/zvec-go |
| Rust | cargo add zvec-rust |
| Dart/Flutter | flutter pub add zvec |
Pre‑built dynamic libraries are provided for all major OS/CPU combos, and the project can also be built from source (see the docs).
📈 Performance & Benchmarks
The README highlights a benchmark image showing millisecond‑level latency for 10 M‑vector collections. Detailed methodology and results are available in the online Benchmarks documentation.
🤝 Who Might Use Zvec?
- LLM‑powered applications that need a local vector store for retrieval‑augmented generation, chat‑bot memory, or semantic search.
- Edge or mobile apps where running a separate server is impractical; the in‑process library fits on devices.
- Data‑science notebooks that want fast similarity lookup without network overhead.
- Hybrid search workloads where you need both keyword matching and embedding similarity in one query.
🌐 Community & Contributions
- Official docs, quick‑start guide, and benchmark pages are hosted at zvec.org.
- Community channels: Discord, DingTalk, WeChat, and a X (Twitter) account.
- Contributions are welcomed via the standard GitHub workflow; a CONTRIBUTING guide is provided.
📌 TL;DR
Zvec is a production‑grade, in‑process vector database that combines high‑speed ANN search, full‑text capabilities, and durable storage, with ready‑to‑use SDKs for the major programming languages. It’s designed for developers who want to embed vector search directly into their apps—whether on servers, notebooks, or edge devices—without managing a separate database service.
Related
- Project
- Project
- Project
- Project
- Project