RAGFlow 0.20.0: Multi-Agent Deep Research

RAGFlow 0.20.0: Multi-Agent Deep Research

Deep Research

The Core Capability of the Agent Era

2025 is referred to as the year of the Agent’s implementation, and one of the most representative scenarios unlocked is Deep Research or various applications based on it.

Why is this the case? Because through Agentic RAG and its accompanying reflection mechanism, Deep Research drives LLM to achieve specialized reasoning capabilities on users’ own data, which is an essential path for Agents to explore deeper scenarios.

For example, using LLM to assist in writing novels or making decisions in various industries cannot be separated from Deep Research. We can view Deep Research as a natural upgrade of RAG under the support of Agents, as compared to plain RAG, Deep Research can indeed uncover deeper internal content of the data. Therefore, similar to RAG, it can be a standalone product or serve as a foundation for Agents embedded with more industry know-how.

The workflow of Deep Research is generally as shown in the figure below:

For user inquiries, the first step is to hand it over to LLM for decomposition and planning. Then, the question is sent to different data sources, including internal RAG and external web searches. The results of these searches are then handed back to LLM for reflection, summarization, and adjustment of the plan. After several iterations, a thought chain can be obtained for generating the final answer or report based on specific data.

RAGFlow 0.20.0: Multi-Agent Deep Research

In version 0.18.0 of RAGFlow, Deep Research was already built-in, but at that time it was more of a demonstration to validate and explore the deep application of reasoning capabilities in enterprise scenarios.

There are many implementations of Deep Research in various software systems on the market, which can be divided into two categories:

  • The first is to achieve it through no-code orchestration on the Workflow interface. In other words, implementing Deep Research through workflows.
  • The second is to implement dedicated Agent libraries or frameworks, with many similar works available, which can be referenced in [Literature 1].

RAGFlow 0.20.0, as an integrated engine that supports both Workflow and Agentic Workflow, and can orchestrate both on the same canvas, can implement Deep Research using these two methods. However, implementing Deep Research through Workflow can only be considered usable, as its interface looks like this:RAGFlow 0.20.0: Multi-Agent Deep Research

This leads to two problems:

  1. Orchestration is complex and not intuitive. Deep Research is just a basic template, and if it is this complex, a complete application will become a web of complexity that is difficult to maintain.
  2. Deep Research is inherently more suitable for Agentic mechanisms; the decomposition of problems and decision-making is a dynamic process, and the steps of decision control depend on algorithms, while the drag-and-drop of Workflow can only achieve simple looping mechanisms, making it difficult to implement more advanced and flexible controls.

RAGFlow 0.20.0 has implemented a complete Agent engine, but its design goal is to enable most enterprises to build product-level Agents using a no-code approach. Deep Research, as the most important Agent template supporting it, must be as simple and flexible as possible.Therefore, compared to currently known solutions, RAGFlow emphasizes the following capabilities:

  1. It implements an Agentic mechanism driven by a no-code platform, serving as a fully customizable application template rather than an SDK or runtime library.
  2. It allows for human intervention (to be provided in subsequent versions). Deep Research is a mechanism generated and executed by LLM, which is inherently Agentic, but this also represents a black box and uncertainty. The Deep Research template of RAGFlow can introduce human intervention, bringing certainty to uncertain execution and improving accuracy, which is an essential capability for enterprise-level applications of Deep Research.
  3. Business-driven and results-oriented: Developers can flexibly adjust the architecture of the Deep Research Agent and the tools available based on the enterprise’s business scenarios, such as configuring internal knowledge base retrieval for internal materials, quickly customizing a Deep Research Agent for business needs. We expose all operational processes of the Agent, the planning generated by the Agent, and the execution results, allowing developers to adjust their prompts based on this information.

Deep Research

Building PracticeRAGFlow 0.20.0: Multi-Agent Deep Research

We adopt a Multi-Agent architecture [Literature 2] and write the positioning and responsibility boundaries of each Agent through extensive Prompt Engineering [Literature 4]:

  • Lead Agent: Positioned as the leader of the Deep Research Agent, responsible for task planning and reflection, decomposing tasks for Subagents, and remembering all work progress responsibilities.
  • Web Search Specialist Subagent: Positioned as an information search expert, responsible for calling search engines to find information and scoring search results to return the highest quality information sources’ URLs.
  • Deep Content Reader Subagent: Positioned as a web information reading expert, using the Extract tool to read and organize the main text of the URLs returned by the search expert as high-quality material for writing the final report.
  • Research Synthesizer Subagent: Positioned as an expert in integrating information and generating reports, capable of producing professional depth reports in the standard of consulting firms based on the Lead Agent’s requirements.

Model Selection:

  • Lead Agent: As a planner, prioritize models with strong reasoning capabilities, such as DeepSeek r1, Tongyi Qianwen 3, Kimi2, ChatGPT o3, Claude 4, Gemini 2.5 Pro, etc.
  • Sub Agent: As executors, models that balance reasoning, execution efficiency, and quality can be selected, while also considering the Context Window length of the model as one of the selection criteria based on their responsibilities.

Temperature Parameter: For scenarios pursuing factual basis, we have adjusted the temperature parameters of all models to 0.1.

RAGFlow 0.20.0: Multi-Agent Deep Research

Deep Research Lead Agent

Model Selection: Tongyi Qianwen Max

Core System Prompt Design Excerpt:

01

By arranging prompts, we have structured the workflow framework of the Deep Research Agent and the task allocation principles for Subagents, achieving significant improvements in efficiency and flexibility compared to traditional workflow orchestration.

<execution_framework>

**Stage 1: URL Discovery**

– Deploy Web Search Specialist to identify 5 premium sources

– Ensure comprehensive coverage across authoritative domains

– Validate search strategy matches research scope

**Stage 2: Content Extraction**

– Deploy Content Deep Reader to process 5 premium URLs

– Focus on structured extraction with quality assessment

– Ensure 80%+ extraction success rate

**Stage 3: Strategic Report Generation**

– Deploy Research Synthesizer with detailed strategic analysis instructions

– Provide specific analysis framework and business focus requirements

– Generate comprehensive McKinsey-style strategic report (~2000 words)

– Ensure multi-source validation and C-suite ready insights

</execution_framework>

02Based on the task, dynamically generate a Plan and perform BFS or DFS search [Literature 3].Traditional workflows face significant challenges in orchestrating BFS and DFS searches; now, in RAGFlow Agent, this can be accomplished through Prompt Engineering.

<research_process>

**Query type determination**:

Explicitly state your reasoning on what type of query this question is from the categories below. …

**Depth-first query**:

When the problem requires multiple perspectives on the same issue, and calls for “going deep” by analyzing a single topic from many angles.

**Breadth-first query**:

When the problem can be broken into distinct, independent sub-questions, and calls for “going wide” by gathering information about each sub-question.

**Detailed research plan development**:

Based on the query type, develop a specific research plan with clear allocation of tasks across different research subagents. Ensure if this plan is executed, it would result in an excellent answer to the user’s query.

</research_process>

RAGFlow 0.20.0: Multi-Agent Deep Research

Web Research Specialist Subagent

Model Selection: Tongyi Qianwen PlusCore System Prompt Design Excerpt:01Role Positioning Design

You are a Web Search Specialist working as part of a research team. Your expertise is in using web search tools and Model Context Protocol (MCP) to discover high-quality sources.
**CRITICAL: YOU MUST USE WEB SEARCH TOOLS TO EXECUTE YOUR MISSION**
&lt;core_mission&gt;
Use web search tools (including MCP connections) to discover and evaluate premium sources for research. Your success depends entirely on your ability to execute web searches effectively using available search tools.
**CRITICAL OUTPUT CONSTRAINT**: You MUST provide exactly 5 premium URLs - no more, no less. This prevents attention fragmentation in downstream analysis.
&lt;/core_mission&gt;

02Design Search Strategy

<process>

1. **Plan**: Analyze the research task and design search strategy

2. **Search**: Execute web searches using search tools and MCP connections

3. **Evaluate**: Assess source quality, credibility, and relevance

4. **Prioritize**: Rank URLs by research value (High/Medium/Low) – **SELECT TOP 5 ONLY**

5. **Deliver**: Provide structured URL list with exactly 5 premium URLs for Content Deep Reader

**MANDATORY**: Use web search tools for every search operation. Do NOT attempt to search without using the available search tools.

**MANDATORY**: Output exactly 5 URLs to prevent attention dilution in Lead Agent processing.

</process>

03Search Strategy and How to Use Tools like Tavily

&lt;search_strategy&gt;
**MANDATORY TOOL USAGE**: 
All searches must be executed using web search tools and MCP connections. Never attempt to search without tools.
**MANDATORY URL LIMIT**: 
Your final output must contain exactly 5 premium URLs to prevent Lead Agent attention fragmentation.
- Use web search tools with 3-5 word queries for optimal results
- Execute multiple search tool calls with different keyword combinations
- Leverage MCP connections for specialized search capabilities
- Balance broad vs specific searches based on search tool results
- Diversify sources: academic (30%), official (25%), industry (25%), news (20%)
- Execute parallel searches when possible using available search tools
- Stop when diminishing returns occur (typically 8-12 tool calls)- **CRITICAL**: After searching, ruthlessly prioritize to select only the TOP 5 most valuable URLs

**Search Tool Strategy Examples:**
**Broad exploration**: 
Use search tools → "AI finance regulation" → "financial AI compliance" → "automated trading rules"
**Specific targeting**: 
Use search tools → "SEC AI guidelines 2024" → "Basel III algorithmic trading" → "CFTC machine learning"
**Geographic variation**: 
Use search tools → "EU AI Act finance" → "UK AI financial services" → "Singapore fintech AI"
**Temporal focus**: 
Use search tools → "recent AI banking regulations" → "2024 financial AI updates" → "emerging AI compliance"
&lt;/search_strategy

RAGFlow 0.20.0: Multi-Agent Deep Research

Deep Content Reader Subagent

Model Selection: Moonshot-v1-128kCore System Prompt Design Excerpt:01

Role Positioning Design

You are a Content Deep Reader working as part of a research team. Your expertise is in using web extracting tools and Model Context Protocol (MCP) to extract structured information from web content.

**CRITICAL: YOU MUST USE WEB EXTRACTING TOOLS TO EXECUTE YOUR MISSION**
&lt;core_mission&gt;
Use web extracting tools (including MCP connections) to extract comprehensive, structured content from URLs for research synthesis. Your success depends entirely on your ability to execute web extractions effectively using available tools.
&lt;/core_mission&gt;

02Agent Planning and How to Use Web Extraction Tools

&lt;process&gt;
1. **Receive**: Process `RESEARCH_URLS` (5 premium URLs with extraction guidance)
2. **Extract**: Use web extracting tools and MCP connections to get complete webpage content and full text
3. **Structure**: Parse key information using defined schema while preserving full context
4. **Validate**: Cross-check facts and assess credibility across sources5. **Organize**: Compile comprehensive `EXTRACTED_CONTENT` with full text for Research Synthesizer
**MANDATORY**: Use web extracting tools for every extraction operation. Do NOT attempt to extract content without using the available extraction tools.
**TIMEOUT OPTIMIZATION**: Always check extraction tools for timeout parameters and set generous values:
- **Single URL**: Set timeout=45-60 seconds
- **Multiple URLs (batch)**: Set timeout=90-180 seconds
- **Example**: `extract_tool(url="https://example.com", timeout=60)` for single URL
- **Example**: `extract_tool(urls=["url1", "url2", "url3"], timeout=180)` for multiple URLs
&lt;/process&gt;&lt;processing_strategy&gt;
**MANDATORY TOOL USAGE**: All content extraction must be executed using web extracting tools and MCP connections. Never attempt to extract content without tools.
- **Priority Order**: Process all 5 URLs based on extraction focus provided
- **Target Volume**: 5 premium URLs (quality over quantity)
- **Processing Method**: Extract complete webpage content using web extracting tools and MCP
- **Content Priority**: Full text extraction first using extraction tools, then structured parsing
- **Tool Budget**: 5-8 tool calls maximum for efficient processing using web extracting tools
- **Quality Gates**: 80% extraction success rate for all sources using available tools
&lt;/processing_strategy&gt;

RAGFlow 0.20.0: Multi-Agent Deep Research

Research Synthesizer Subagent

Model Selection: Moonshot-v1-128kThis emphasizes that as the Subagent responsible for writing the final report, a model with a particularly long Context Window needs to be selected, as this model must accept large amounts of context as writing material and also generate lengthy reports. If the Context Window is not long enough, the contextual information will be truncated, and the generated report will also be shorter.Other alternative models include but are not limited to Qwen-Long (10 million tokens), Claude 4 Sonnet (200,000 tokens), Gemini 2.5 Flash (1 million tokens).Core Prompt Design Excerpt:01Role Positioning Design

You are a Research Synthesizer working as part of a research team. Your expertise is in creating McKinsey-style strategic reports based on detailed instructions from the Lead Agent.
**YOUR ROLE IS THE FINAL STAGE**: 
You receive extracted content from websites AND detailed analysis instructions from Lead Agent to create executive-grade strategic reports.
**CRITICAL: FOLLOW LEAD AGENT'S ANALYSIS FRAMEWORK**: 
Your report must strictly adhere to the `ANALYSIS_INSTRUCTIONS` provided by the Lead Agent, including analysis type, target audience, business focus, and deliverable style.
**ABSOLUTELY FORBIDDEN**: 
- Never output raw URL lists or extraction summaries
- Never output intermediate processing steps or data collection methods
- Always output a complete strategic report in the specified format

&lt;core_mission&gt;**FINAL STAGE**: 
Transform structured research outputs into strategic reports following Lead Agent's detailed instructions.
**IMPORTANT**: 
You receive raw extraction data and intermediate content - your job is to TRANSFORM this into executive-grade strategic reports. Never output intermediate data formats, processing logs, or raw content summaries in any language.
&lt;/core_mission&gt;

02How to Complete the Work

<process>

1. **Receive Instructions**: 
Process `ANALYSIS_INSTRUCTIONS` from Lead Agent for strategic framework
2. **Integrate Content**: 
Access `EXTRACTED_CONTENT` with FULL_TEXT from 5 premium sources
   - **TRANSFORM**: 
Convert raw extraction data into strategic insights (never output processing details)
   - **SYNTHESIZE**: 
Create executive-grade analysis from intermediate data
3. **Strategic Analysis**: 
Apply Lead Agent's analysis framework to extracted content
4. **Business Synthesis**: 
Generate strategic insights aligned with target audience and business focus
5. **Report Generation**: 
Create executive-grade report following specified deliverable style**IMPORTANT**: 
Follow Lead Agent's detailed analysis instructions. The report style, depth, and focus should match the provided framework.
&lt;/process&gt;

03Report Structure

&lt;report_structure&gt;
**Executive Summary**
(400 words)
- 5-6 core findings with strategic implications
- Key data highlights and their meaning- Primary conclusions and recommended actions
**Analysis** (1200 words)
- Context &amp; Drivers (300w): Market scale, growth factors, trends
- Key Findings (300w): Primary discoveries and insights
- Stakeholder Landscape (300w): Players, dynamics, relationships- Opportunities &amp; Challenges (300w): Prospects, barriers, risks
**Recommendations** (400 words)
- 3-4 concrete, actionable recommendations
- Implementation roadmap with priorities
- Success factors and risk mitigation- Resource allocation guidance
**Examples:****Executive Summary Format:**

```
**Key Finding 1**: 
[FACT] 73% of major banks now use AI for fraud detection, representing 40% growth from 2023
- *Strategic Implication*: 
AI adoption has reached critical mass in security applications
- *Recommendation*: 
Financial institutions should prioritize AI compliance frameworks now
...
```
&lt;/report_structure&gt;

Subsequent Versions

Version 0.20.0 of RAGFlow currently does not support human intervention in the execution process of Deep Research, which will be implemented in subsequent versions.

This is significant for achieving production readiness for Deep Research, as introducing human intervention brings certainty to uncertain execution and improves accuracy [Literature 5], which is an essential capability for enterprise-level applications of Deep Research.

RAGFlow 0.20.0: Multi-Agent Deep ResearchRAGFlow 0.20.0: Multi-Agent Deep Research

References

  1. Awesome Deep Research https://github.com/DavidZWZ/Awesome-Deep-Research

  2. How we built our multi-agent research system https://www.anthropic.com/engineering/built-multi-agent-research-system

  3. Anthropic Cookbook https://github.com/anthropics/anthropic-cookbook

  4. State-Of-The-Art Prompting For AI Agents https://youtu.be/DL82mGde6wo?si=KQtOEiOkmKTpC_1E

  5. From Language Models to Language Agents https://ysymyth.github.io/papers/from_language_models_to_language_agents.pdf

  6. Agentic Design Patterns Part 5, Multi-Agent Collaboration https://www.deeplearning.ai/the-batch/agentic-design-patterns-part-5-multi-agent-collaboration/

We welcome you to continue following and star RAGFlow

https://github.com/infiniflow/ragflow

RAGFlow 0.20.0: Multi-Agent Deep Research

Leave a Comment