Skip to main content

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*required

Unique atlas index id

queriesstring | array<array<number>>*required

A 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.

kinteger

The number of neighbors to return

Default: 4

Responses​

200Successful Response
neighborsarray<array<string>>*required

nested list of nearest neighbors

distancesarray<array<number>>*required

distances 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
}'