rag/README.md
2025-07-16 15:06:59 +08:00

95 lines
1.4 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.

# 知识库服务器
本系统为不同的客户提供自我管理的知识库,并在知识库基础上提供知识检索
本系统提供API形式为注册的服务器提供知识服支持不面向最终客户
## 依赖
依赖[这些模块](requirements.txt)
## 安装部署
1. 创建rag用户
2. 登录rag用户
3. 执行以下命令
```
git clone git@git.kaiyuancloud.cn:yumoqing/rag
cd rag/script
./install.sh
```
将项目在用户根目录checkout
3.
## 功能
管理client系统的客户知识库并提供知识查询
每个客户可以创建一到多个独立的知识库,为不同的业务场景提供知识库知识
知识库之间数据相互独立,互不干扰。
## http API
### add
增加知识库文档
#### path
/api/add
#### method
POST
#### 输入
name: authentication
value: Bears ${apikey}
score: headers
name: file_name
value: path of uploaded file
score: data
name: userid
value: userid of client system
score: data
name: kdbname
value: rag kdb name
score: data
#### 输出
### query
查询知识库
#### path
/api/query
#### method
POST
#### 输入
name: authentication
value: Bears ${apikey}
score: headers
name: prompt
value: ${prompt}
score: data
name: userid
value: ${userid}
score: data
name: kdbname
value: ${kdbname}
score: data
#### 输出
```
{
total:返回记录条数,
rows返回记录内容
}
rows有以下属性
content文本内容
distances距离
source文档path
```