v1

latestOpenAPI 3.1.02026-07-1255227258.8 KB
retrievals

Retrieve

post/retrievals

Request body

querystring required

The query to search with when retrieving document chunks.

top_kinteger

The maximum number of chunks to return. Defaults to 8.

filterMetadataFilter
rerankboolean

Reranks the chunks for semantic relevancy post cosine similarity. Will be slower but returns a subset of highly relevant chunks. Best for reducing hallucinations and improving accuracy for LLM generation.

max_chunks_per_documentinteger

Maximum number of chunks to retrieve per document. Use this to increase the number of documents the final chunks are retrieved from. This feature is in beta and may change in the future.

partitionstring

The partition to scope a retrieval to. If omitted, the retrieval will be scoped to the default partition, which includes any documents that have not been created in a partition.

recency_biasboolean

Enables recency bias which will favor more recent documents vs older documents. https://docs.ragie.ai/docs/retrievals-recency-bias

Example request

{
  "query": "What is the best pizza place in SF?",
  "top_k": 8,
  "rerank": true
}

Response

Successful Response