私有知识库 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

相关推荐
嗨,紫玉灵神熊4 分钟前
使用 OpenCV 实现图像中心旋转
图像处理·人工智能·opencv·计算机视觉
cmoaciopm9 分钟前
FastGPT部署的一些问题整理
人工智能
odoo中国13 分钟前
机器学习实操 第一部分 机器学习基础 第6章 决策树
人工智能·决策树·机器学习
giszz13 分钟前
DeepSeek提示词技巧
人工智能
AI技术学长16 分钟前
训练神经网络的批量标准化(使用 PyTorch)
人工智能·pytorch·神经网络·数据科学·计算机技术·批量标准化
ccLianLian18 分钟前
深度学习·经典模型·Transformer
人工智能·深度学习·transformer
caihuayuan525 分钟前
IOS 国际化词条 Python3 脚本
java·大数据·spring boot·后端·课程设计
Chat_zhanggong34530 分钟前
deepseek海思SD3403边缘计算AI产品系统
人工智能·边缘计算
人大博士的交易之路39 分钟前
龙虎榜——20250429
人工智能·数学建模·数据挖掘·量化分析·涨停回马枪·龙虎榜
哲讯智能科技1 小时前
无锡哲讯科技:SAP财务系统——赋能企业智慧财务管理
大数据·人工智能