Skip to main content
POST
Query Relevant Chunks

Authorizations

x-api-key
string
header
required

Headers

x-selected-account-id
string | null
x-project-id
string | null

Path Parameters

knowledge_base_id
string
required

Body

application/json
query
string
required

The natural language query to be answered by referencing the data ingested into the knowledge base

top_k
integer
required

Number of chunks to return. Must be greater than 0 if specified. If not specified, all chunks will be returned.

Required range: x <= 10000
include_embeddings
boolean
default:true

Whether or not to include the embeddings for each chunk

metadata_filters
Metadata Filters · object | null

Optional filter by metadata fields, encoded as a JSON object

wildcard_filters
Wildcard Filters · object | null

Optional wildcard filter for fields. Only fields that are part of the metadata will be accepted.

verbose
boolean
default:false

Enable or disable verbose logging

fraction_leaf_nodes_to_search_override
number | null

Vertex AI only. Fraction of index tree leaves to search, greater than 0 and at most 1. For example, 0.1 searches 10% and 1 searches all leaves. Higher values can improve recall at the cost of latency. Omit to use the index default. Other index backends ignore this option and log a warning. This does not enable exact KNN.

Required range: 0 < x <= 1

Response

Successful Response

chunks
ChunkV2 · object[]
required

An ordered list of the k most similar chunks and their similarity scores from most to least similar

started_at
string<date-time> | null

Timestamp at which the query was begun by the server.

completed_at
string<date-time> | null

Timestamp at which the query was completed by the server.

request_id
string | null

query request ID for verbose logging