diff --git a/content/docs-lite/zh/docs/DataVec/DataVec-integrations.md b/content/docs-lite/zh/docs/DataVec/DataVec-integrations.md index f2e255c0bb45e20000b1f5dc212a8eef4dd1fc4c..9345bc5a4ece15fe1654136a2d4ac8334822cfeb 100644 --- a/content/docs-lite/zh/docs/DataVec/DataVec-integrations.md +++ b/content/docs-lite/zh/docs/DataVec/DataVec-integrations.md @@ -3,7 +3,7 @@ openGauss DataVec提供多种第三方组件的集成教程,并通过多语言SDK支持,帮助你轻松搭建RAG服务,提升数据处理效率。 ## 编排第三方组件 -- Dify +- [Dify](dify.md) - AnythingLLM ## 向量数据迁移 @@ -12,8 +12,8 @@ openGauss DataVec提供多种第三方组件的集成教程,并通过多语言 - 从ElasticSearch迁移至openGauss DataVec ## API Reference -- Python -- Java -- Node.js -- Go +- [Python](https://gitee.com/opengauss/openGauss-connector-python-psycopg2) +- [Java](https://gitee.com/opengauss/openGauss-connector-jdbc) +- [Node.js](https://gitee.com/opengauss/openGauss-connector-nodejs) +- [Go](https://gitee.com/opengauss/openGauss-connector-go-pq) diff --git a/content/docs-lite/zh/docs/DataVec/DataVec-tutorials.md b/content/docs-lite/zh/docs/DataVec/DataVec-tutorials.md index 4416a1f2ef3cd94d43f1c4efc9051ad9dab7190e..930d5b0108fc535ffa5e21a5726bbdc33e397795 100644 --- a/content/docs-lite/zh/docs/DataVec/DataVec-tutorials.md +++ b/content/docs-lite/zh/docs/DataVec/DataVec-tutorials.md @@ -2,5 +2,5 @@ 本章节提供基于openGauss DataVec 的教程案例,帮助你更好的了解向量数据库的使用模式。 -- openGauss DataVec + Dify, 快速搭建你的智能助手平台 +- [openGauss DataVec + Dify, 快速搭建你的智能助手平台](openGauss&Dify.md) - SpringBoot 集成 openGauss DataVec, 智能问答一站式开发 diff --git a/content/docs-lite/zh/docs/DataVec/dify.md b/content/docs-lite/zh/docs/DataVec/dify.md new file mode 100644 index 0000000000000000000000000000000000000000..45aaf1ce5cc7b877b748cc79dbb14ca9abd84f0d --- /dev/null +++ b/content/docs-lite/zh/docs/DataVec/dify.md @@ -0,0 +1,36 @@ +# 使用openGauss部署Dify +Dify是一个开源的大语言模型(LLM)应用开发平台。借助检索增强(RAG)引擎,可以对从智能体到复杂人工智能工作流程的大语言模型应用进行编排。 +本文着重介绍如何部署Dify,并使用openGauss DataVec向量数据库作为RAG引擎语料库。 + +## Dify部署 +### 获取Dify源码 +访问链接https://github.com/langgenius/dify/archive/refs/tags/1.1.0.zip 获取Dify1.1.0源码。(Dify自1.1.0版本开始支持openGauss,本文以Dify1.1.0版本为例) + +### 配置参数 +创建目录并解压: +```bash +mkdir /usr/local/dify +unzip 1.1.0.zip -d /usr/local/dify/ +cd /usr/local/dify/dify-1.1.0/docker +``` +配置环境变量,修改.env中VECTOR_STORE=opengauss +```bash +cp .env.example .env +vim .env +``` +![](./figures/ENV.png) + +### 启动容器 +执行以下命令,自动拉取对应Docker镜像并启动服务。 +```bash +docker-compose up -d +``` +容器启动后执行docker ps确保服务都正常运行,如下图所示: +![](./figures/Docker.png) + +## AI服务集成 +### 创建用户并登陆 +访问本地部署的Dify web服务页面: +```bash +http://your_server_ip +``` \ No newline at end of file diff --git a/content/docs-lite/zh/docs/DataVec/figures/ChatDify.png b/content/docs-lite/zh/docs/DataVec/figures/ChatDify.png new file mode 100644 index 0000000000000000000000000000000000000000..d50d45ee012803489f1fdc5663b1c73ae6e640de Binary files /dev/null and b/content/docs-lite/zh/docs/DataVec/figures/ChatDify.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/ChatDify2.png b/content/docs-lite/zh/docs/DataVec/figures/ChatDify2.png new file mode 100644 index 0000000000000000000000000000000000000000..5fb8be5528a86ac68d24010bc59efda8cb35602f Binary files /dev/null and b/content/docs-lite/zh/docs/DataVec/figures/ChatDify2.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/Corpus.png b/content/docs-lite/zh/docs/DataVec/figures/Corpus.png new file mode 100644 index 0000000000000000000000000000000000000000..444c24aee52bad08415c85e2cce1b7ee07b05bce Binary files /dev/null and b/content/docs-lite/zh/docs/DataVec/figures/Corpus.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/Docker.png b/content/docs-lite/zh/docs/DataVec/figures/Docker.png new file mode 100644 index 0000000000000000000000000000000000000000..d5aac46074b27754453b08a72b1d8be9089b0f57 Binary files /dev/null and b/content/docs-lite/zh/docs/DataVec/figures/Docker.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/ENV.png b/content/docs-lite/zh/docs/DataVec/figures/ENV.png new file mode 100644 index 0000000000000000000000000000000000000000..703a1d4d71f3d6e3e4318e6af37c0bb7e8e55f11 Binary files /dev/null and b/content/docs-lite/zh/docs/DataVec/figures/ENV.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/EmbedDify.png b/content/docs-lite/zh/docs/DataVec/figures/EmbedDify.png new file mode 100644 index 0000000000000000000000000000000000000000..5aa6118eb7afe7bd40eda82aefde5eb536693159 Binary files /dev/null and b/content/docs-lite/zh/docs/DataVec/figures/EmbedDify.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/LLMDify.png b/content/docs-lite/zh/docs/DataVec/figures/LLMDify.png new file mode 100644 index 0000000000000000000000000000000000000000..8481b2235ee51817709daac070ef28d96da78c6c Binary files /dev/null and b/content/docs-lite/zh/docs/DataVec/figures/LLMDify.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/LoginDify.png b/content/docs-lite/zh/docs/DataVec/figures/LoginDify.png new file mode 100644 index 0000000000000000000000000000000000000000..7e08735e2e60d1b011bd3c4dcfe521a3af8ce8d3 Binary files /dev/null and b/content/docs-lite/zh/docs/DataVec/figures/LoginDify.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/OllamaPlugin.png b/content/docs-lite/zh/docs/DataVec/figures/OllamaPlugin.png new file mode 100644 index 0000000000000000000000000000000000000000..c59e3e871d6cb1c46f2a9f9a909f4ea7da552aad Binary files /dev/null and b/content/docs-lite/zh/docs/DataVec/figures/OllamaPlugin.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/SaveCorpus.png b/content/docs-lite/zh/docs/DataVec/figures/SaveCorpus.png new file mode 100644 index 0000000000000000000000000000000000000000..b3f69146e81e690fd76733d7308680349368b654 Binary files /dev/null and b/content/docs-lite/zh/docs/DataVec/figures/SaveCorpus.png differ diff --git a/content/docs-lite/zh/docs/DataVec/figures/SaveCorpusDone.png b/content/docs-lite/zh/docs/DataVec/figures/SaveCorpusDone.png new file mode 100644 index 0000000000000000000000000000000000000000..0ced0841883636a925cb65a58614fb3c378dd45f Binary files /dev/null and b/content/docs-lite/zh/docs/DataVec/figures/SaveCorpusDone.png differ diff --git a/content/docs-lite/zh/docs/DataVec/openGauss&Dify.md b/content/docs-lite/zh/docs/DataVec/openGauss&Dify.md new file mode 100644 index 0000000000000000000000000000000000000000..f2d0e48e09a1a6a77c5055aff123365ffc17b361 --- /dev/null +++ b/content/docs-lite/zh/docs/DataVec/openGauss&Dify.md @@ -0,0 +1,71 @@ +# openGauss Datavec + Dify,快速搭建你的智能助手平台 +Dify是一个开源的大语言模型(LLM)应用开发平台。借助检索增强(RAG)引擎,可以对从智能体到复杂人工智能工作流程的大语言模型应用进行编排。 +本文着重介绍如何部署Dify,并使用openGauss DataVec向量数据库作为RAG引擎语料库。 + +## Dify部署 +### 获取Dify源码 +访问链接https://github.com/langgenius/dify/archive/refs/tags/1.1.0.zip 获取Dify1.1.0源码。(Dify自1.1.0版本开始支持openGauss,本文以Dify1.1.0版本为例) + +### 配置参数 +创建目录并解压: +```bash +mkdir /usr/local/dify +unzip 1.1.0.zip -d /usr/local/dify/ +cd /usr/local/dify/dify-1.1.0/docker +``` +配置环境变量,修改.env中VECTOR_STORE=opengauss +```bash +cp .env.example .env +vim .env +``` +![](./figures/ENV.png) +### 启动容器 +执行以下命令,自动拉取对应Docker镜像并启动服务。 +```bash +docker-compose up -d +``` +容器启动后执行docker ps确保服务都正常运行,如下图所示: +![](./figures/Docker.png) + +## AI服务集成 +### 创建用户并登陆 +访问本地部署的Dify web服务页面: +```bash +http://your_server_ip +``` + +创建管理员用户。输入邮箱及密码: + +![](./figures/LoginDify.png) + +### 接入大模型 +在主界面点击右上角用户名,然后点击“设置”进入设置页面,单击“模型供应商”,选择“Ollama”单击“安装”按钮。(ollama服务及大模型部署参考:[openGauss-RAG实践](https://opengauss.org/zh/blogs/jiwenke/openGauss-RAG%E5%AE%9E%E8%B7%B5.html)) +![](./figures/OllamaPlugin.png) + +安装完成后,在添加模型页面,“模型类型”选择“LLM”,配置如下: + + +![](./figures/LLMDify.png) + + +接着选择“Text Embeding”,配置如下: + + +![](./figures/EmbedDify.png) + +### 导入语料 +本文以openGauss语料知识为例,单击“知识库”标签,选择“导入已有文本”将本地语料导入。 +![](./figures/Corpus.png) + +“Embeding模型”选择之前配置好的模型,单击“保存并处理”。 +![](./figures/SaveCorpus.png) +等待语料处理完成并存入openGauss向量数据库。 +![](./figures/SaveCorpusDone.png) + +### 对话 +开启聊天窗口,输入问题等待回答: +![](./figures/ChatDify.png) + +可见回答质量很低,描述并不准确,接下来我们引入之前导入的语料库作为上下文再次进行问答: +![](./figures/ChatDify2.png) +借助于openGauss语料库,我们得到了更为准确的答案。至此,基于openGauss向量数据库的Dify RAG引擎搭建完成。 \ No newline at end of file