- Stay above 98% recall — your application (e.g. recommendation, image search, semantic search) rarely misses relevant results.
- Provide consistent low latency (<50ms p99). Check out our benchmarks.
- Support large-scale single-collection as well as multi-tenant use cases.
How to run a vector search
Prerequisites
Define a schema with a vector field, eitherf32_vector()
, u8_vector()
, i8_vector()
or binary_vector()
, and add a vector_index()
to it:
Find the closest neighbors
To find the top-k closest neighbors of the query vector, use thevector_distance()
function.
It computes a numeric value(depending on the vector distance metric specified in the vector index)
which you can use to sort the results:
- Compute the cosine similarity between the query embedding and the
title_embedding
field using thevector_distance()
function. - Store the computed cosine similarity in the
title_similarity
field. - Return the top 10 results sorted by the
title_similarity
field in a descending order.
Combine vector search with metadata filtering
Vector search can be easily combined with metadata filtering by adding afilter()
stage to the query: