Recursive reasoning RAG open source project based on DeepSeek-R1

Written by
Iris Vance
Updated on:July-12th-2025
Recommendation

Explore the cutting-edge applications of the combination of DeepSeek-R1 reasoning model and RAG technology, and open a new chapter in complex information retrieval.

Core content:
1. The combination of DeepSeek-R1 reasoning technology and RAG workflow
2. The architecture and workflow analysis of the recursive reasoning RAG system
3. Technical advantages and actual case analysis to demonstrate the ability to handle complex problems

Yang Fangxian
Founder of 53AI/Most Valuable Expert of Tencent Cloud (TVP)

DeepSeek has open-sourced its powerful inference model R1, which has brought new vitality to the application and model development field. Based on this, a recursive RAG workflow system that combines DeepSeek-R1 inference with Tavily search has emerged, which can handle complex nested queries through intelligent information retrieval and reasoning.

Core Architecture

1. Agent layer: This is an autonomous decision-making "brain" built based on DeepSeek-R1 reasoning technology. It is responsible for coordinating the entire retrieval and reasoning process and controlling the overall direction.

2. Recursive RAG Engine

Retrieval module: Like a diligent "information collector", it quickly extracts relevant information from the knowledge base.
Reasoning module: Acts as a “smart analyst” to analyze the retrieved information and determine whether the information is sufficient to answer the question.
· Judgment module: It is like a "strict screening officer" that decides which information needs to be retained, which should be discarded, and whether further retrieval is required.
3. Knowledge base interface: As a standardized channel to connect to external knowledge sources, it ensures that the system can obtain rich and diverse knowledge.
4. Comprehensive answer generator: carefully integrates the information obtained from multiple rounds of retrieval and outputs a complete and coherent final answer.
Workflow
1. The system receives complex questions such as "Is RBC headquarters north of Sam Altman Brothers' headquarters?"
2. Initially search for relevant information and use tools such as Tavily to find clues on the Internet or in knowledge bases.
3. Conduct inferential analysis on the retrieved information to evaluate whether the existing information can answer the question.
4. Determine whether the information is sufficient , and if so, generate an answer; if not, identify the missing details and re-query to obtain more data.
5. If more information is needed, return to the search step and perform a recursive search , discarding irrelevant data along the way and retaining relevant information.
6. When sufficient information is available, synthesize it to generate a final answer .
Technical advantages

Traditional RAG systems often face challenges such as difficulty in information screening and inability to effectively integrate multi-source information when dealing with complex problems. The recursive reasoning RAG system based on DeepSeek-R1 has achieved a leap in performance with its powerful reasoning capabilities. It can dynamically screen information , reduce reliance on cumbersome techniques such as "long context reordering", and effectively handle long nested and complex queries through a recursive retrieval mechanism .

Actual Cases

Take the query "Is RBC headquarters located north of Sam Altman Brothers' headquarters?" as an example. The system first retrieved that RBC's headquarters is in Toronto, but the location information of Sam Altman Brothers' headquarters was missing, so it searched recursively. After searching again, it obtained some location information of related companies, but there was an unclear relationship between the company and the brothers, so it continued to search. Finally, it confirmed that the information was complete and got the answer. Through this case, the system's ability to handle complex problems is fully demonstrated.

Summarize

The recursive reasoning RAG technology based on DeepSeek-R1 has brought new hope to the field of intelligent question answering. In the future, we believe that this RAG workflow that combines reasoning models with agent loops will gradually replace traditional RAG methods and become the mainstream technology for processing complex information retrieval.