Configs2026年5月26日·1 分钟阅读

zvec — Lightweight In-Process Vector Database by Alibaba

A fast, embeddable vector database written in C++ that runs inside your application process, designed for agent memory and semantic search without external services.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
zvec Overview
直接安装命令
npx -y tokrepo@latest install 5f7964a9-5940-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

zvec is an open-source, in-process vector database from Alibaba designed for scenarios where running a separate vector service is unnecessary overhead. It embeds directly into your Python or C++ application, offering fast approximate nearest neighbor search for agent memory, RAG pipelines, and semantic search workloads.

What zvec Does

  • Stores and indexes high-dimensional vectors inside your application process
  • Performs approximate nearest neighbor search using HNSW and other index types
  • Supports metadata filtering alongside vector similarity queries
  • Persists data to disk for durability between application restarts
  • Provides Python and C++ APIs for easy integration

Architecture Overview

zvec is a single-process library that manages vector storage, indexing, and search within the host application memory space. It uses HNSW (Hierarchical Navigable Small World) graphs as the primary index structure for fast approximate search. Data is organized into collections, each with a fixed vector dimension. A write-ahead log ensures durability, and memory-mapped files allow datasets larger than RAM to be queried efficiently. The library is written in C++ with Python bindings via pybind11.

Self-Hosting & Configuration

  • Install via pip for Python or include the C++ header library directly
  • No external services required — data lives on the local filesystem
  • Configure index parameters (M, ef_construction) per collection for speed/recall tradeoffs
  • Set the storage directory path at database initialization
  • Tune memory usage by adjusting mmap settings for large collections

Key Features

  • Zero-dependency deployment — no network calls, no external processes
  • Sub-millisecond search latency for collections up to millions of vectors
  • Persistent storage with crash recovery through write-ahead logging
  • Metadata filtering combined with vector search in a single query
  • Compact binary format keeps disk usage low

Comparison with Similar Tools

  • FAISS — Facebook's vector library; zvec adds persistence, metadata filtering, and a simpler API
  • Qdrant — client-server vector database; zvec runs in-process without network overhead
  • ChromaDB — Python-first vector store; zvec is faster due to its C++ core and mmap design
  • LanceDB — embedded vector DB; zvec is more lightweight and focused purely on vector operations
  • pgvector — Postgres extension; zvec avoids the overhead of a full database server

FAQ

Q: How many vectors can zvec handle? A: It comfortably handles millions of vectors on a single machine. For larger workloads, performance depends on available RAM and disk speed since mmap is used for overflow.

Q: Does zvec support updates and deletes? A: Yes. You can update vectors and metadata by ID, and delete entries. The HNSW index is rebuilt incrementally.

Q: Can I use zvec in a web server handling concurrent requests? A: Yes. Read operations are thread-safe. For concurrent writes, use a write lock or serialize inserts through a queue.

Q: What embedding models work with zvec? A: Any model that produces fixed-dimension float vectors. Common choices include sentence-transformers, OpenAI embeddings, and Cohere embed.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产