Deep Research Agent
The Deep Research Agent, built on Dify on DMS, seamlessly integrates with your private knowledge base. It combines public information from the internet with internal private data to generate analysis reports that closely match your business scenarios. The system provides out-of-the-box functionality and low-code orchestration, with module-level configurability. You can extend and customize each submodule to ensure every step of the process meets your business requirements.
Prerequisites
-
You have deployed Dify on DMS.
-
Your Dify on DMS instance is version V1.6.0 or later. For more information, see View Dify version.
Procedure
Step 1: Install plugins
Log in to DMS 5.0.
-
Move the pointer over the
icon in the upper-left corner and choose . NoteIf you use the DMS console in normal mode, choose in the top navigation bar.
Click the name of the target workspace.
-
In the navigation pane on the left of the workspace, choose .
-
In the upper-right corner of the page, click plugins.
-
Install the required plugins.
-
Install the DMS plugin
-
Choose .
-
In the dialog box that appears, select the DMS Agent Policy checkbox.
-
Click Install.
-
After the plugin is installed, click Close.
-
-
Install Qwen
-
Choose .
-
Hover over the Qwen card and click Install.
-
In the dialog box that appears, click Install.
-
Click Install.
-
-
Step 2: Import the Deep Research Quick Start template
On the page, click Create from Template.
-
In the left-side navigation pane, click DMS Data+AI.
-
Hover over the Deep Research Quick Start card and click Use this template.
-
In the dialog box that appears, click Create.
The template is successfully imported when the Application created message appears in the upper-right corner and the diagram for the DEEP RESEARCH AGENT node is displayed correctly.
Step 3: Configure the Deep Research Agent
DMS preconfigures most settings for you. You only need to complete the final configuration step for an out-of-the-box experience.
-
Click the DEEP RESEARCH AGENT node.
-
In the Deep Research Agent panel on the right, enter your Quark Search API key.
NoteTo learn how to obtain an API key, see Create and view credentials.
-
Optional: Adjust the research strategy and the large language model (LLM) used in different stages.
NoteWe recommend starting with the default settings and customizing them later.
Parameter
Required
Description
AGENT Strategy
Yes
The Deep Research Structured strategy allows you to customize different research topics. The Deep Research CoT strategy performs more comprehensive and in-depth research but requires a longer execution time.
-
Deep Research Structured: Determines and researches a set of topics at the beginning of the process.
-
Deep Research CoT: Discovers and researches new topics based on existing findings during the research process.
Model (Report Writing)
Yes
The large language model (LLM) used for this stage.
Model (Summarization)
Model (Reflection and Optimization)
SEARCH AGENT
No
A user-defined submodule for the Deep Research Agent that defines the runtime logic for that stage. For more information, see Custom workflows.
SUMMARY AGENT
REPORT WRITING AGENT
-
Step 4: Preview the application
-
In the upper-right corner of the page, click Preview.
-
In the Chat with Bot text box, enter your query.
-
To the right of the Chat with Bot text box, click
Run.
Step 5: Publish and access API
-
In the upper-right corner of the page, click Publish.
-
In the dialog box that appears, click Publish Update.
-
After the Operation successful message appears in the upper-right corner, click Access API.
-
View the request examples.
Note-
When accessing the Dify service through the DMS domain, in addition to the API key for the Dify application itself, you must also add your Dify API key to the request headers for authentication.
-
After your first API query, the response includes a
conversation_id. To continue the conversation, include this conversation ID in subsequent requests.
-
Appendix
Custom workflows
DMS provides both an out-of-the-box version and a customizable version. You can define the processing logic for each stage of the Deep Research Agent by linking submodules (custom Dify workflows) to the SEARCH AGENT, SUMMARY AGENT, and REPORT WRITING AGENT parameters within the DEEP RESEARCH AGENT node.
DMS provides corresponding templates for each submodule for your reference.
-
Create a workflow.
-
At the top of the page, click Studio to return to the Studio main page.
-
Click Create from App Template.
-
In the left-side navigation pane, click DMS Data+AI.
-
Hover over the target workflow template card and click Use this template.
For example, under the DMS Data+AI category, find the Search Agent workflow template card.
-
In the dialog box that appears, click Create.
-
Optional: Follow the prompts to install any required plugins.
-
-
Configure and publish the workflow.
-
Configure the workflow based on your requirements.
-
In the upper-right corner of the page, click Publish.
-
In the dialog box that appears, click Publish Update.
-
-
Publish the workflow as a tool.
-
Click Publish as Tool.
-
Configure the tool based on your requirements.
NoteSet the tool call name for the Search Agent to
search_agent_example, the tool call name for the Summary Agent tosummary_agent_example, and the tool call name for the Report Writing Agent toreport_writing_agent.On the Publish as Tool page, set the Name to "Search Agent", the Tool Description to "Searches internet content and internal enterprise knowledge bases", and configure the tool input parameters as needed.
-
Click Save.
-
-
In the DEEP RESEARCH AGENT node, configure and enable the corresponding Dify workflow.
-
Return to the Deep Research Quick Start application.
-
Click the DEEP RESEARCH AGENT node.
-
Click the
icon next to the corresponding parameter (SEARCH AGENT, SUMMARY AGENT, or REPORT WRITING AGENT). -
In the dialog box that appears, click the Workflow tab.
-
Select the corresponding workflow.
-
Ensure the workflow is enabled.
The workflow contains three agent groups: SEARCH AGENT, SUMMARY AGENT, and REPORT WRITING AGENT. Make sure the toggle switch for each agent is turned on.
-
Workflow configuration examples
Search agent
By customizing the search agent, you are no longer limited to a single search engine. You can orchestrate a Dify workflow to create a multifunctional information retrieval tool that gathers data from multiple key channels simultaneously.
When customizing the search agent workflow, we recommend keeping the input and output variable names consistent with the template.
This workflow template has one required input variable, query. After the Start node, multiple retrieval branches run in parallel. The results from each branch are processed by separate code nodes and then consolidated in the Merge Search Results code node. Finally, the End node outputs the merged search results as an array.
In the search agent orchestration, you can flexibly combine these data sources and customize the final search ranking to enable a seamless connection between public and private data in your research workflow.
Internet data
Use Dify's third-party plugins to call general-purpose search engines like Tavily, Google, or Perplexity. Alternatively, use the Quark Search plugin available in the AliyunDMS plugin, which encapsulates the API of Alibaba Cloud Information Query Service.
Private knowledge base
Use Dify's built-in knowledge retrieval feature to quickly connect to your private knowledge base, such as internal documents and SOPs uploaded to Dify. You can also connect to external knowledge base APIs, such as RAGFlow.
Business databases
Use the integrated ChatBI Agent to query real-time business data directly with natural language. Use Dify's HTTP node to connect to data source query interfaces of your internal systems and paid professional data sources like Wind, Reuters, or LexisNexis.
Summary agent
The primary role of the summary agent in Deep Research is to refine raw information. This reduces the context length for subsequent report-writing stages and filters out irrelevant information. In Dify, you can adjust prompts and orchestrate workflows to customize how the summary agent summarizes content.
When customizing the summary agent workflow, we recommend keeping the input and output variable names consistent with the template.
This workflow template contains four sequential nodes: The Start node defines three required input variables (research_topic, search_results, and search_query). The Get Current Time node is configured with a FORMAT of %Y-%m-%d and a TIMEZONE of Asia/Shanghai, with an output variable named time. The Summarize & Abstract node uses the qwen-plus-latest model. The End node outputs the summarized text as a string.
Inject domain knowledge
You can integrate your business domain's technical terms and knowledge base into the summary agent. By providing a few examples (few-shot prompting), you can guide its summarization capabilities to better align with your business needs.
Multimodal analysis
In addition to text, the summary agent can call multimodal large language models to understand image information, enabling it to handle more complex analysis tasks.
Scenario customization
For tasks like tracking hot topics or analyzing case studies, you can adjust the prompt to have the summary agent generate a clear event timeline and focus on integrating different perspectives.
Report writing agent
You can customize the report writing agent to call a third-party plugin that converts the streamed Markdown report into a PDF or Word document. You can also use a DingTalk robot to directly @-mention relevant team members and send the report to them.
This workflow contains five sequential nodes: The Start node receives a required input parameter generated_report, which then passes through the MARKDOWN to PDF File node, the Generate Interactive Report (HTML) node (using the qwen-plus-latest model), and the Send Report to DingTalk Bot node (which requires configuring ACCESS_TOKEN and SIGN_SECRET, with MESSAGE_TYPE set to markdown). Finally, the End node outputs two string variables.
> Studio