RAG-powered Conversational Agent

Engage with an intelligent agent for information retrieval, analysis, and research.

This endpoint offers two operating modes:

  • RAG mode: Standard retrieval-augmented generation for answering questions based on knowledge base
  • Research mode: Advanced capabilities for deep analysis, reasoning, and computation

RAG Mode (Default)

The RAG mode provides fast, knowledge-based responses using:

  • Semantic and hybrid search capabilities
  • Document-level and chunk-level content retrieval
  • Optional web search integration
  • Source citation and evidence-based responses

Research Mode

The Research mode builds on RAG capabilities and adds:

  • A dedicated reasoning system for complex problem-solving
  • Critique capabilities to identify potential biases or logical fallacies
  • Python execution for computational analysis
  • Multi-step reasoning for deeper exploration of topics

Available Tools

RAG Tools:

  • search_file_knowledge: Semantic/hybrid search on your ingested documents
  • search_file_descriptions: Search over file-level metadata
  • content: Fetch entire documents or chunk structures
  • web_search: Query external search APIs for up-to-date information
  • web_scrape: Scrape and extract content from specific web pages

Research Tools:

  • rag: Leverage the underlying RAG agent for information retrieval
  • reasoning: Call a dedicated model for complex analytical thinking
  • critique: Analyze conversation history to identify flaws and biases
  • python_executor: Execute Python code for complex calculations and analysis

Streaming Output

When streaming is enabled, the agent produces different event types:

  • thinking: Shows the model’s step-by-step reasoning (when extended_thinking=true)
  • tool_call: Shows when the agent invokes a tool
  • tool_result: Shows the result of a tool call
  • citation: Indicates when a citation is added to the response
  • message: Streams partial tokens of the response
  • final_answer: Contains the complete generated answer and structured citations

Conversations

Maintain context across multiple turns by including conversation_id in each request. After your first call, store the returned conversation_id and include it in subsequent calls. If no conversation name has already been set for the conversation, the system will automatically assign one.

Headers

AuthorizationstringRequired

Bearer authentication of the form Bearer <token>, where token is your auth token.

X-API-KeystringRequired

Request

This endpoint expects an object.
messageobjectOptional

Current message to process

search_modeenumOptional

Pre-configured search modes: basic, advanced, or custom.

Allowed values:
search_settingsobjectOptional

The search configuration object for retrieving context.

rag_generation_configobjectOptional

Configuration for RAG generation in ‘rag’ mode

research_generation_configobjectOptional

Configuration for generation in ‘research’ mode. If not provided but mode=‘research’, rag_generation_config will be used with appropriate model overrides.

rag_toolslist of enumsOptional

List of tools to enable for RAG mode. Available tools: search_file_knowledge, get_file_content, web_search, web_scrape, search_file_descriptions

Allowed values:
research_toolslist of enumsOptional

List of tools to enable for Research mode. Available tools: rag, reasoning, critique, python_executor

Allowed values:
task_promptstringOptional

Optional custom prompt to override default

include_title_if_availablebooleanOptionalDefaults to true

Pass document titles from search results into the LLM context window.

conversation_idstringOptionalformat: "uuid"

ID of the conversation

max_tool_context_lengthintegerOptional

Maximum length of returned tool context

use_system_contextbooleanOptional

Use extended prompt for generation

modeenumOptional

Mode to use for generation: ‘rag’ for standard retrieval or ‘research’ for deep analysis with reasoning capabilities

Allowed values:
needs_initial_conversation_namebooleanOptional

If true, the system will automatically assign a conversation name if not already specified previously.

messageslist of objectsOptionalDeprecated

List of messages (deprecated, use message instead)

toolslist of stringsOptionalDeprecated

List of tools to execute (deprecated, use rag_tools or research_tools instead)

task_prompt_overridestringOptionalDeprecated

Optional custom prompt to override default

Response

Successful Response

resultsobject

Errors