Deep Research tutorial
Manually creating structured reports for complex topics, such as industry trend analyses or technical feasibility studies, by integrating information from multiple sources is time-consuming and tedious. Deep Research is an autonomous AI system powered by a large language model (LLM) designed to automate this process. When you submit a research topic, the system automatically performs task decomposition, conducts multi-step reasoning, retrieves and integrates information from various sources, and generates a professional-grade research report that is logically structured and fully cited.
How it works
Deep Research uses a multi-agent collaborative architecture that simulates the research process of an expert team. After receiving a user's query, the system initiates a "perceive-think-act-reflect" closed loop to collaboratively complete the task.
Collaboration workflow
-
Planning: The PlannerAgent first conducts background research to understand the user's complex problem. It then decomposes the task into a research plan structured as a directed acyclic graph (DAG).
-
Researching: Multiple ResearcherAgents execute the sub-tasks in the plan, either in parallel or in sequence. Each agent autonomously selects and calls tools, such as a search engine, crawler tool, or code interpreter, to collect and analyze information, generating preliminary sub-reports.
-
Reporting: The ReporterAgent consolidates all sub-reports and research data. It then organizes, summarizes, and refines the information to generate a final, well-structured research report with citations.
Core components
|
Component type |
Name |
Description |
|
Agents |
|
Performs task decomposition and generates a research plan. |
|
|
Executes specific research steps, calls tools, and generates sub-reports. |
|
|
|
Processes and understands multimodal data, such as images and tables, to enrich report content. |
|
|
|
Aggregates all information to generate the final report in Markdown or HTML format. |
|
|
Tools |
Search tool |
Calls external search engines or internal knowledge bases to retrieve information. |
|
Crawler tool |
Accesses web links to retrieve full-text content. |
|
|
Code interpreter |
Analyzes data and generates charts. |
Get started
Console quick start
-
Go to the OpenSearch console, select the LLM-based Conversational Search Edition, click Instance Management in the left navigation bar, and then select the target instance and click Manage.
-
Go to the instance details page, click Q&A Test, enable Deep Research, enter your question in the dialog box, and click Send.
In the Model Selector, choose deepseek-r1 and enable the Web Search toggle.
-
The system takes approximately 5 to 15 minutes to return the result and reasoning process. After the task is complete, you can click
to view the result in your History.
Code samples
The Deep Research feature is integrated into the MultiSearch API and the knowledge-search API. To use this feature, set the options.chat.enable_deep_research parameter to true. For usage details, see the API specification.
Initiate a task
By default, the number of concurrent tasks for an LLM-based Conversational Search Edition instance is two per RAM user. To increase your concurrency, contact technical support.
Java
-
Add dependency
<dependency> <groupId>com.aliyun.opensearch</groupId> <artifactId>aliyun-sdk-opensearch</artifactId> <version>6.0.0</version> </dependency> -
Request sample
package com.aliyun.opensearch; import com.aliyun.opensearch.OpenSearchClient; import com.aliyun.opensearch.sdk.generated.OpenSearch; import com.aliyun.opensearch.sdk.generated.commons.OpenSearchClientException; import com.aliyun.opensearch.sdk.generated.commons.OpenSearchException; import com.aliyun.opensearch.sdk.generated.commons.OpenSearchResult; import java.util.HashMap; import java.util.Map; public class LLMSearch { private static String accesskey = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_ID"); private static String secret = System.getenv("ALIBABA_CLOUD_ACCESS_KEY_SECRET"); private static String appName = "your-app-name"; private static String host = "your-api-endpoint"; private static String path = "/apps/%s/actions/multi-search"; public static void main(String[] args) { String appPath = String.format(path, appName); //ApiReadTimeOut OpenSearch openSearch = new OpenSearch(accesskey, secret, host); openSearch.setTimeout(90000); OpenSearchClient openSearchClient = new OpenSearchClient(openSearch); Map<String, String> params = new HashMap<String, String>() {{ put("format", "full_json"); put("_POST_BODY", "{\"question\":{\"text\":\"What are the recent epidemic trends in China (Hangzhou)?\",\"type\":\"TEXT\"},\"options\":{\"retrieve\":{\"entry\":{\"sf\":\"\",\"filter\":\"\"},\"image\":{\"sf\":\"\",\"dense_weight\":\"0.7\"},\"web_search\":{\"enable\":true},\"return_hits\":false,\"graph\":{\"enable\":true},\"doc\":{\"filter\":\"\",\"top_n\":5,\"sf\":\"\",\"dense_weight\":\"0.7\",\"formula\":\"\",\"operator\":\"AND\"},\"qp\":{\"query_extend\":false,\"query_extend_num\":5},\"rerank\":{\"enable\":true,\"model\":\"ops-bge-reranker-larger\"}},\"chat\":{\"stream\":true,\"enable_deep_research\":true,\"enable_deep_search\":false,\"model\":\"deepseek-v3\",\"agent\":{\"tools\":[],\"max_think_round\":10,\"think_process\":true,\"language\":\"CN\"},\"prompt_config\":{\"attitude\":\"normal\",\"rule\":\"detailed\",\"noanswer\":\"sorry\",\"language\":\"Chinese\",\"role\":false,\"role_name\":\"AI Assistant\",\"out_format\":\"text\"},\"csi_level\":\"strict\",\"output_format\":\"markdown\",\"history_max\":\"\",\"link\":\"true\",\"rich_text_strategy\":\"inside_response\",\"enable_llm_knowledge\":true,\"model_generation\":\"\"}}}"); }}; try { OpenSearchResult openSearchResult = openSearchClient .callAndDecodeResult(appPath, params, "POST"); System.out.println("RequestID=" + openSearchResult.getTraceInfo().getRequestId()); System.out.println(openSearchResult.getResult()); } catch ( OpenSearchException e) { System.out.println("RequestID=" + e.getRequestId()); System.out.println("ErrorCode=" + e.getCode()); System.out.println("ErrorMessage=" + e.getMessage()); } catch ( OpenSearchClientException e) { System.out.println("ErrorMessage=" + e.getMessage()); } } }
curl
Send a task request
curl --location '{host}/v3/openapi/apps/{app_group_identity}/actions/multi-search' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {API key}' \
--data '{
"question": {
"text": "What are the recent epidemic trends in China (Hangzhou)?",
"type": "TEXT"
},
"options": {
"retrieve": {
"entry": {"sf": "", "filter": ""},
"image": {"sf": "", "dense_weight": "0.7"},
"web_search": {"enable": true},
"return_hits": false,
"graph": {"enable": true},
"doc": {
"filter": "",
"top_n": 5,
"sf": "",
"dense_weight": "0.7",
"formula": "",
"operator": "AND"
},
"qp": {"query_extend": false, "query_extend_num": 5},
"rerank": {"enable": true, "model": "ops-bge-reranker-larger"}
},
"chat": {
"stream": true,
"enable_deep_search": false,
"enable_deep_research": true,
"model": "deepseek-v3",
"agent": {
"tools": [],
"max_think_round": 10,
"think_process": true,
"language": "CN"
},
"prompt_config": {
"attitude": "normal",
"rule": "detailed",
"noanswer": "sorry",
"language": "Chinese",
"role": false,
"role_name": "AI Assistant",
"out_format": "text"
},
"csi_level": "strict",
"output_format": "markdown",
"history_max": "",
"link": "true",
"rich_text_strategy": "inside_response",
"enable_llm_knowledge": true,
"model_generation": ""
}
}
}'
Deep Research is a complex asynchronous task that typically takes 5 to 15 minutes to complete. Results are streamed, allowing you to observe each step of the execution. The following is a sample response:
Response parameters:
|
Parameter |
Type |
Description |
|
request_id |
String |
The unique request ID, used for issue tracking. |
|
status |
String |
The execution status. Valid values:
|
|
latency |
Float |
The total latency of the API call (ms). |
|
result.process_status |
String |
The processing status. Valid values:
|
|
result.latency |
Integer |
The time taken to generate the result (ms). |
|
result.data[] |
Array[Object] |
An array of core data nodes. |
|
result.data[].answer |
String |
The content returned by the node (Markdown format). |
|
result.data[].type |
String |
The content type. Valid values:
|
|
result.data[].event |
String |
The node event type. Valid values:
|
|
result.data[].event_status |
String |
The event status. Valid values:
|
|
result.data[].parent_id |
String |
The ID of the parent node (UUID format). |
|
result.data[].node_id |
String |
The ID of the current node (agent node identifier). |
|
result.data[].latency |
Integer |
The processing time of the node (ms). |
|
result.data[].step |
Integer |
The step number. |
|
result.data[].reference[] |
Array[Object] |
An array of reference source information. |
|
result.data[].reference[].score |
Float |
The relevance score of the source (0.0 to 1.0). |
|
result.data[].reference[].title |
String |
The title of the source (max length: 120 characters). |
|
result.data[].reference[].url |
String |
The link to the source (must be a valid URL). |
|
result.data[].details[] |
Array[Object] |
An array of child node details (same structure as data[]). |
|
result.data[].details[].answer |
String |
The content of the child node. |
|
result.data[].details[].type |
String |
The content type of the child node. |
|
result.data[].details[].event |
String |
The event type of the child node. |
|
result.data[].details[].event_status |
String |
The event status of the child node. |
|
result.data[].details[].parent_id |
String |
The parent ID of the child node. |
|
result.data[].details[].node_id |
String |
The ID of the child node. |
|
result.data[].details[].latency |
Integer |
The processing time of the child node. |
|
result.data[].details[].step |
Integer |
The sub-step number. |
|
result.data[].details[].reference[] |
Array[Object] |
The reference sources for the child node. |
|
result.data[].details[].reference[].score |
Float |
The relevance score of the child source. |
|
result.data[].details[].reference[].title |
String |
The title of the child source. |
|
result.data[].details[].reference[].url |
String |
The link to the child source. |
Retrieving historical task results
After a successful call, you can use the task ID to view the results of previous tasks.
-
Call the chat history list API to retrieve the chat history.
curl -X GET "{host}/v3/openapi/apps/{app_group_identity}/chat-history?page_number=1&page_size=10" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer {API key}"(base) hxxx ~ % curl -X GET "http://xxx-hangzhou.aliyuncs.com/v3/openapi/apps/xxx/chat-history?page_number=1&page_size=10" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer xxx" {"request_id":"fxxx3f","status":"OK","total_count":7,"latency":0.0,"result":[{"chat_id":"d6883afb-7xxx","title":"What are the recent epidemic trends in China (Hangzhou)?","time":"2025-10-16 15:19:11","status":"SUCCESS","type":"DEEP_RESEARCH"},{"chat_id":"79xxxc9971c3343cfb","title":"What is the weather forecast for China (Hangzhou) for the next few days?","time":"2025-10-16 12:03:38","status":"SUCCESS","type":"DEEP_RESEARCH"},{"chat_id":"xxx-af43-f82794aed581","title":"What is the weather forecast for China (Hangzhou) for the next few days?","time":"2025-10-16 11:10:53","status":"SUCCESS","type":"DEEP_RESEARCH"},{"chat_id":"364xxx-bdff4f3c3276","title":"What is the weather forecast for China (Hangzhou) for the next few days?","time":"2025-10-16 10:40:54","status":"SUCCESS","type":"DEEP_RESEARCH"},{"chat_id":"7xxx","title":"What is the weather forecast for China (Hangzhou) for the next few days?","time":"2025-10-16 10:30:55","status":"SUCCESS","type":"DEEP_RESEARCH"},{"chat_id":"0xxxf889181485e","title":"What is the weather forecast for China (Hangzhou) for the next few days?","time":"2025-10-16 09:56:26","status":"SUCCESS","type":"DEEP_RESEARCH"},{"chat_id":"12xxx067e0dd","title":"What is the weather forecast for China (Hangzhou) for the next few days?","time":"2025-10-15 19:38:42","status":"SUCCESS","type":"DEEP_SEARCH"}],"errors":[]}% -
Obtain the chat_id from the response and call the following API to get the chat details:
curl -X POST "http://{host}/v3/openapi/apps/{app_group_identity}/agent-tasks/{chat_id}" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer {API key}" \ -d '{"stream": true}'
Canceling a task
If a task's output does not meet your expectations, you can cancel it by calling the following API.
Request URL:
DELETE /v3/openapi/apps/{app_group_identity}/agent-tasks/{task_id}