curl --request POST \
--url https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"search_settings": {
"use_hybrid_search": false,
"use_semantic_search": true,
"use_fulltext_search": false,
"filters": "<string>",
"limit": 10,
"offset": "0",
"include_metadatas": true,
"include_scores": true,
"search_strategy": "vanilla",
"hybrid_settings": {
"full_text_weight": 1,
"semantic_weight": 5,
"full_text_limit": 200,
"rrf_k": 50
},
"chunk_settings": {
"probes": 10,
"ef_search": 40,
"enabled": true
},
"graph_settings": {
"limits": "<array>",
"enabled": true
},
"num_sub_queries": 5
},
"rag_generation_config": {
"model": "<string>",
"temperature": 123,
"top_p": 123,
"max_tokens_to_sample": 123,
"stream": true,
"functions": "<array>",
"tools": "<array>",
"add_generation_kwargs": "<array>",
"api_base": "<string>",
"response_format": [
{
"Base Model": {}
}
],
"extended_thinking": false,
"thinking_budget": 123,
"reasoning_effort": "<string>"
},
"research_generation_config": {
"model": "<string>",
"temperature": 123,
"top_p": 123,
"max_tokens_to_sample": 123,
"stream": true,
"functions": "<array>",
"tools": "<array>",
"add_generation_kwargs": "<array>",
"api_base": "<string>",
"response_format": [
{
"Base Model": {}
}
],
"extended_thinking": false,
"thinking_budget": 123,
"reasoning_effort": "<string>"
}
}
'import requests
url = "https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent"
payload = {
"search_settings": {
"use_hybrid_search": False,
"use_semantic_search": True,
"use_fulltext_search": False,
"filters": "<string>",
"limit": 10,
"offset": "0",
"include_metadatas": True,
"include_scores": True,
"search_strategy": "vanilla",
"hybrid_settings": {
"full_text_weight": 1,
"semantic_weight": 5,
"full_text_limit": 200,
"rrf_k": 50
},
"chunk_settings": {
"probes": 10,
"ef_search": 40,
"enabled": True
},
"graph_settings": {
"limits": "<array>",
"enabled": True
},
"num_sub_queries": 5
},
"rag_generation_config": {
"model": "<string>",
"temperature": 123,
"top_p": 123,
"max_tokens_to_sample": 123,
"stream": True,
"functions": "<array>",
"tools": "<array>",
"add_generation_kwargs": "<array>",
"api_base": "<string>",
"response_format": [{ "Base Model": {} }],
"extended_thinking": False,
"thinking_budget": 123,
"reasoning_effort": "<string>"
},
"research_generation_config": {
"model": "<string>",
"temperature": 123,
"top_p": 123,
"max_tokens_to_sample": 123,
"stream": True,
"functions": "<array>",
"tools": "<array>",
"add_generation_kwargs": "<array>",
"api_base": "<string>",
"response_format": [{ "Base Model": {} }],
"extended_thinking": False,
"thinking_budget": 123,
"reasoning_effort": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
search_settings: {
use_hybrid_search: false,
use_semantic_search: true,
use_fulltext_search: false,
filters: '<string>',
limit: 10,
offset: '0',
include_metadatas: true,
include_scores: true,
search_strategy: 'vanilla',
hybrid_settings: {full_text_weight: 1, semantic_weight: 5, full_text_limit: 200, rrf_k: 50},
chunk_settings: {probes: 10, ef_search: 40, enabled: true},
graph_settings: {limits: '<array>', enabled: true},
num_sub_queries: 5
},
rag_generation_config: {
model: '<string>',
temperature: 123,
top_p: 123,
max_tokens_to_sample: 123,
stream: true,
functions: '<array>',
tools: '<array>',
add_generation_kwargs: '<array>',
api_base: '<string>',
response_format: [{'Base Model': {}}],
extended_thinking: false,
thinking_budget: 123,
reasoning_effort: '<string>'
},
research_generation_config: {
model: '<string>',
temperature: 123,
top_p: 123,
max_tokens_to_sample: 123,
stream: true,
functions: '<array>',
tools: '<array>',
add_generation_kwargs: '<array>',
api_base: '<string>',
response_format: [{'Base Model': {}}],
extended_thinking: false,
thinking_budget: 123,
reasoning_effort: '<string>'
}
})
};
fetch('https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'search_settings' => [
'use_hybrid_search' => false,
'use_semantic_search' => true,
'use_fulltext_search' => false,
'filters' => '<string>',
'limit' => 10,
'offset' => '0',
'include_metadatas' => true,
'include_scores' => true,
'search_strategy' => 'vanilla',
'hybrid_settings' => [
'full_text_weight' => 1,
'semantic_weight' => 5,
'full_text_limit' => 200,
'rrf_k' => 50
],
'chunk_settings' => [
'probes' => 10,
'ef_search' => 40,
'enabled' => true
],
'graph_settings' => [
'limits' => '<array>',
'enabled' => true
],
'num_sub_queries' => 5
],
'rag_generation_config' => [
'model' => '<string>',
'temperature' => 123,
'top_p' => 123,
'max_tokens_to_sample' => 123,
'stream' => true,
'functions' => '<array>',
'tools' => '<array>',
'add_generation_kwargs' => '<array>',
'api_base' => '<string>',
'response_format' => [
[
'Base Model' => [
]
]
],
'extended_thinking' => false,
'thinking_budget' => 123,
'reasoning_effort' => '<string>'
],
'research_generation_config' => [
'model' => '<string>',
'temperature' => 123,
'top_p' => 123,
'max_tokens_to_sample' => 123,
'stream' => true,
'functions' => '<array>',
'tools' => '<array>',
'add_generation_kwargs' => '<array>',
'api_base' => '<string>',
'response_format' => [
[
'Base Model' => [
]
]
],
'extended_thinking' => false,
'thinking_budget' => 123,
'reasoning_effort' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent"
payload := strings.NewReader("{\n \"search_settings\": {\n \"use_hybrid_search\": false,\n \"use_semantic_search\": true,\n \"use_fulltext_search\": false,\n \"filters\": \"<string>\",\n \"limit\": 10,\n \"offset\": \"0\",\n \"include_metadatas\": true,\n \"include_scores\": true,\n \"search_strategy\": \"vanilla\",\n \"hybrid_settings\": {\n \"full_text_weight\": 1,\n \"semantic_weight\": 5,\n \"full_text_limit\": 200,\n \"rrf_k\": 50\n },\n \"chunk_settings\": {\n \"probes\": 10,\n \"ef_search\": 40,\n \"enabled\": true\n },\n \"graph_settings\": {\n \"limits\": \"<array>\",\n \"enabled\": true\n },\n \"num_sub_queries\": 5\n },\n \"rag_generation_config\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"max_tokens_to_sample\": 123,\n \"stream\": true,\n \"functions\": \"<array>\",\n \"tools\": \"<array>\",\n \"add_generation_kwargs\": \"<array>\",\n \"api_base\": \"<string>\",\n \"response_format\": [\n {\n \"Base Model\": {}\n }\n ],\n \"extended_thinking\": false,\n \"thinking_budget\": 123,\n \"reasoning_effort\": \"<string>\"\n },\n \"research_generation_config\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"max_tokens_to_sample\": 123,\n \"stream\": true,\n \"functions\": \"<array>\",\n \"tools\": \"<array>\",\n \"add_generation_kwargs\": \"<array>\",\n \"api_base\": \"<string>\",\n \"response_format\": [\n {\n \"Base Model\": {}\n }\n ],\n \"extended_thinking\": false,\n \"thinking_budget\": 123,\n \"reasoning_effort\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"search_settings\": {\n \"use_hybrid_search\": false,\n \"use_semantic_search\": true,\n \"use_fulltext_search\": false,\n \"filters\": \"<string>\",\n \"limit\": 10,\n \"offset\": \"0\",\n \"include_metadatas\": true,\n \"include_scores\": true,\n \"search_strategy\": \"vanilla\",\n \"hybrid_settings\": {\n \"full_text_weight\": 1,\n \"semantic_weight\": 5,\n \"full_text_limit\": 200,\n \"rrf_k\": 50\n },\n \"chunk_settings\": {\n \"probes\": 10,\n \"ef_search\": 40,\n \"enabled\": true\n },\n \"graph_settings\": {\n \"limits\": \"<array>\",\n \"enabled\": true\n },\n \"num_sub_queries\": 5\n },\n \"rag_generation_config\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"max_tokens_to_sample\": 123,\n \"stream\": true,\n \"functions\": \"<array>\",\n \"tools\": \"<array>\",\n \"add_generation_kwargs\": \"<array>\",\n \"api_base\": \"<string>\",\n \"response_format\": [\n {\n \"Base Model\": {}\n }\n ],\n \"extended_thinking\": false,\n \"thinking_budget\": 123,\n \"reasoning_effort\": \"<string>\"\n },\n \"research_generation_config\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"max_tokens_to_sample\": 123,\n \"stream\": true,\n \"functions\": \"<array>\",\n \"tools\": \"<array>\",\n \"add_generation_kwargs\": \"<array>\",\n \"api_base\": \"<string>\",\n \"response_format\": [\n {\n \"Base Model\": {}\n }\n ],\n \"extended_thinking\": false,\n \"thinking_budget\": 123,\n \"reasoning_effort\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"search_settings\": {\n \"use_hybrid_search\": false,\n \"use_semantic_search\": true,\n \"use_fulltext_search\": false,\n \"filters\": \"<string>\",\n \"limit\": 10,\n \"offset\": \"0\",\n \"include_metadatas\": true,\n \"include_scores\": true,\n \"search_strategy\": \"vanilla\",\n \"hybrid_settings\": {\n \"full_text_weight\": 1,\n \"semantic_weight\": 5,\n \"full_text_limit\": 200,\n \"rrf_k\": 50\n },\n \"chunk_settings\": {\n \"probes\": 10,\n \"ef_search\": 40,\n \"enabled\": true\n },\n \"graph_settings\": {\n \"limits\": \"<array>\",\n \"enabled\": true\n },\n \"num_sub_queries\": 5\n },\n \"rag_generation_config\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"max_tokens_to_sample\": 123,\n \"stream\": true,\n \"functions\": \"<array>\",\n \"tools\": \"<array>\",\n \"add_generation_kwargs\": \"<array>\",\n \"api_base\": \"<string>\",\n \"response_format\": [\n {\n \"Base Model\": {}\n }\n ],\n \"extended_thinking\": false,\n \"thinking_budget\": 123,\n \"reasoning_effort\": \"<string>\"\n },\n \"research_generation_config\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"max_tokens_to_sample\": 123,\n \"stream\": true,\n \"functions\": \"<array>\",\n \"tools\": \"<array>\",\n \"add_generation_kwargs\": \"<array>\",\n \"api_base\": \"<string>\",\n \"response_format\": [\n {\n \"Base Model\": {}\n }\n ],\n \"extended_thinking\": false,\n \"thinking_budget\": 123,\n \"reasoning_effort\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"results": {
"messages": [
{
"role": "assistant",
"content": "Aristotle (384–322 BC) was an Ancient\n Greek philosopher and polymath whose contributions\n have had a profound impact on various fields of\n knowledge.\n Here are some key points about his life and work:\n \n\n1. **Early Life**: Aristotle was born in 384 BC in\n Stagira, Chalcidice, which is near modern-day\n Thessaloniki, Greece. His father, Nicomachus, was the\n personal physician to King Amyntas of Macedon, which\n exposed Aristotle to medical and biological knowledge\n from a young age [C].\n\n2. **Education and Career**:\n After the death of his parents, Aristotle was sent to\n Athens to study at Plato's Academy, where he remained\n for about 20 years. After Plato's death, Aristotle\n left Athens and eventually became the tutor of\n Alexander the Great [C].\n \n\n3. **Philosophical Contributions**: Aristotle\n founded the Lyceum in Athens, where he established the\n Peripatetic school of philosophy. His works cover a\n wide range of subjects, including metaphysics, ethics,\n politics, logic, biology, and aesthetics. His writings\n laid the groundwork for many modern scientific and\n philosophical inquiries [A].\n\n4. **Legacy**:\n Aristotle's influence extends beyond philosophy to the\n natural sciences, linguistics, economics, and\n psychology. His method of systematic observation and\n analysis has been foundational to the development of\n modern science [A].\n\nAristotle's comprehensive\n approach to knowledge and his systematic methodology\n have earned him a lasting legacy as one of the\n greatest philosophers of all time.\n\nSources:\n \n- [A] Aristotle's broad range of writings and\n influence on modern science.\n- [C] Details about\n Aristotle's early life and education.",
"metadata": {
"aggregated_search_results": {
"chunk_search_results": [
{
"document_id": "3e157b3a-8469-51db-90d9-52e7d896b49b",
"id": "3f3d47f3-8baf-58eb-8bc2-0171fb1c6e09",
"metadata": {
"associated_query": "What is the capital of France?",
"title": "example_document.pdf"
},
"owner_id": "2acb499e-8428-543b-bd85-0d9098718220",
"score": 0.23943702876567796,
"text": "Example text from the document"
}
],
"document_search_results": [
{
"document": {
"chunks": [
"Chunk 1",
"Chunk 2"
],
"id": "3f3d47f3-8baf-58eb-8bc2-0171fb1c6e09",
"metadata": {},
"title": "Document Title"
}
}
],
"graph_search_results": [
{
"chunk_ids": [
"c68dc72e-fc23-5452-8f49-d7bd46088a96"
],
"content": {
"description": "Entity Description",
"id": "3f3d47f3-8baf-58eb-8bc2-0171fb1c6e09",
"metadata": {},
"name": "Entity Name"
},
"metadata": {
"associated_query": "What is the capital of France?"
},
"result_type": "entity"
}
],
"web_search_results": [
{
"date": "2021-01-01",
"link": "https://example.com/page",
"position": 1,
"sitelinks": [
{
"link": "https://example.com/sitelink",
"title": "Sitelink Title"
}
],
"snippet": "Page snippet",
"title": "Page Title"
}
]
},
"citations": [
{
"collection_ids": [
"122fdf6a-e116-546b-a8f6-e4cb2e2c0a09"
],
"document_id": "\n e43864f5-a36f-548e-aacd-6f8d48b30c7f\n ",
"endIndex": 396,
"id": "e760bb76-1c6e-52eb-910d-0ce5b567011b",
"index": 1,
"metadata": {
"chunk_order": 68,
"document_type": "pdf",
"license": "CC-BY-4.0",
"title": "DeepSeek_R1.pdf"
},
"owner_id": "\n 2acb499e-8428-543b-bd85-0d9098718220\n ",
"rawIndex": 9,
"score": 0.64,
"snippetEndIndex": 418,
"snippetStartIndex": 320,
"sourceType": "chunk",
"startIndex": 393,
"text": "\n Document Title: DeepSeek_R1.pdf\n \n\nText: could achieve an accuracy of ...\n "
}
]
}
}
],
"conversation_id": "a32b4c5d-6e7f-8a9b-0c1d-2e3f4a5b6c7d"
}
}{}{}RAG-Powered Conversational Agent
The R2R Agent endpoint provides a conversational RAG interface for retrieval, reasoning, and research. It supports multi-turn context, tool integration, streaming output, and both RAG and Research modes for dynamic AI-driven analysis.
curl --request POST \
--url https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"search_settings": {
"use_hybrid_search": false,
"use_semantic_search": true,
"use_fulltext_search": false,
"filters": "<string>",
"limit": 10,
"offset": "0",
"include_metadatas": true,
"include_scores": true,
"search_strategy": "vanilla",
"hybrid_settings": {
"full_text_weight": 1,
"semantic_weight": 5,
"full_text_limit": 200,
"rrf_k": 50
},
"chunk_settings": {
"probes": 10,
"ef_search": 40,
"enabled": true
},
"graph_settings": {
"limits": "<array>",
"enabled": true
},
"num_sub_queries": 5
},
"rag_generation_config": {
"model": "<string>",
"temperature": 123,
"top_p": 123,
"max_tokens_to_sample": 123,
"stream": true,
"functions": "<array>",
"tools": "<array>",
"add_generation_kwargs": "<array>",
"api_base": "<string>",
"response_format": [
{
"Base Model": {}
}
],
"extended_thinking": false,
"thinking_budget": 123,
"reasoning_effort": "<string>"
},
"research_generation_config": {
"model": "<string>",
"temperature": 123,
"top_p": 123,
"max_tokens_to_sample": 123,
"stream": true,
"functions": "<array>",
"tools": "<array>",
"add_generation_kwargs": "<array>",
"api_base": "<string>",
"response_format": [
{
"Base Model": {}
}
],
"extended_thinking": false,
"thinking_budget": 123,
"reasoning_effort": "<string>"
}
}
'import requests
url = "https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent"
payload = {
"search_settings": {
"use_hybrid_search": False,
"use_semantic_search": True,
"use_fulltext_search": False,
"filters": "<string>",
"limit": 10,
"offset": "0",
"include_metadatas": True,
"include_scores": True,
"search_strategy": "vanilla",
"hybrid_settings": {
"full_text_weight": 1,
"semantic_weight": 5,
"full_text_limit": 200,
"rrf_k": 50
},
"chunk_settings": {
"probes": 10,
"ef_search": 40,
"enabled": True
},
"graph_settings": {
"limits": "<array>",
"enabled": True
},
"num_sub_queries": 5
},
"rag_generation_config": {
"model": "<string>",
"temperature": 123,
"top_p": 123,
"max_tokens_to_sample": 123,
"stream": True,
"functions": "<array>",
"tools": "<array>",
"add_generation_kwargs": "<array>",
"api_base": "<string>",
"response_format": [{ "Base Model": {} }],
"extended_thinking": False,
"thinking_budget": 123,
"reasoning_effort": "<string>"
},
"research_generation_config": {
"model": "<string>",
"temperature": 123,
"top_p": 123,
"max_tokens_to_sample": 123,
"stream": True,
"functions": "<array>",
"tools": "<array>",
"add_generation_kwargs": "<array>",
"api_base": "<string>",
"response_format": [{ "Base Model": {} }],
"extended_thinking": False,
"thinking_budget": 123,
"reasoning_effort": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
search_settings: {
use_hybrid_search: false,
use_semantic_search: true,
use_fulltext_search: false,
filters: '<string>',
limit: 10,
offset: '0',
include_metadatas: true,
include_scores: true,
search_strategy: 'vanilla',
hybrid_settings: {full_text_weight: 1, semantic_weight: 5, full_text_limit: 200, rrf_k: 50},
chunk_settings: {probes: 10, ef_search: 40, enabled: true},
graph_settings: {limits: '<array>', enabled: true},
num_sub_queries: 5
},
rag_generation_config: {
model: '<string>',
temperature: 123,
top_p: 123,
max_tokens_to_sample: 123,
stream: true,
functions: '<array>',
tools: '<array>',
add_generation_kwargs: '<array>',
api_base: '<string>',
response_format: [{'Base Model': {}}],
extended_thinking: false,
thinking_budget: 123,
reasoning_effort: '<string>'
},
research_generation_config: {
model: '<string>',
temperature: 123,
top_p: 123,
max_tokens_to_sample: 123,
stream: true,
functions: '<array>',
tools: '<array>',
add_generation_kwargs: '<array>',
api_base: '<string>',
response_format: [{'Base Model': {}}],
extended_thinking: false,
thinking_budget: 123,
reasoning_effort: '<string>'
}
})
};
fetch('https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'search_settings' => [
'use_hybrid_search' => false,
'use_semantic_search' => true,
'use_fulltext_search' => false,
'filters' => '<string>',
'limit' => 10,
'offset' => '0',
'include_metadatas' => true,
'include_scores' => true,
'search_strategy' => 'vanilla',
'hybrid_settings' => [
'full_text_weight' => 1,
'semantic_weight' => 5,
'full_text_limit' => 200,
'rrf_k' => 50
],
'chunk_settings' => [
'probes' => 10,
'ef_search' => 40,
'enabled' => true
],
'graph_settings' => [
'limits' => '<array>',
'enabled' => true
],
'num_sub_queries' => 5
],
'rag_generation_config' => [
'model' => '<string>',
'temperature' => 123,
'top_p' => 123,
'max_tokens_to_sample' => 123,
'stream' => true,
'functions' => '<array>',
'tools' => '<array>',
'add_generation_kwargs' => '<array>',
'api_base' => '<string>',
'response_format' => [
[
'Base Model' => [
]
]
],
'extended_thinking' => false,
'thinking_budget' => 123,
'reasoning_effort' => '<string>'
],
'research_generation_config' => [
'model' => '<string>',
'temperature' => 123,
'top_p' => 123,
'max_tokens_to_sample' => 123,
'stream' => true,
'functions' => '<array>',
'tools' => '<array>',
'add_generation_kwargs' => '<array>',
'api_base' => '<string>',
'response_format' => [
[
'Base Model' => [
]
]
],
'extended_thinking' => false,
'thinking_budget' => 123,
'reasoning_effort' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent"
payload := strings.NewReader("{\n \"search_settings\": {\n \"use_hybrid_search\": false,\n \"use_semantic_search\": true,\n \"use_fulltext_search\": false,\n \"filters\": \"<string>\",\n \"limit\": 10,\n \"offset\": \"0\",\n \"include_metadatas\": true,\n \"include_scores\": true,\n \"search_strategy\": \"vanilla\",\n \"hybrid_settings\": {\n \"full_text_weight\": 1,\n \"semantic_weight\": 5,\n \"full_text_limit\": 200,\n \"rrf_k\": 50\n },\n \"chunk_settings\": {\n \"probes\": 10,\n \"ef_search\": 40,\n \"enabled\": true\n },\n \"graph_settings\": {\n \"limits\": \"<array>\",\n \"enabled\": true\n },\n \"num_sub_queries\": 5\n },\n \"rag_generation_config\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"max_tokens_to_sample\": 123,\n \"stream\": true,\n \"functions\": \"<array>\",\n \"tools\": \"<array>\",\n \"add_generation_kwargs\": \"<array>\",\n \"api_base\": \"<string>\",\n \"response_format\": [\n {\n \"Base Model\": {}\n }\n ],\n \"extended_thinking\": false,\n \"thinking_budget\": 123,\n \"reasoning_effort\": \"<string>\"\n },\n \"research_generation_config\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"max_tokens_to_sample\": 123,\n \"stream\": true,\n \"functions\": \"<array>\",\n \"tools\": \"<array>\",\n \"add_generation_kwargs\": \"<array>\",\n \"api_base\": \"<string>\",\n \"response_format\": [\n {\n \"Base Model\": {}\n }\n ],\n \"extended_thinking\": false,\n \"thinking_budget\": 123,\n \"reasoning_effort\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"search_settings\": {\n \"use_hybrid_search\": false,\n \"use_semantic_search\": true,\n \"use_fulltext_search\": false,\n \"filters\": \"<string>\",\n \"limit\": 10,\n \"offset\": \"0\",\n \"include_metadatas\": true,\n \"include_scores\": true,\n \"search_strategy\": \"vanilla\",\n \"hybrid_settings\": {\n \"full_text_weight\": 1,\n \"semantic_weight\": 5,\n \"full_text_limit\": 200,\n \"rrf_k\": 50\n },\n \"chunk_settings\": {\n \"probes\": 10,\n \"ef_search\": 40,\n \"enabled\": true\n },\n \"graph_settings\": {\n \"limits\": \"<array>\",\n \"enabled\": true\n },\n \"num_sub_queries\": 5\n },\n \"rag_generation_config\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"max_tokens_to_sample\": 123,\n \"stream\": true,\n \"functions\": \"<array>\",\n \"tools\": \"<array>\",\n \"add_generation_kwargs\": \"<array>\",\n \"api_base\": \"<string>\",\n \"response_format\": [\n {\n \"Base Model\": {}\n }\n ],\n \"extended_thinking\": false,\n \"thinking_budget\": 123,\n \"reasoning_effort\": \"<string>\"\n },\n \"research_generation_config\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"max_tokens_to_sample\": 123,\n \"stream\": true,\n \"functions\": \"<array>\",\n \"tools\": \"<array>\",\n \"add_generation_kwargs\": \"<array>\",\n \"api_base\": \"<string>\",\n \"response_format\": [\n {\n \"Base Model\": {}\n }\n ],\n \"extended_thinking\": false,\n \"thinking_budget\": 123,\n \"reasoning_effort\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"search_settings\": {\n \"use_hybrid_search\": false,\n \"use_semantic_search\": true,\n \"use_fulltext_search\": false,\n \"filters\": \"<string>\",\n \"limit\": 10,\n \"offset\": \"0\",\n \"include_metadatas\": true,\n \"include_scores\": true,\n \"search_strategy\": \"vanilla\",\n \"hybrid_settings\": {\n \"full_text_weight\": 1,\n \"semantic_weight\": 5,\n \"full_text_limit\": 200,\n \"rrf_k\": 50\n },\n \"chunk_settings\": {\n \"probes\": 10,\n \"ef_search\": 40,\n \"enabled\": true\n },\n \"graph_settings\": {\n \"limits\": \"<array>\",\n \"enabled\": true\n },\n \"num_sub_queries\": 5\n },\n \"rag_generation_config\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"max_tokens_to_sample\": 123,\n \"stream\": true,\n \"functions\": \"<array>\",\n \"tools\": \"<array>\",\n \"add_generation_kwargs\": \"<array>\",\n \"api_base\": \"<string>\",\n \"response_format\": [\n {\n \"Base Model\": {}\n }\n ],\n \"extended_thinking\": false,\n \"thinking_budget\": 123,\n \"reasoning_effort\": \"<string>\"\n },\n \"research_generation_config\": {\n \"model\": \"<string>\",\n \"temperature\": 123,\n \"top_p\": 123,\n \"max_tokens_to_sample\": 123,\n \"stream\": true,\n \"functions\": \"<array>\",\n \"tools\": \"<array>\",\n \"add_generation_kwargs\": \"<array>\",\n \"api_base\": \"<string>\",\n \"response_format\": [\n {\n \"Base Model\": {}\n }\n ],\n \"extended_thinking\": false,\n \"thinking_budget\": 123,\n \"reasoning_effort\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"results": {
"messages": [
{
"role": "assistant",
"content": "Aristotle (384–322 BC) was an Ancient\n Greek philosopher and polymath whose contributions\n have had a profound impact on various fields of\n knowledge.\n Here are some key points about his life and work:\n \n\n1. **Early Life**: Aristotle was born in 384 BC in\n Stagira, Chalcidice, which is near modern-day\n Thessaloniki, Greece. His father, Nicomachus, was the\n personal physician to King Amyntas of Macedon, which\n exposed Aristotle to medical and biological knowledge\n from a young age [C].\n\n2. **Education and Career**:\n After the death of his parents, Aristotle was sent to\n Athens to study at Plato's Academy, where he remained\n for about 20 years. After Plato's death, Aristotle\n left Athens and eventually became the tutor of\n Alexander the Great [C].\n \n\n3. **Philosophical Contributions**: Aristotle\n founded the Lyceum in Athens, where he established the\n Peripatetic school of philosophy. His works cover a\n wide range of subjects, including metaphysics, ethics,\n politics, logic, biology, and aesthetics. His writings\n laid the groundwork for many modern scientific and\n philosophical inquiries [A].\n\n4. **Legacy**:\n Aristotle's influence extends beyond philosophy to the\n natural sciences, linguistics, economics, and\n psychology. His method of systematic observation and\n analysis has been foundational to the development of\n modern science [A].\n\nAristotle's comprehensive\n approach to knowledge and his systematic methodology\n have earned him a lasting legacy as one of the\n greatest philosophers of all time.\n\nSources:\n \n- [A] Aristotle's broad range of writings and\n influence on modern science.\n- [C] Details about\n Aristotle's early life and education.",
"metadata": {
"aggregated_search_results": {
"chunk_search_results": [
{
"document_id": "3e157b3a-8469-51db-90d9-52e7d896b49b",
"id": "3f3d47f3-8baf-58eb-8bc2-0171fb1c6e09",
"metadata": {
"associated_query": "What is the capital of France?",
"title": "example_document.pdf"
},
"owner_id": "2acb499e-8428-543b-bd85-0d9098718220",
"score": 0.23943702876567796,
"text": "Example text from the document"
}
],
"document_search_results": [
{
"document": {
"chunks": [
"Chunk 1",
"Chunk 2"
],
"id": "3f3d47f3-8baf-58eb-8bc2-0171fb1c6e09",
"metadata": {},
"title": "Document Title"
}
}
],
"graph_search_results": [
{
"chunk_ids": [
"c68dc72e-fc23-5452-8f49-d7bd46088a96"
],
"content": {
"description": "Entity Description",
"id": "3f3d47f3-8baf-58eb-8bc2-0171fb1c6e09",
"metadata": {},
"name": "Entity Name"
},
"metadata": {
"associated_query": "What is the capital of France?"
},
"result_type": "entity"
}
],
"web_search_results": [
{
"date": "2021-01-01",
"link": "https://example.com/page",
"position": 1,
"sitelinks": [
{
"link": "https://example.com/sitelink",
"title": "Sitelink Title"
}
],
"snippet": "Page snippet",
"title": "Page Title"
}
]
},
"citations": [
{
"collection_ids": [
"122fdf6a-e116-546b-a8f6-e4cb2e2c0a09"
],
"document_id": "\n e43864f5-a36f-548e-aacd-6f8d48b30c7f\n ",
"endIndex": 396,
"id": "e760bb76-1c6e-52eb-910d-0ce5b567011b",
"index": 1,
"metadata": {
"chunk_order": 68,
"document_type": "pdf",
"license": "CC-BY-4.0",
"title": "DeepSeek_R1.pdf"
},
"owner_id": "\n 2acb499e-8428-543b-bd85-0d9098718220\n ",
"rawIndex": 9,
"score": 0.64,
"snippetEndIndex": 418,
"snippetStartIndex": 320,
"sourceType": "chunk",
"startIndex": 393,
"text": "\n Document Title: DeepSeek_R1.pdf\n \n\nText: could achieve an accuracy of ...\n "
}
]
}
}
],
"conversation_id": "a32b4c5d-6e7f-8a9b-0c1d-2e3f4a5b6c7d"
}
}{}{}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
Show child attributes
Show child attributes
Pre-configured search modes: basic, advanced, or custom.
basic, advanced, custom The search configuration object for retrieving context.
Show child attributes
Show child attributes
Configuration for RAG generation in 'rag' mode
Show child attributes
Show child attributes
Configuration for generation in ‘research’ mode. If not provided but mode=‘research’, rag_generation_config will be used with appropriate model overrides.
Show child attributes
Show child attributes
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
Show child attributes
Show child attributes
Was this page helpful?