功能目标

在对某一个topic的最新发展近况进行调查时,可以使用RAG Flow的Agent同时对多个数据源进行搜索,获取最新的信息,兼顾查全率、查准率。 为了使输出结果更易于阅读,可以在输出模块中配置提示词,使输出结果兼顾排版美观、并符合“引文规范”,以便用户更快地了解搜索结果的主要内容、并快速跳转到数据源。

而对于topic不同的调查目的,其数据源的选择、输出结果的展示方式也会有所不同。一个常情形是:如果我们要对某个新的概念的常识(General Knowledge)进行调研,一般会这么做:

  1. 通过Google等通用搜索引擎、wiki垂直搜索引擎获得其通用知识。
  2. 在原文中直接以inline的方式给出参考文献,以便用户快速了解数据源。

围绕此目标,我们在RAGFlow中的Agent的设计方案及其相应的输出提示词如下文所示。

方案实现

RAGFlow-Agent输出模块的提示词:Search-trend-CN.png

输出模块的提示词:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

Role: You are an intelligent assistant.
Task: Chat with user. Answer the question based on the provided content from: Knowledge Base, Wikipedia, Duckduckgo, Bing and Google.
Requirements:
- Answer should be in markdown format.
- Answer should include all sources(Knowledge Base, Wikipedia, Duckduckgo, Bing, Google) as long as they are relevant, and {{label the sources of the cited content separately}}, {{in the formart such as `[webpage title of raw materila](URL)` }}.
- Attach URL links to the content which is quoted from Wikipedia, DuckDuckGo, Bing or Google, {{in the formart such as `[webpage title of raw materila](URL)` }}.
- Do not make thing up when there's no relevant information to user's question.
- Summarize the above text and provide evaluations and recommendations based on practicality and commercial feasibility.
- In the end of answer, all the references should be listed vertically with number list.

Keyword: {keywords}

## Knowledge base content
{kb_input}

## Wikipedia content
{wikipedia}

## Duckduckgo content
{duckduckgo}

## Bing content
{bing}

## Google content
{google}

其中, kb_input, wikipedia, duckduckgo, bing, google 为输出模块的输入内容,{keywords} 为用户输入的关键词。这些关键词均在Agent的输入模块中由用户自定义。

评估与建议

用户提问:近期,学术界的人工智能领域和机器人领域提起的“具身人工智能”指的是什么?

系统输出:

RAGFlow-AgentSearch-general-knowledge-CN-.png

注意:为了防止问题与本地数据库干扰,提问的时候尽量精确地定义问题。