Skip to main content

Indexers

VortexDB supports multiple indexing algorithms, each optimized for different use cases. The index determines how vectors are organized for similarity search.

Flat Index

The Flat index performs brute-force exhaustive search by computing distances to every vector.

When to Use

  • Dataset size: < 10,000 vectors
  • Requirements: Need exact/guaranteed results
  • Use cases: Testing, prototyping, small production workloads

KD-Tree Index

The 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, …).

When to Use

  • Vector dimensions: < 20 dimensions
  • Dataset size: Thousands to hundreds of thousands of vectors
  • Use cases: Geographic data, low-dimensional embeddings, spatial queries
For high-dimensional embeddings (e.g., 384, 768, 1536 dimensions common in ML), KD-Tree is not recommended. Use HNSW instead.

HNSW Index

HNSW (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.

When to Use

  • Vector dimensions: Any, but especially > 20 dimensions
  • Dataset size: 100,000+ vectors
  • Use cases: Semantic search, recommendation systems, RAG applications

Distance Metrics

All indexes support four distance/similarity metrics:
Measures the angle between two vectors, ignoring magnitude.d=1ABABd = 1 - \frac{A \cdot B}{\|A\| \|B\|}
  • Range: 0 (identical) to 2 (opposite)
  • Best for: Text embeddings, normalized vectors

Choosing an Index

Use this decision tree:

Configuration Example

Next Steps

Snapshots

Learn how to backup and restore your index

API Reference

Explore the complete API