Skip to main content
POST
Retrieve Chunks
Retrieve raw chunks from a knowledge engine without creating a workflow or generating a synthesized LLM answer.

Request Format

string
required
The knowledge engine ID to search.
string
required
The natural language query used to retrieve the most relevant chunks.
string
Optional. Restrict retrieval to a single data source.
integer
Maximum chunks to return. Defaults to 5; values above 20 are clamped to 20.

Response Format

string
The original query string.
string
The queried knowledge engine ID.
string
Returned when a single data_source_id was provided in the request.
array
Ranked chunks retrieved from the knowledge engine.
integer
Number of chunks returned.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

id
string
required

Knowledge engine ID

Body

application/json
query
string
required

The natural language query used to retrieve relevant chunks

data_source_id
string

Optional data source ID to constrain retrieval to a single source

top_k
integer
default:5

Maximum number of chunks to return. Defaults to 5; values above 20 are clamped to 20.

Required range: 1 <= x <= 20

Response

Retrieved chunks for the knowledge engine

query
string

The original query string

knowledge_engine_id
string

Public ID of the queried knowledge engine

Example:

"kng_abc123xyz789"

data_source_id
string

Public ID of the queried data source when request was scoped to one source

Example:

"ds_abc123xyz789"

chunks
object[]
total_chunks
integer

Number of chunks returned