Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsMay 26, 2026·3 min de lecture

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.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
zvec Overview
Commande d'installation directe
npx -y tokrepo@latest install 5f7964a9-5940-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en 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

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires