Skip to main content

vector_search

superduper.backends.base.vector_search

Source code

cosine​

cosine(x,
y)
ParameterDescription
xnumpy.ndarray
ynumpy.ndarray, y should be normalized!

Cosine similarity function for vector search.

dot​

dot(x,
y)
ParameterDescription
xnumpy.ndarray
ynumpy.ndarray

Dot function for vector similarity search.

l2​

l2(x,
y)
ParameterDescription
xnumpy.ndarray
ynumpy.ndarray

L2 function for vector similarity search.

VectorSearchBackend​

VectorSearchBackend(self)

Base vector-search backend.

BaseVectorSearcher​

BaseVectorSearcher(self,
uuid: str,
dimensions: int,
measure: str)
ParameterDescription
uuidUnique string identifier of index
dimensionsDimension of the vector embeddings
measuremeasure to assess similarity

Base class for vector searchers.

VectorItem​

VectorItem(self,
id: str,
vector: numpy.ndarray) -> None
ParameterDescription
idID of the vector
vectorVector of the item

Class for representing a vector in vector search with id and vector.