Files
2026-07-13 10:27:04 +00:00

109 lines
3.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- WEHUB_ZH_README -->
> [!NOTE]
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
> [English](./README.en.md) · [原始项目](https://github.com/AI-Meet/Knowledge_QA_RAG) · [上游 README](https://github.com/AI-Meet/Knowledge_QA_RAG/blob/HEAD/README.md)
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
# Knowledge_QA_RAG
## 概述
本系统是一种基于 RAG 的知识库问答系统简单示例,采用前后端分离的架构设计,融合了多种技术和方法。具体详情可参考:[https://blog.csdn.net/weixin_47936614/article/details/143932997](https://blog.csdn.net/weixin_47936614/article/details/143932997)
## Milvus 安装
本系统是在 Windows 11 上进行部署和运行的,关于 Milvus 向量数据库的安装和启动可以参考以下步骤:
1.勾选 `适用于Linux的Windows子系统``虚拟机平台`
![09afdd4c8869124fd606715f57cae4cb](https://github.com/user-attachments/assets/67c0e85d-cdbc-4a9e-b724-df3f4ea1799a)
2.点击 `确定` 并重新启动计算机
3.以管理员身份打开命令提示符,输入以下命令安装 WSL:
- 在 PowerShell 中设置 WSL 2 为默认版本:
```
wsl --set-default-version 2
```
- 更新 WSL 内核,使用国内网络建议添加 `--web-download`
```
wsl --update --web-download
```
安装成功后的结果如下:
![abe944eb639649fae89175ed09af9fdd](https://github.com/user-attachments/assets/74fc0c97-cf3c-47c6-b3a2-240ba97a44ff)
4.下载安装 Docker Desktop
进入官网下载对应的版本安装即可,官网链接:[https://www.docker.com/products/docker-desktop/](https://www.docker.com/products/docker-desktop/)
5.验证是否安装成功:
```
docker --version
docker-compose --version
```
![a263610663c19d4046f28773a1126369](https://github.com/user-attachments/assets/1f8e801b-b2db-4644-83d7-5da10f4e5764)
6.Milvus 向量数据库安装
- 创建 milvus 文件夹,并在该文件夹下创建多个子文件夹,如下:
![image](https://github.com/user-attachments/assets/27599318-2a9a-4358-a1ec-226ca8363921)
- 下载 Milvus
进入下载页面:[https://github.com/milvus-io/milvus/releases](https://github.com/milvus-io/milvus/releases)
选择 Milvus 版本及其对应的 yml 文件,点击下载即可,如下:
![image](https://github.com/user-attachments/assets/5b8804ca-5c6b-4102-82ac-d47eee31c77b)
- 将下载好的 `milvus-standalone-docker-compose.yml` 重命名为 `docker-compose.yml` ,并放入 milvus 文件中,如下:
![bf7215948670e96f9b50f90a67463950](https://github.com/user-attachments/assets/177d4889-49ff-4af4-8515-7722dc65a504)
- 在 milvus 文件夹中启动 cmd 命令,输入以下命令:
```
docker compose up -d
docker compose ps
docker port milvus-standalone 19530/tcp
```
运行结果如下:
![694be819cd99abc328136139f2e8e8d2](https://github.com/user-attachments/assets/2506153f-9625-42dd-b09c-db01e5ded5d6)
![1a3086ad4519524717991dffa47cce29](https://github.com/user-attachments/assets/a8e9a22c-2b1c-4c95-9e15-fe8d6cb0c3ee)
至此,Milvus 数据库部署成功!
7.Attu 图形化界面安装
下载地址:[https://github.com/zilliztech/attu/releases](https://github.com/zilliztech/attu/releases)
选择对应的版本直接下载安装即可:
![image](https://github.com/user-attachments/assets/b4e96c46-e5e8-42e0-aae9-670008d3ff53)
## 环境安装
```
conda create --name rag-env python=3.10
cd Knowledge_QA_RAG
conda activate rag-env
pip install -r requirements.txt
```
## 快速开始
1.启动 Milvus 数据库
![image](https://github.com/user-attachments/assets/4d2a37ad-3f74-4b72-969c-685c6b023e96)
2.启动系统服务
```
python main.py
```
```
uvicorn server:app --reload --host 127.0.0.1 --port 8000
```
3.访问页面:在浏览器中输入下面 URL 地址即可访问
```
http://127.0.0.1:8000/
```
## 项目演示示例:
📺 [点击观看项目演示视频](https://www.bilibili.com/video/BV1a49KBqE7n/)