Deep Research Agent

Updated at:

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

Procedure

Step 1: Install plugins

  1. Log in to DMS 5.0.

  2. Move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner and choose All Features > Data+AI > Dify.

    Note

    If you use the DMS console in normal mode, choose Data+AI > Dify in the top navigation bar.

  3. Click the name of the target workspace.

  4. In the navigation pane on the left of the workspace, choose image > Studio.

  5. In the upper-right corner of the page, click plugins.

  6. Install the required plugins.

    • Install the DMS plugin

      1. Choose Install plugin > DMS plugin.

      2. In the dialog box that appears, select the DMS Agent Policy checkbox.

      3. Click Install.

      4. After the plugin is installed, click Close.

    • Install Qwen

      1. Choose Install plugin > Marketplace.

      2. Hover over the Qwen card and click Install.

      3. In the dialog box that appears, click Install.

      4. Click Install.

Step 2: Import the Deep Research Quick Start template

  1. On the Studio > All page, click Create from Template.

  2. In the left-side navigation pane, click DMS Data+AI.

  3. Hover over the Deep Research Quick Start card and click Use this template.

  4. 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

Note

DMS preconfigures most settings for you. You only need to complete the final configuration step for an out-of-the-box experience.

  1. Click the DEEP RESEARCH AGENT node.

  2. In the Deep Research Agent panel on the right, enter your Quark Search API key.

    Note

    To learn how to obtain an API key, see Create and view credentials.

  3. Optional: Adjust the research strategy and the large language model (LLM) used in different stages.

    Note

    We 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

  1. In the upper-right corner of the page, click Preview.

  2. In the Chat with Bot text box, enter your query.

  3. To the right of the Chat with Bot text box, click image Run.

Step 5: Publish and access API

  1. In the upper-right corner of the page, click Publish.

  2. In the dialog box that appears, click Publish Update.

  3. After the Operation successful message appears in the upper-right corner, click Access API.

  4. 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.

Note

DMS provides corresponding templates for each submodule for your reference.

  1. Create a workflow.

    1. At the top of the page, click Studio to return to the Studio main page.

    2. Click Create from App Template.

    3. In the left-side navigation pane, click DMS Data+AI.

    4. 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.

    5. In the dialog box that appears, click Create.

    6. Optional: Follow the prompts to install any required plugins.

  2. Configure and publish the workflow.

    1. Configure the workflow based on your requirements.

    2. In the upper-right corner of the page, click Publish.

    3. In the dialog box that appears, click Publish Update.

  3. Publish the workflow as a tool.

    1. Click Publish as Tool.

    2. Configure the tool based on your requirements.

      Note

      Set the tool call name for the Search Agent to search_agent_example, the tool call name for the Summary Agent to summary_agent_example, and the tool call name for the Report Writing Agent to report_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.

    3. Click Save.

  4. In the DEEP RESEARCH AGENT node, configure and enable the corresponding Dify workflow.

    1. Return to the Deep Research Quick Start application.

    2. Click the DEEP RESEARCH AGENT node.

    3. Click the image icon next to the corresponding parameter (SEARCH AGENT, SUMMARY AGENT, or REPORT WRITING AGENT).

    4. In the dialog box that appears, click the Workflow tab.

    5. Select the corresponding workflow.

    6. 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.

Note

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.

Note

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.