Skip to main content
Use this page to search a collection with a query vector and retrieve the most similar points.
Before you begin, make sure you have a running VectorAI DB instance and an existing collection with inserted points. The example below uses random vectors for demonstration. In production, generate vectors from an embedding model.

Search a collection with a query vector

The search() method returns results ranked by similarity score. Score interpretation depends on your chosen distance metric.
Each result includes these fields:
  • id: The unique identifier of the matching point.
  • score: Similarity score based on the collection’s distance metric.
  • payload: Metadata dictionary containing document information.
  • vector: Vector embedding (only if with_vectors=True).