Contextual AI icon

Contextual AI

Access Contextual AI tools for agents, parsing, querying, and reranking.

Query → Query agent

AI-generated

Summary

Query a Contextual AI agent and receive a response.

Inputs

  • agentId (required) — ID of the agent to query. Must be a valid UUID.
  • query (required) — The user query to send to the agent.
  • retrievalsOnly — Whether to fetch retrievals and skip generation.
  • includeRetrievalContentText — Whether to include the text of retrieved contents in the response.
  • stream — Whether to receive a streamed response.
  • conversationId — Optional conversation ID to continue an existing conversation. If provided, all messages in the conversation history will be ignored.
  • llmModelId — Model ID of the specific fine-tuned or aligned LLM model to use. Defaults to base model if not specified.
  • conversationHistory — JSON string containing conversation history. Format: [{

Output shape

json

The API response from the agent query, containing the agent's reply and metadata.

Examples

Example 1: Ask a question about uploaded documents

Set Agent ID to the target agent's UUID and Query to 'What is machine learning?'. Leave other parameters at defaults unless conversation history or retrieval controls are needed.

Discussion