Skip to main content
POST
Query Vectors
Retrieve the nearest neighbors for a given query vector.

Authentication

Required - API key via X-API-Key header:
You can get an API key from the CyborgDB Admin Dashboard. For more info, follow this guide.

Request Body

Response

Single Query:
Batch Query:

Metadata Filtering

Use MongoDB-style query operators:
Supported operators: $and, $or, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin

Exceptions

  • 401: Authentication failed (invalid API key)
  • 404: Index not found
  • 422: Invalid request parameters or vector dimensions
  • 500: Internal server error

Example Usage

Basic Query:
With Filters:
Semantic Search:
Batch Query:
High Recall Query:
If embedding_model is configured for the index, you can use either query_vectors for direct vector search or query_contents for text-based semantic search.
Higher n_probes values and greedy=true increase recall but may reduce query performance. Start with default values and adjust based on your recall requirements.