Find the nearest neighbors to a provided search item
This App API call allows you to query your app for results which are the closest match to text you provide to Graft through "entity_knn_adhoc" this can be a string of any length.
If you are looking for an image example please see App API - Image Search
"entity_knn_adhoc": {"description":"an amazing patio set for any backyard"},
Sample Code
curl https://app.graft.com/v1/query -H 'Content-Type: application/json' -X POST -d '{
"secret": " ... ENTER YOUR FULL API KEY HERE",
"output_format": "csv",
"organization": "<org_name>",
"project": "<project_id>",
"app_name": "0",
"instance_name": "<instance_id>",
"entity": "my_entity_1",
"config_name": "my_config",
"entity_columns": [
"<column_1>",
"<column_2>",
"<column_3>",
"<column_4>",
"<column_5>"
],
"embedding_name": "my_config_embedding",
"entity_knn_adhoc": [
{
"<query_field>": "an amazing patio set for any backyard"
}
],
"entity_knn_k": 10,
"rerank": true
}'