Nearest Neighbors By Embedding
posthttps://api-atlas.nomic.ai/v1/dataset/data/get/nearest_neighbors/by_embedding
⚠️ WARNING
This endpoint is unstable & not officially supported. It may be deprecated and removed in future API versions.
Nearest Neighbors By Embedding
Request
Body (required) application/json
atlas_index_idstring*requiredUnique atlas index id
queriesstring | array<array<number>>*requiredA set of embeddings to query. Where n is the number of vectors to search and d is the vector dimensionality, this can be either an nxd numpy array encoded to base64, OR a list of n lists with d numbers per list.
kintegerThe number of neighbors to return
Default: 4
Responses
200Successful Response
neighborsarray<array<string>>*requirednested list of nearest neighbors
distancesarray<array<number>>*requireddistances of the neighbors to queries
422Validation Error
Examples
curl
curl -X 'POST' \
'https://api-atlas.nomic.ai/v1/dataset/data/get/nearest_neighbors/by_embedding' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-d '{
"atlas_index_id": "string",
"queries": "string",
"k": 4
}'