datastax/jvector
JVector: the most advanced embedded vector search engine
What JVector Is
JVector is an open‑source Java library that implements a graph‑based approximate nearest‑neighbor (ANN) index. It combines ideas from two well‑known ANN algorithms – HNSW (Hierarchical Navigable Small World) and DiskANN’s Vamana – to give a fast, scalable search structure that can live partly in memory and partly on disk.
Why It Matters
Finding the k most similar vectors in a huge, high‑dimensional dataset is a core operation for many AI systems (semantic search, recommendation, clustering, etc.). Exact search is too slow at scale, so most production systems use ANN. JVector’s hybrid graph design lets you:
- Search in logarithmic time while keeping a small memory footprint.
- Build indexes larger than RAM by using a two‑pass approach – a quick, compressed first pass in memory, followed by a precise second pass that reads data from disk.
- Scale construction linearly with CPU cores thanks to non‑blocking concurrency, which is valuable when you need to index billions of vectors.
Core Features (as described in the README)
| Feature | What It Does |
|---|---|
| Multi‑layer graph | Upper layers are pure in‑memory adjacency lists for ultra‑fast navigation; the bottom layer lives on‑disk. |
| Two‑pass search | First pass uses compressed representations (Product Quantization, Binary Quantization, or fused PQ) for speed and low memory; second pass refines results with full‑precision float32 or NVQ vectors. |
| Incremental construction | Index can be updated and built incrementally, unlike many partition‑based ANN methods that require a static dataset. |
| Non‑blocking concurrency | Construction scales linearly with core count, as shown in the README’s scaling chart. |
| Cross‑platform native SIMD | A native library (libjvector.so) built with Meson/Ninja provides SIMD‑accelerated distance calculations on Linux x86‑64 and AArch64. |
| Multi‑release JAR | Packs Java‑11 compatible code and Java‑20‑specific optimizations into a single artifact, usable from any Java 11+ project. |
| Benchmarks & examples | Ready‑to‑run Bench and SiftSmall classes, plus tutorial code in jvector-examples. |
Who Might Use It
- Engineers building semantic search or recommendation services that need sub‑millisecond latency on billions of embeddings.
- Researchers prototyping new ANN algorithms who want a solid, production‑grade baseline written in Java.
- Companies that store embeddings on‑disk (e.g., large‑scale document or image vectors) and cannot fit the whole index in RAM.
Getting Started (quick steps)
- Clone with submodules – the repo pulls in Google’s Highway SIMD library.
- Build the native library – run
build_native_lib.sh(Linux only) to getlibjvector.so. - Compile the Java modules –
mvn clean install(ormvn -Pjdk11for Java 11). - Run a tutorial – follow
docs/tutorials/1-intro-tutorial.mdor inspectVectorIntro.java. - Benchmark –
mvn compile exec:exec@benchto see performance on standard datasets.
How It Fits Into the AI Landscape
JVector isn’t a model‑training framework; it’s a search engine component that sits behind applications that already have vector embeddings (from LLMs, CLIP, sentence‑transformers, etc.). By providing a high‑performance, disk‑backed ANN index, it lets those applications retrieve nearest‑neighbors quickly without needing massive RAM, making large‑scale semantic AI systems more practical.
All information above is taken directly from the repository’s README.
Related
- Project
- Project
- Project
- Project
- Project