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.
Headers
Your API key for programmatic access. Send it in the x-api-key header; you can create and manage keys from the Developers page.
Path Parameters
The id of an agent. This is returned on agent creation.
"agent_3701k3ttaq12ewp8b7qv5rfyszkz"
Query Parameters
The ID of the branch to use
"agtbranch_0901k4aafjxxfxt93gd841r7tv5t"
Body
Query to run against the agent's knowledge base RAG index.
1"How do I reset my password?"
When true (the default), retrieval uses the agent's own RAG settings, reproducing exactly what the agent would retrieve. Set to false to retrieve with neutral default RAG settings instead (the agent's embedding model is always kept, since it determines which vector index exists). Useful for auditing the knowledge base independently of how a particular agent is tuned.
Optional maximum total character length of document chunks returned. Overrides the selected RAG settings for this query only.
0 < x <= 50000Optional maximum number of document chunks retrieved. Overrides the selected RAG settings for this query only.
0 < x <= 20