Skip to content

Commit 5efb8ee

Browse files
Merge pull request #132 from gomate-community/pipeline
feature@support deepresearch-cli
2 parents ca2d71b + eded4c9 commit 5efb8ee

File tree

3 files changed

+99
-0
lines changed

3 files changed

+99
-0
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,53 @@ The core design of TrustRAG lies in its **high configurability and modularity**,
2121

2222
![framework.png](resources%2Fframework.png)
2323

24+
## DeepResearch Features
25+
26+
The DeepResearch framework achieves deep information search and processing through layered queries, recursive iteration, and intelligent decision-making. This process includes the following key steps:
27+
28+
1. Intent Understanding
29+
After the user inputs a query, the system parses it into multiple sub-queries to more precisely understand the user's needs.
30+
31+
2. Processing Condition Judgment
32+
The system determines whether to continue execution based on the following conditions:
33+
1. **Whether the token budget is exceeded**
34+
2. **Whether the action depth is exceeded**
35+
> If these conditions are met, the query is terminated and the answer is returned directly; otherwise, it enters the recursive execution step.
36+
37+
3. Recursive Execution Steps
38+
During recursive execution, the system performs information retrieval, model reasoning, and context processing tasks
39+
**Information Retrieval**
40+
- **Get current question**
41+
- **Build question execution sequence**
42+
- **Recursive traversal**
43+
- **Depth-first search**
44+
- **Model reasoning**
45+
> The system performs model reasoning, judging the next action through system prompts and context understanding.
46+
47+
4. Action Type Determination
48+
Based on the reasoning results, the system decides the next type of action to execute:
49+
- **answer**: Answer action
50+
- **reflect**: Reflection action
51+
- **search**: Search action
52+
- **read**: Reading action
53+
- **coding**: Code action
54+
55+
> These actions affect the context and continuously update the system state.
56+
57+
5. Result Feedback
58+
Based on the final action type, the system performs the corresponding task and returns the results to the user, completing the entire process.
59+
60+
DeepResearch process diagram:
61+
62+
![DeepSearch.png](resources/DeepSearch.png)
63+
64+
Run the CLI tool:
65+
```bash
66+
cd trustrag/modules/deepsearch
67+
cp .env.example .env #Configure LLM API and search
68+
python pipeline.py
69+
```
70+
2471
## ✨Key Features
2572

2673
**“Reliable input, Trusted output”**

README_zh.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ DeepResearch流程示意图如下:
6262

6363
![DeepSearch.png](resources/DeepSearch.png)
6464

65+
运行cli工具:
66+
```bash
67+
cd trustrag/modules/deepsearch
68+
cp .env.example .env #配置LLM API以及搜索
69+
python pipeline.py
70+
```
71+
6572
## ✨主要特色
6673

6774
**“Reliable input,Trusted output”**

docs/deep-research.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## DeepResearch功能
2+
3+
DeepResearch 框架通过分层查询、递归迭代以及智能决策等步骤,实现深度信息搜索和处理。本流程主要包含以下关键步骤:
4+
5+
1. 意图理解(Intent Understanding)
6+
用户输入查询后,系统会将其解析为多个子查询,以便更精确地理解用户需求。
7+
8+
2. 处理条件判断
9+
系统会根据如下条件判断是否继续执行:
10+
1. **Token 预算是否超出**
11+
2. **动作深度是否超出**
12+
>如果满足上述条件,则终止查询并直接返回答案;否则进入递归执行步骤。
13+
14+
3. 递归执行步骤
15+
在递归执行过程中,系统执行信息检索、模型推理及上下文处理等任务
16+
**信息检索**
17+
- **获取当前问题**
18+
- **构建问题执行序列**
19+
- **递归遍历**
20+
- **深度优先搜索**
21+
-**模型推理**
22+
>系统进行模型推理,通过系统提示和上下文理解来判断下一步动作。
23+
4. 动作类型判定
24+
根据推理结果,系统决定下一步执行的动作类型:
25+
- **answer**:回答动作
26+
- **reflect**:反思动作
27+
- **search**:搜索动作
28+
- **read**:阅读动作
29+
- **coding**:代码动作
30+
31+
>这些动作会影响上下文,并不断更新系统状态。
32+
33+
5. 结果反馈
34+
根据最终的动作类型,系统执行相应的任务,并将结果返回给用户,完成整个流程。
35+
36+
DeepResearch流程示意图如下:
37+
38+
![DeepSearch.png](resources/DeepSearch.png)
39+
40+
运行cli工具:
41+
```bash
42+
cd trustrag/modules/deepsearch
43+
cp .env.example .env #配置LLM API以及搜索
44+
python pipeline.py
45+
```

0 commit comments

Comments
 (0)