zvec README

The project's README from github.com/alibaba/zvec. As one markdown file: README.md.

English | 中文

zvec logo

Code Coverage Main License PyPI Release Python Versions npm Release

alibaba%2Fzvec | Trendshift

🚀 Quickstart | 🏠 Home | 📚 Docs | 📊 Benchmarks | 🔎 DeepWiki | 🎮 Discord | 🐦 X (Twitter)

Zvec is an open-source, in-process vector database — lightweight, lightning-fast, and designed to embed directly into applications. Battle-tested within Alibaba Group, it delivers production-grade, low-latency and scalable similarity search with minimal setup.

[!Important] 🚀 v0.7.0 (August 24, 2026)

  • zvec-grep (zg): Local-first workspace search that unifies ripgrep, BM25, and vector search behind one CLI — built for humans and AI agents.
  • ReMe integration: zvec is now a file store backend in ReMe, the memory management kit for agents, providing in-process HNSW ANN search.
  • DiskANN productionization: Adds Linux ARM64 / macOS ARM64 support and an io_uring async I/O backend, with automatic fallback to the best available I/O option — no user intervention needed.
  • Index optimization: New IVF-RaBitQ index and PQ-INT8 quantizer; RaBitQ supports runtime AVX2 / AVX512 dispatch, so the same binary automatically picks the best path on each CPU.
  • Deployment experience improved: Prebuilt dynamic libraries slimmed significantly (macOS arm64 C API library 37→22 MB, -40%); new musl libc / Alpine Linux support; prebuilt SDK binaries for Linux (glibc/musl), macOS, Windows, Android, and iOS published with every release.
  • DocIterator: New iterator for streaming full-collection document traversal across C++, C, and Python.
  • Full-text search: New N-gram tokenizer, better suited for phrase, code, and short-text search.

👉 Read the Release Notes | View Roadmap 📍

💫 Features

📦 Installation

Zvec offers official SDKs across multiple languages:

Searching code or documents? Try zvec-grep (zg) — a local-first search CLI that unifies ripgrep, BM25, and vector search, built for humans and AI agents.

Prefer a visual tool? Try Zvec Studio to browse data and debug queries — no code required.

✅ Supported Platforms

🛠️ Building from Source

If you prefer to build Zvec from source, please check the Building from Source guide.

⚡ One-Minute Example

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)

📈 Performance at Scale

Zvec delivers exceptional speed and efficiency, making it ideal for demanding production workloads.

Zvec Performance Benchmarks

For detailed benchmark methodology, configurations, and complete results, please see our Benchmarks documentation.

🤝 Join Our Community

💬 DingTalk 📱 WeChat 🎮 Discord X (Twitter)
DingTalk QR Code WeChat QR Code Discord X (formerly Twitter) Follow
Scan to join Scan to join Click to join Click to follow

❤️ Contributing

We welcome and appreciate contributions from the community! Whether you're fixing a bug, adding a feature, or improving documentation, your help makes Zvec better for everyone.

Check out our Contributing Guide to get started!

zvec (alibaba/zvec)

Searching Database…

16.1K ·GitHub
这是什么?阿里巴巴开源的进程内向量数据库——一个轻量、极速的相似度搜索引擎,可直接嵌入你的应用中,并已在阿里巴巴集团内部经过长期实战检验。
那这是需要部署的服务器,还是嵌在我应用里的东西?它是一个库,不是服务器:以进程内方式运行,纯本地、零配置,代码跑在哪里它就在哪里工作——笔记本、服务器、命令行工具,甚至边缘设备都行。
怎么把它加到项目里?安装官方 SDK 即可:pip install zvec(64 位 Python 3.10-3.14)、npm install @zvec/zvec、cargo add zvec-rust、Go 绑定,或 flutter pub add zvec。Zvec Studio 还能让你不写代码就浏览数据、调试查询。
需要先安装别的东西吗?只需要你所用 SDK 对应的运行环境——比如 pip 包需要 64 位 Python 3.10-3.14。不需要单独的数据库服务器、服务或配置文件。
我的多个服务能同时写同一个 collection 吗?不行——写入是单进程独占的:多个进程可以同时读取一个 collection,但只能有一个进程写入。数据安全本身有保障,因为 WAL 能保证在崩溃和断电后数据不丢失。
它能在哪些平台上运行?支持 Linux(x86_64 和 ARM64,glibc 及 musl/Alpine)、macOS(ARM64 和 x86_64)和 Windows(x86_64);每个版本都附带 Android 和 iOS 的预编译 SDK 二进制包。
我的数据会离开我的电脑吗?什么都不会离开你的电脑。Zvec 是纯本地的,没有任何服务器——所有索引和搜索都在你自己的进程里完成。
它到底支持哪些搜索方式?支持稠密和稀疏向量的多向量查询、原生的关键词全文检索,以及把向量相似度、全文检索和结构化过滤融合在一次查询里的混合搜索。向量索引类型可以从内存扩展到磁盘。
它速度有多快?能处理多大数据量?它能在毫秒级搜索数十亿条向量。v0.7.0 版本让 DiskANN 正式可用于生产环境,新增了 Linux 和 macOS ARM64 支持,还加入了 iouring 异步 I/O 后端,会自动回退到最合适的可用方案。
zvec-grep(zg)是什么?一个本地优先的工作区搜索命令行工具,把 ripgrep、BM25 和向量搜索统一到一条命令里,为人类和 AI 智能体而设计。Zvec 还可以作为 ReMe 的文件存储后端,ReMe 是一套面向智能体的记忆管理工具。
What are similar projects?xerj, weaviate, memvid, RuVector, lancedb, qdrant, turbovec, milvus
Creator
alibaba
Size
10.8 MB
Stars
16.1K
Age
10mo
Commits · 90 Days