Start a conversation with an Agent and receive its generated response, along with relevant retrieved data and attributions.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Agent ID of the agent to query
Set to true to fetch retrieval content and metadata, and then skip generation of the response.
Set to true to include the text of the retrieved contents in the response. If false, only metadata about the retrieved contents will be included, not content text. This parameter is ignored if retrievals_only is true, in which case content_text will always be returned. Content text and other metadata can also be fetched separately using the /agents/{agent_id}/query/{message_id}/retrieval/info endpoint.
Request body for a POST /agents/{agent_id}/query request
Messages sent so far in the conversation, ending in the latest user message. Add multiple objects to provide conversation history. Last message in the list must be a user-sent message (i.e. role equals "user").
Set to true to receive a streamed response
An optional alternative to providing message history in the messages field. If provided, all messages in the messages list prior to the latest user-sent query will be ignored.
Model ID of the specific fine-tuned or aligned LLM model to use. Defaults to base model if not specified.
Custom output structure format.
Defines a custom metadata filter. The expected input is a dict which can have different operators, fields and values. For example:
{"field": "title", "operator": "startswith", "value": "hr-"}Use lowercase for value when not using equals operator. For document_id and date_created the query is built using direct query without nesting.
{
"filters": [
{
"field": "field1",
"operator": "equals",
"value": "value1"
}
],
"operator": "AND"
}This will modify select configuration parameters for the agent during the response generation.
Successful Response
Response body for POST /query/acl
A unique identifier for the conversation. Can be passed to future /query calls to continue a conversation with the same message history.
A unique identifier for this specific message
Workflow trace for the response
Tool calls and thinking events for the response
Outputs of the agent
Relevant content retrieved to answer the query. Only included when include_retrieval_content_text is true.
Response to the query request. Extracted from outputs['response'] if available.
Attributions for the response. Extracted from outputs['attribution_result'].attributions if available.
Groundedness scores for the response. Extracted from outputs['groundedness_scores'] if available.
RL training context for multi-turn training. Automatically included when policy_output is provided. Contains: full_message_history (complete conversation for next turn), message_history (original input), research_items (tool calls + results), tool_calls_summary (simplified), chunks_info (retrieved content).