v4
OpenAPI 3.1.02026-07-313621,3961.8 MBAgents Platform
Query Agent Knowledge Base Rag
Run the agent's exact RAG retrieval for an ad-hoc query and return the ranked chunks the agent would retrieve. Read-only: no conversation is created. The response reflects current retrieval internals and may evolve.
post/v1/convai/agents/{agent_id}/knowledge-base/rag-query
Path parameters
agent_idstring required
The id of an agent. This is returned on agent creation.
Example:agent_3701k3ttaq12ewp8b7qv5rfyszkz
The id of an agent. This is returned on agent creation.
Query parameters
branch_idstring nullable
The ID of the branch to use
Example:agtbranch_0901k4aafjxxfxt93gd841r7tv5t
The ID of the branch to use
Headers
xi-api-keystring nullable
Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.
Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.
Request body
Example request
{
"query": "How do I reset my password?"
}Response
Successful Response
Example response
{
"chunks": [
{
"chunk_id": "chunk_498cjVigY5qzO86Huf0OWal",
"document_id": "doc_J3Pbu5gP6NNKBscdCdwB",
"document_name": "Account FAQ",
"text": "To reset your password, open Settings and choose Security...",
"vector_distance": 0.21
}
],
"retrieval_query": "How do I reset my password?"
}