Operating Modes
RAG Mode (Default)
Provides fast, grounded answers by combining retrieval and generation. Features include:- Semantic and hybrid search across documents and chunks
 - Optional web search integration for live context
 - Document-level and chunk-level content retrieval
 - Source citation and evidence-based responses
 
Research Mode
Extends RAG functionality with advanced reasoning and computational abilities. Features include:- Dedicated reasoning system for multi-step problem-solving
 - Automated critique generation to identify biases or logical fallacies
 - Python execution for quantitative analysis and code-based reasoning
 - Deep exploration capabilities across multiple sources
 
Available Tools
RAG Tools:
search_file_knowledge— Perform semantic or hybrid search across ingested documents.search_file_descriptions— Search file-level metadata and descriptions.content— Retrieve full documents or chunk structures.web_search— Query external search engines for up-to-date information.web_scrape— Extract content directly from specified web pages.
rag— Invoke the underlying RAG agent for information retrieval.reasoning— Use a dedicated reasoning model for deep analysis and logical inference.critique— Analyze the conversation for potential biases or reasoning flaws.python_executor— Execute Python code for computation, simulation, or data processing.
Streaming Output
When streaming is enabled ("stream": true), the API emits Server-Sent Events (SSE) to deliver updates in real time.
Each event corresponds to a stage in the agent’s reasoning and response generation process.
| Event Type | Description | 
|---|---|
thinking | Displays the model’s intermediate reasoning steps (enabled by extended_thinking=true). | 
tool_call | Indicates when the agent invokes a tool. | 
tool_result | Contains the output from an executed tool. | 
citation | Signals that a citation has been added to the response. | 
message | Streams partial tokens of the generated message. | 
final_answer | Provides the complete generated response with structured citations. | 
Conversations
The agent maintains persistent conversational context using theconversation_id field.
How it works:
- On the initial request, the system creates a new conversation and returns a 
conversation_id. - Include this ID in subsequent requests to continue the same thread.
 - If no conversation name exists, R2R automatically assigns one.
 
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
Current message to process
Pre-configured search modes: basic, advanced, or custom.
basic, advanced, custom The search configuration object for retrieving context.
Configuration for RAG generation in 'rag' mode
Configuration for generation in ‘research’ mode. If not provided but mode=‘research’, rag_generation_config will be used with appropriate model overrides.
List of tools to enable for RAG mode. Available tools: search_file_knowledge, get_file_content, web_search, web_scrape, search_file_descriptions
web_search, web_scrape, search_file_descriptions, search_file_knowledge, get_file_content Response
200