alibaba/zvec
In-process C++ vector database for local hybrid retrieval
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Zvec is a persistent, in-process retrieval engine, not a standalone database service. The C++ core lives under src/, with a top-level CMakeLists.txt and Python integration under python/. Python calls the native engine through pybind11. The Python flow is schema-first: declare the collection and vector field, open a collection at a filesystem path with zvec.create_and_open, insert zvec.Doc records, then query a field with zvec.Query and topk.
The host application supplies embeddings; Zvec handles local storage and retrieval. Write-ahead logging supports durability, and multiple processes can read the same collection while writes are exclusive to one process. SDKs give applications a way to embed the engine in different runtimes. If retrieval must be shared over the network, the application needs to expose and operate that service boundary.
Key Capabilities & Differentiators
Zvec supports dense and sparse embeddings, multi-vector queries, and hybrid retrieval that combines vector similarity, native full-text search, and structured filters. Full-text search runs on string fields and accepts natural-language or structured expressions. Since v0.8.0, the default Jieba dictionary and HMM model ship together, so Chinese tokenization needs no separate dictionary deployment.
HNSW, IVF, and DiskANN give teams index choices across memory- and disk-oriented workloads. v0.8.1 adds PQ4/PQ8 and optional OPQ to HNSW and IVF, covering training, search, persistence, and later updates. The cited GIST 1M benchmark setup uses L2 distance, INT8 quantization, and HNSW on a 16-core Linux ARM64 system. Treat that as one configuration, not a latency forecast for different data, hardware, or filters.
Trade-offs & Limitations
Compared with managed Pinecone, Zvec removes the network hop between the application and retrieval engine and lets you keep the collection local. The trade-off is ownership: your team provisions storage, tests backup and restore, and coordinates writes. Multiple reader processes do not imply multiple writers. If several services must ingest into one corpus, route updates through a designated writer or choose a deployment model that handles shared writes for you.
The engine also consumes resources on the same host as the application. Size for build and merge peaks as well as steady-state queries, and measure recall on representative queries before choosing a quantizer. Uniform quantization can speed search, but a shared min/max range can introduce more error and lower recall. The Python package is classified as Alpha; before a production rollout, exercise crash recovery and upgrades under your intended reader/writer workload.
Hardware & Deployment Guide
The shortest Python path is pip install zvec, followed by opening a collection on a writable local path. Use a supported 64-bit interpreter: installation guidance lists Python 3.10–3.14, while pyproject.toml declares a >=3.9 lower bound. Check wheel availability for the exact Python version, OS, and architecture rather than assuming that the metadata guarantees a compatible build. Java requires Java 8 or newer; official SDKs are also available for Node.js, Go, Rust, and Dart/Flutter.
There is no separate database daemon to deploy for embedded use. Retrieval can run offline if the collection and any upstream embedding dependencies are available locally. v0.8.0 added Intel Mac and Windows ARM64 builds, wheels, and SDKs, and reduced peak memory during IVF and DiskANN builds and merges. v0.8.1 expanded RaBitQ coverage to more platform combinations. Check the feature-level platform matrix before standardizing on an index or quantizer.
Local RAG, desktop or edge search, and application-owned retrieval where a designated writer can maintain the collection and hybrid search should run without a separate database service.
Multiple services need to write independently to a shared corpus, or you need a managed remote database and do not want to own storage, recovery, and write coordination.
Quick Start & Installation
import zvec # Define collection schema schema = zvec.CollectionSchema( name="example", vectors=zvec.VectorSchema("embedding", zvec.DataType.VECTOR_FP32, 4), ) # Create collection collection = zvec.create_and_open(path="./zvec_example", schema=schema) # Insert documents 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]}), ]) # Search by vector similarity results = collection.query( zvec.Query(field_name="embedding", vector=[0.4, 0.3, 0.3, 0.1]), topk=10 ) # Results: list of {'id': str, 'score': float, ...}, sorted by relevance print(results)
Comparison vs. Top RAG, Data & Memory Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| zvec ★ | 16.3k | +29 | C++ | Apache-2.0 | In-process C++ vector database for local hybrid retrieval |
| weaviate | 17k | +17 | Go | — | Go vector database for filtered hybrid retrieval in production RAG stacks |
| qdrant | 35.9k | +135 | Rust | Apache-2.0 | Rust vector database for filtered and hybrid RAG retrieval |
| LightRAG | 41k | +110 | Python | MIT | Graph-backed RAG for cross-document retrieval and multimodal indexing |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/alibaba/zvec.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about zvec
How do I wire Zvec into an existing RAG pipeline?
zvec.create_and_open(...) with a local path, insert zvec.Doc records, and query with zvec.Query(...) and topk. The application supplies embeddings and passes retrieved results to the rest of the RAG pipeline; this integration does not require a separate database endpoint.Does Zvec need a GPU, and what should I measure for sizing?
Can we embed Zvec in a commercial product and keep the data on our own infrastructure?
When should we choose Pinecone instead of Zvec?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy