Skip to main content
POST
Retrieve Context from AI Assistant

Authorizations

Authorization
string
header
default:App
required

This is the most secure authorization type and the one with the most flexibility.

API keys can be generated by calling the dedicated API method. Furthermore, API keys can have a limited scope and cover only some API methods. Lastly, they can be revoked at any time. This range of possibilities makes API keys well suited for separating the API access rights across multiple applications or use cases. Finally, the loss of an API key is easily manageable.

You can manage your API keys from GUI, or programmatically with dedicated API.

API key Authorization header example:

Path Parameters

assistantId
string
required

Unique identifier of the AI assistant from which to retrieve context.

Body

application/json

AI Assistant retrieve context request with optional retrieval parameters.

message
string
required

User message to retrieve context for.

Example:

"How to send SMS?"

k
integer<int32>

Number of context chunks to return. Overrides the assistant's default K value. Use this to get more or fewer context chunks.

Example:

5

reRankK
integer<int32>

Enables re-ranking for improved precision. When set, retrieves max(k, reRankK) chunks initially, then uses a cross-encoder to return the top K most relevant results.

Example:

10

useSharedHistory
boolean
default:false

Flag to indicate whether to use shared conversation history.

sessionId
string

Session ID to maintain context across multiple queries.

Example:

"session-12345"

Response

Context retrieved successfully

contexts
ContextNode · object[]
required

List of retrieved context nodes.