How to Build a Deep Research Workflow in Dify Using AI Agents

This guide explains how to construct a deep research workflow in Dify that leverages AI agents, loop variables, and structured outputs to automatically explore complex topics, gather sources, and synthesize comprehensive reports with proper citations.

JavaEdge
JavaEdge
JavaEdge
How to Build a Deep Research Workflow in Dify Using AI Agents

Business Pain Points

Standard search queries often fail for complex problems such as academic papers, market analysis, or code debugging, requiring dozens of separate searches. This is where deep research becomes valuable.

Deep research uses an intelligent feedback loop to identify knowledge gaps, lock onto specific questions, explore systematically, and produce comprehensive reports, unlike fragmented searches.

Workflow Overview

The Dify deep research workflow consists of three stages: Intent Identification, Iterative Exploration, and Synthesis.

Intent Identification : Capture the research topic, collect background, and define clear direction.

Iterative Exploration : Use loop variables to evaluate knowledge, run targeted searches, and build findings.

Synthesis : Compile all information into a structured report with proper citations.

Stage 1: Research Foundations

Start Node

Configure the Start node with basic input parameters:

Research Topic : Core question to explore.

Maximum Loop : Iteration budget for the session.

Background Knowledge Acquisition

Use the Exa Answer tool to gather initial information and ensure the model understands terminology.

img
img

Intent Analysis

Employ an LLM node to extract the user's true intent, distinguishing surface issues from deeper information needs.

img
img

Stage 2: Dynamic Research Cycle

Loop Node: Research Engine

The loop node drives the entire research, passing information across iterations.

Dify tracks six key variables:

findings : New knowledge discovered each cycle.

executed_querys : Previously used search queries to avoid redundancy.

current_loop : Iteration counter.

visited_urls : Properly cited source URLs.

image_urls : Visual content references.

knowledge_gaps : Identified information needs.

img
img

Reasoning Node: Better Questions

The reasoning node outputs structured JSON with fields reasoning, search_query, and knowledge_gaps.

{
    "reasoning": "Detailed justification for the chosen action path...",
    "search_query": "Specific follow-up question targeting knowledge gaps",
    "knowledge_gaps": "Information still needed to answer the original question"
}
img
img
img
img
img
img

Agent Node: Conduct Research

Agent nodes act as autonomous researchers, selecting appropriate tools such as exa_search for web search and exa_content for retrieving full content.

They also use the think tool (inspired by Claude's Think Tool) to reflect on findings and plan next steps.

img
img

URL Extraction

The workflow automatically extracts URLs and visual references from agent responses for proper source tracking.

img
img

Variable Assignment

After each cycle, a variable assigner node updates the research state, ensuring each iteration builds on previous work.

img
img

Stage 3: Research Synthesis

When all exploration cycles finish, the Summary node aggregates accumulated variables to generate a comprehensive report with correct Markdown citations and a bibliography.

img
img

Conclusion

This guide demonstrates how Dify can digitize expert research methods and accelerate them through automation.

Future research should focus on smarter data exploration rather than merely more data.

References

https://github.com/dzhng/deep-research

https://github.com/jina-ai/node-DeepResearch

https://github.com/langchain-ai/local-deep-researcher

https://github.com/nickscamara/open-deep-research

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AutomationLLMAgentDifyAI workflowDeep Research
JavaEdge
Written by

JavaEdge

First‑line development experience at multiple leading tech firms; now a software architect at a Shanghai state‑owned enterprise and founder of Programming Yanxuan. Nearly 300k followers online; expertise in distributed system design, AIGC application development, and quantitative finance investing.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.