Search Documents
This method allows you to search for documents in an index that are relevant to a particular search input.
The request allows you specify a particular text which is then embedded using
the index configuration. The API will search through all indexed documents and
find chunks that match the content of text. More specifically, the API will find
any chunk with a small vector-distance between the embedded text and the embedded
document chunk content.
The document chunks that are most closely related to the provided text are returned
in the response, and the API will return up to top_k chunks. Additionally, you can
further limit which chunks are returned by specifying a via similarity_cutoff, which
means that only chunks that meet a minimum similarity are included in the response.
The response includes, for each chunk that was found, metadata about the document from which the chunk was extracted. This provides a link back to the document that was added to the index.
knowledge_base_id
index_id
Show optional properties
{
"text": "string"
}
{
"text": "string",
"top_k": 0,
"similarity_cutoff": "number"
}
Search text string.
Return only the k top answers.
Return only answers within this similarity.
Successful Response
"DocumentChunksRetrievalResponseList Object"
List of relevant text chunks and associated metadata from embeddings query.
Invalid knowledge base or index ID.
Validation Error
"HTTPValidationError Object"
detail
curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"text:"string"}' https://{api_host}/api/v1/control/knowledge-bases/{knowledge_base_id}/indexes/{index_id}/search