Encrypted Index
Query Vectors
POST
Query Vectors
Retrieve the nearest neighbors for a given query vector.
You can get an API key from the CyborgDB Admin Dashboard. For more info, follow this guide.
Supported operators:
With Filters:
Semantic Search:
Batch Query:
High Recall Query:
Authentication
Required - API key viaX-API-Key header:
Request Body
Single Query Request
Batch Query Request
Semantic Search Request (with embedding model)
Response
Single Query Response
Whenquery_vectors is a 1D array or query_contents is used:
Batch Query Response
Whenquery_vectors is a 2D array (array of arrays):
The response format automatically matches the request format:
- Single query → flat array of results
- Batch query → nested array with results for each query
Metadata Filtering
Use MongoDB-style query operators:$and, $or, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin
Exceptions
401: Authentication failed (invalid API key)404: Index not found422: Invalid request parameters or vector dimensions500: Internal server error
Example Usage
Basic 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.