curl --request POST \
--url https://api.intelligence.io.solutions/api/r2r/v3/retrieval/agent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"Params": {
"role": "system",
"content": "<string>",
"name": "<string>",
"function_call": "<array>",
"tool_calls": "<array>",
"tool_call_id": "<string>",
"metadata": "<array>",
"structured_content": "<array>",
"image_url": "<string>",
"image_data": "<array>"
},
"search_mode": "basic",
"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": {
"index_measure": "l2_distance",
"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>"
},
"rag_tools": "web_search"
}
'{
"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"
}
}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 '
{
"Params": {
"role": "system",
"content": "<string>",
"name": "<string>",
"function_call": "<array>",
"tool_calls": "<array>",
"tool_call_id": "<string>",
"metadata": "<array>",
"structured_content": "<array>",
"image_url": "<string>",
"image_data": "<array>"
},
"search_mode": "basic",
"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": {
"index_measure": "l2_distance",
"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>"
},
"rag_tools": "web_search"
}
'{
"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"
}
}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."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. |
conversation_id field.
How it works:
conversation_id.The access token received from the authorization server in the OAuth 2.0 flow.
Current message to process
Show child attributes
Or allowed string *
system, user, assistant, function, tool Pre-configured search modes: basic, advanced, or custom.
basic, advanced, custom The search configuration object for retrieving context.
Show child attributes
Whether to perform a hybrid search. This is equivalent to setting use_semantic_search=True and use_fulltext_search=True, e.g. combining vector and keyword search.
Whether to use semantic search
Whether to use full-text search
Filters to apply to the search. Allowed operators include eq, neq, gt, gte, lt, lte, like, ilike, in, and nin. Commonly seen filters include operations include the following: {"document_id": {"$eq": "9fbe403b-..."}} {"document_id": {"$in": ["9fbe403b-...", "3e157b3a-..."]}} {"collection_ids": {"$overlap": ["122fdf6a-...", "..."]}} {"$and": {"$document_id": ..., "collection_ids": ...}}
Maximum number of results to return. >=1 <=1000
Offset to paginate search results
Whether to include element metadata in the search results
Whether to include search score values in the search results
Search strategy to use (e.g., ‘vanilla’, ‘query_fusion’, ‘hyde’)
Settings for hybrid search (only used if use_semantic_search and use_fulltext_search are both true)
Show child attributes
Weight to apply to full text search
Weight to apply to semantic search
Maximum number of results to return from full text search
K-value for RRF (Rank Reciprocal Fusion)
Settings specific to chunk/vector search
Show child attributes
The distance measure to use for indexing
l2_distance, max_inner_product, cosine_distance, l1_distance, hamming_distance, jaccard_distance Number of ivfflat index lists to query. Higher increases accuracy but decreases speed.
Size of the dynamic candidate list for HNSW index search. Higher increases accuracy but decreases speed.
Whether to enable chunk search
Number of sub-queries/hypothetical docs to generate when using hyde or rag_fusion search strategies.
Configuration for RAG generation in 'rag' mode
Show child attributes
Flag to enable extended thinking mode (for Anthropic providers)
Token budget for internal reasoning when extended thinking mode is enabled. Must be less than max_tokens_to_sample.
Effort level for internal reasoning when extended thinking mode is enabled, low, medium, or high.Only applicable to OpenAI providers.
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
Flag to enable extended thinking mode (for Anthropic providers)
Token budget for internal reasoning when extended thinking mode is enabled. Must be less than max_tokens_to_sample.
Effort level for internal reasoning when extended thinking mode is enabled, low, medium, or high.Only applicable to OpenAI providers.
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 200
Show child attributes
Show child attributes
"assistant"
"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."
Show child attributes
Show child attributes
Show child attributes
"3e157b3a-8469-51db-90d9-52e7d896b49b"
"3f3d47f3-8baf-58eb-8bc2-0171fb1c6e09"
"2acb499e-8428-543b-bd85-0d9098718220"
0.23943702876567796
"Example text from the document"
Show child attributes
Show child attributes
"3f3d47f3-8baf-58eb-8bc2-0171fb1c6e09"
"Document Title"
Show child attributes
Show child attributes
"Entity Description"
"3f3d47f3-8baf-58eb-8bc2-0171fb1c6e09"
"Entity Name"
"entity"
Show child attributes
"2021-01-01"
"https://example.com/page"
1
"Page snippet"
"Page Title"
Show child attributes
"\n e43864f5-a36f-548e-aacd-6f8d48b30c7f\n "
396
"e760bb76-1c6e-52eb-910d-0ce5b567011b"
1
Show child attributes
68
"pdf"
"CC-BY-4.0"
"DeepSeek_R1.pdf"
"\n 2acb499e-8428-543b-bd85-0d9098718220\n "
9
0.64
418
320
"chunk"
393
"\n Document Title: DeepSeek_R1.pdf\n \n\nText: could achieve an accuracy of ...\n "
"a32b4c5d-6e7f-8a9b-0c1d-2e3f4a5b6c7d"
Was this page helpful?