Vicinity supports a variety of backends for approximate nearest neighbor search. You can choose the backend that best fits your needs based on performance, memory usage, and other factors.

BackendParameterDescriptionDefault Value
BASICmetricSimilarity metric to use (cosine, euclidean)."cosine"
ANNOYmetricSimilarity metric to use (dot, euclidean, cosine)."cosine"
treesNumber of trees to use for indexing.100
lengthOptional length of the dataset.None
FAISSmetricSimilarity metric to use (cosine, l2)."cosine"
index_typeType of FAISS index (flat, ivf, hnsw, lsh, scalar, pq, ivf_scalar, ivfpq, ivfpqr)."hnsw"
nlistNumber of cells for IVF indexes.100
mNumber of subquantizers for PQ and HNSW indexes.8
nbitsNumber of bits for LSH and PQ indexes.8
refine_nbitsNumber of bits for the refinement stage in IVFPQR indexes.8
HNSWmetricSimilarity space to use (cosine, l2)."cosine"
ef_constructionSize of the dynamic list during index construction.200
mNumber of connections per layer.16
PYNNDESCENTmetricSimilarity metric to use (cosine, euclidean, manhattan)."cosine"
n_neighborsNumber of neighbors to use for search.15
USEARCHmetricSimilarity metric to use (cos, ip, l2sq, hamming, tanimoto)."cos"
connectivityNumber of connections per node in the graph.16
expansion_addNumber of candidates considered during graph construction.128
expansion_searchNumber of candidates considered during search.64
VOYAGERmetricSimilarity space to use (cosine, l2)."cosine"
ef_constructionThe number of vectors that this index searches through when inserting a new vector into the index.200
mThe number of connections between nodes in the tree’s internal data structure.