Snapshots
Learn how to backup and restore your index
VortexDB supports multiple indexing algorithms, each optimized for different use cases. The index determines how vectors are organized for similarity search.
The Flat index performs brute-force exhaustive search by computing distances to every vector.
INDEX_TYPE=flatThe KD-Tree (k-dimensional tree) is a space-partitioning data structure that recursively divides the vector space.
At each level, the tree splits data along a different dimension (cycling through x, y, z, …).
INDEX_TYPE=kdtreeHNSW (Hierarchical Navigable Small World) is a state-of-the-art approximate nearest neighbor algorithm based on proximity graphs. It constructs a multi-layered graph where each layer represents a different level of granularity, enabling efficient navigation from coarse to fine-grained similarity search.
Check out this blog post for more theoretical details and this blog covering implementation in VortexDB.
INDEX_TYPE=hnswAll indexes support four distance/similarity metrics:
Measures the angle between two vectors, ignoring magnitude.
similarity=Similarity.COSINEL2 distance—the straight-line distance between points.
similarity=Similarity.EUCLIDEANL1 distance—the sum of absolute differences.
similarity=Similarity.MANHATTANCounts positions where elements differ.
similarity=Similarity.HAMMINGUse this decision tree:
| Vectors | Dimensions | Recommended Index |
|---|---|---|
| < 10,000 | Any | Flat |
| 10K - 100K | < 20 | KD-Tree |
| 10K - 100K | ≥ 20 | HNSW |
| > 100K | Any | HNSW |
# For a semantic search application with OpenAI embeddingsDIMENSION=1536INDEX_TYPE=hnswSTORAGE_TYPE=rocksdb
# For a small prototype with sentence-transformersDIMENSION=384INDEX_TYPE=flatSTORAGE_TYPE=inmemory