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.
Path parameters
The id of an agent. This is returned on agent creation.
The id of an agent. This is returned on agent creation.
Query parameters
The ID of the branch to use
The ID of the branch to use
Headers
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",
"content_format": "html",
"document_id": "doc_J3Pbu5gP6NNKBscdCdwB",
"document_name": "Account FAQ",
"document_type": "url",
"source_url": "https://example.com/account-faq?utm_medium=agents_citation&utm_source=elevenlabs",
"text": "To reset your password, open Settings and choose Security...",
"vector_distance": 0.21
}
],
"retrieval_query": "How do I reset my password?"
}Changes
Changed in 4 of the 32 revisions of this API.5
- ○
added the required property
//to the response with the statusresponse-required-property-added
This revision also has 6 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ○
added the required property
//to the response with the statusresponse-required-property-added
- ○
added the required property
//to the response with the statusresponse-required-property-added
- ○
- ○
added the new optional request property
new-optional-request-property
This revision also has 4 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ○
endpoint added
endpoint-added
This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○