Search a vector store

Search a vector store for the chunks that best match a query.

POST/vector_stores/{vector_store_id}/search

Search a vector store for the chunks that best match a query.

The search matches by meaning, not by exact words, and returns the best chunks first. Each result names its file and carries the headings above the chunk in attributes. An empty data list means nothing matched. Search results are source text, not an answer. To have Olive answer from the store, give a file_search tool to POST /responses.

A store that does not exist, or that belongs to another account, answers as not found, with 400 or 404.

Authorization

BearerAuth
AuthorizationBearer <token>

Your Avey API key, sent as Authorization: Bearer <key>. This is the header the OpenAI SDKs already send, so pass the key as the client's ordinary api_key and no further configuration is needed.

In: header

Path Parameters

vector_store_id*string

The id of a vector store, as returned in its id.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

The body of a vector store search.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl https://api.avey.ai/llm/vector_stores/vs_6f1c2a9d8e7b4c35a0d1e2f3b4c5d6e7/search \  -H "Authorization: Bearer $AVEY_API_KEY" \  -H "Content-Type: application/json" \  -d '{ "query": "anticoagulation after hip surgery", "max_num_results": 5 }'
{  "object": "vector_store.search_results.page",  "data": [    {      "file_id": "file-Cn3MSNn72ENTiiq11Qda4A",      "filename": "ward-protocols.pdf",      "score": 0.62,      "attributes": {        "headings": [          "Post-operative care",          "Anticoagulation"        ]      },      "content": [        {          "type": "text",          "text": "Anticoagulant duration after hip replacement follows the ward protocol."        }      ]    }  ]}