from actian_vectorai_client import VectorAIClient
import random
with VectorAIClient("localhost:6574") as client:
# Basic vector search
query = [random.gauss(0, 1) for _ in range(64)]
results = client.points.search("my_collection", vector=query, limit=5)
for r in results:
print(f"ID: {r.id}, Score: {r.score:.4f}")
print(f"Payload: {r.payload.get('category')}"){
"usage": {
"hardware": null
},
"time": 0.0000553,
"status": "ok",
"result": [
{
"id": 1,
"version": 0,
"score": 1,
"payload": null,
"vector": null
},
{
"id": 3,
"version": 0,
"score": 0.9843740463256836,
"payload": null,
"vector": null
},
{
"id": 2,
"version": 0,
"score": 0.9688639640808105,
"payload": null,
"vector": null
}
]
}{
"status": {
"error": "<string>"
},
"time": 123
}Search vectors
Find the most similar vectors in a collection using approximate nearest neighbor search. Supports score thresholds, payload filtering, and tunable HNSW parameters.
from actian_vectorai_client import VectorAIClient
import random
with VectorAIClient("localhost:6574") as client:
# Basic vector search
query = [random.gauss(0, 1) for _ in range(64)]
results = client.points.search("my_collection", vector=query, limit=5)
for r in results:
print(f"ID: {r.id}, Score: {r.score:.4f}")
print(f"Payload: {r.payload.get('category')}"){
"usage": {
"hardware": null
},
"time": 0.0000553,
"status": "ok",
"result": [
{
"id": 1,
"version": 0,
"score": 1,
"payload": null,
"vector": null
},
{
"id": 3,
"version": 0,
"score": 0.9843740463256836,
"payload": null,
"vector": null
},
{
"id": 2,
"version": 0,
"score": 0.9688639640808105,
"payload": null,
"vector": null
}
]
}{
"status": {
"error": "<string>"
},
"time": 123
}Authorizations
Admin JWT or access token for authenticating requests to VectorAI DB.
Path Parameters
The name of the collection to search.
Body
The query vector to search for. The number of dimensions must match the collection's configured vector size.
[0.1, 0.2, 0.3, 0.4]
Maximum number of results to return. Defaults to 10.
5
Number of results to skip for pagination. Use with limit to page through results.
0
Minimum similarity score for results. Only points with scores at or above this threshold are returned.
0.7
Optional filter to narrow search results based on payload metadata. See the Filters API for syntax.
Whether to include payload metadata in the response.
true
Whether to include vector data in the response. Set to false to reduce response size.
false
Advanced search parameters for tuning search quality and performance.
Show child attributes
Show child attributes