私有知识库 Coco AI 实战(四):打造 ES 索引参数小助手

经过前面的实战,我们已经能够快速、准确的检索 ES 官方文档的内容了,但是还是要自己去阅读。既然 Coco AI 能与大模型交互,我们何不直接用大模型来阅读文档,回答我们的问题?

模型配置

我们进入 Coco AI 管理后台,选择模型提供商菜单。这里我配置通义千问的模型。

🤔 如果没有这个菜单的小伙伴,请下载最新版本的 Coco Server

填入对应的 URL 和 API 密钥,保存。

确保最下面的启用状态是打开的,这样我们的模型就配置完了。

小助手配置

进入 AI 助手菜单,选择新增。

填写字段内容,类型选择深度思考,模型设置参考图片选择。

对于每个模型,我们可以配置单独的提示词及随机性等参数。点击应答模型后面的菜单图标会出现具体的设置界面。

提示词设置我们给设置一个根据上下文回答问题的提示词。

复制代码
您将获得一段对话和一个后续问题。

如有必要,请将后续问题重新表述为一个独立的问题,以便LLM能够在知识库中进行信息检索。

⸻

上下文:

{{.context}}

用户查询:

{{.query}} 

⸻

请根据上述信息生成您的回答,优先考虑LLM工具的输出(如有)。

确保您的回答具有深思熟虑、准确性和良好的结构。

如果提供的信息不足,请告知用户需要更多详细信息,或提供友好、对话式的回应。

对于复杂的答案,请使用清晰且组织良好的Markdown格式,以提高可读性。

对意图识别模型设置提示词。

复制代码
You are an AI assistant trained to understand and analyze user queries.
You will be given a conversation below and a follow-up question. You need to rephrase the follow-up question if needed so it is a standalone question that can be used by the LLM to search the knowledge base for information.

Conversation:
{{.history}}

Tool List:
{{.tool_list}}

Network sources List:
{{.network_sources}}

The user has provided the following query:
{{.query}}

You need help to figure out the following tasks:
- Please analyze the query and identify the user's primary intent. Determine if they are looking for information, making a request, or seeking clarification. brief as field: 'intent',
- Categorize the intent in </Category>,  and rephrase the query in several different forms to improve clarity.
- Provide possible variations of the query in <Query/> and identify relevant keywords in </Keyword> in JSON array format.
- Provide possible related queries in <Suggestion/> and expand the related query for query suggestion.
- Based on the tool list provided, analyze the user's query whether need to call external tools, output as field: 'need_call_tools'
- Analyze the user's query whether need to plan some complex sub-tasks in order to achieve the goal, output as field: 'need_plan_tasks'


Please make sure the output is concise, well-organized, and easy to process.
Please present these possible query and keyword items in both English and Chinese.

If the possible query is in English, keep the original English one, and translate it to Chinese and keep it as a new query, to be clear, you should output: [Apple, 苹果], neither just 'Apple' nor just '苹果'.
Wrap the valid JSON result in <JSON></JSON> tags.

Your output should look like this format:
<JSON>
{
  "category": "<Intent's Category>",
  "intent": "<User's Intent>",
  "query": [
    "<Rephrased Query 1>",
    "<Rephrased Query 2>",
    "<Rephrased Query 3>"
  ],
  "keyword": [
    "<Keyword 1>",
    "<Keyword 2>",
    "<Keyword 3>"
  ],
  "suggestion": [
    "<Suggest Query 1>",
    "<Suggest Query 2>",
    "<Suggest Query 3>"
  ],
  "need_plan_tasks":<true or false>,
  "need_call_tools":<true or false>
}
</JSON>

数据源我们选择 ES 文档的数据源,数据过滤我们可以增加一个过滤,只选取内容是索引设置相关的文档。

其他的 MCP 服务器和大模型工具暂时用不到,先关闭。

角色提示词,写一个。至此 ES 索引参数查询助手就配置好了。

最后,如果你有多个小助手,可以设置快捷访问。在设置-应用设置中,添加要展示的 AI 小助手,这样 Coco App 进入到 AI 模式时,可以快速选择需要的小助手。当然不设置,也是可以切换的。

Coco App 安装

本地电脑安装一个 Coco App,用来登录本地的 Coco Server。Coco App 支持一键呼出,功能都有快捷键,直接全键盘操作效率拉满。

安装好后启动,点击 Coco App 图标-偏好设置。

点击左侧 + 号,填入本地 Coco Server 地址,该信息可以去 Coco Server 管理平台查看。

点击登录,弹窗中点击打开 Coco app,我们就登录成功了。

实战搜索

快速验证下 Coco App 搜索功能,使用快捷键 shift+command+space 呼出 Coco App,输入信息看看能否有检索结果。

展示结果后,按下 command 键会显示快捷按键,一键打开资源。

实战 AI 聊天

在 Coco App 界面下,按 Command + T 切换到 AI 聊天模式,可以看到我们之前设置的快捷入口。如果没设置,可以在左上角切换 AI 小助手。

我们点击"ES 索引参数查询助手"后可以询问索引参数相关的问题。我们先直接用自然语言询问参数信息。

可以看到 AI 先检索到具体的官方文档《 Index Modules 》进行深入阅读后才回答我们的提问,结果也是非常正确。除此之外,我们还可以通过参数名询问参数作用。

以后有索引参数方面的问题,就直接找 ES 索引参数查询助手了。

Coco AI 官网: Coco AI - Search, Connect, Collaborate

相关推荐
可观测性用观测云2 分钟前
观测云 MCP Server 接入和使用最佳实践
人工智能
掘金一周8 分钟前
大部分人都错了!这才是chrome插件多脚本通信的正确姿势 | 掘金一周 11.27
前端·人工智能·后端
xier_ran29 分钟前
深度学习:生成对抗网络(GAN)详解
人工智能·深度学习·机器学习·gan
ModestCoder_37 分钟前
ROS Bag与导航数据集技术指南
开发语言·人工智能·自然语言处理·机器人·具身智能
byte轻骑兵1 小时前
时序数据库选型指南:从大数据视角看IoTDB的核心优势
大数据·时序数据库·iotdb
海边夕阳20061 小时前
【每天一个AI小知识】:什么是循环神经网络?
人工智能·经验分享·rnn·深度学习·神经网络·机器学习
2501_918126911 小时前
如何用ai做开发
人工智能
f***a3461 小时前
开源模型应用落地-工具使用篇-Spring AI-高阶用法(九)
人工智能·spring·开源
用户5191495848451 小时前
BBDown:高效便捷的哔哩哔哩视频下载工具
人工智能·aigc
CV实验室1 小时前
CV论文速递:覆盖视频生成与理解、3D视觉与运动迁移、多模态与跨模态智能、专用场景视觉技术等方向 (11.17-11.21)
人工智能·计算机视觉·3d·论文·音视频·视频生成