基于 LLM 大语言模型的知识库问答系统。开箱即用,支持快速嵌入到第三方业务系统,1Panel 官方出品。
Go to file
shaohuzhang1 7349f00c54 Merge branch 'main' of github.com:maxkb-dev/maxkb 2024-01-10 15:26:48 +08:00
apps feat: 数据集列表meta响应为对象 2024-01-10 15:25:50 +08:00
ui feat:知识库 2024-01-09 17:49:47 +08:00
.DS_Store feat: 命中测试 2023-12-29 15:14:11 +08:00
.gitignore feat: git 忽略 package-lock.json 2023-11-28 18:28:35 +08:00
LICENSE Initial commit 2023-09-14 10:05:12 +08:00
README.md feat: 完善 README.md 2023-09-26 13:34:14 +08:00
config_example.yml feat: 配置时间区域 启动前先执行迁移数据库 2023-12-14 12:09:11 +08:00
install_model.py feat: 问答时,同步存入日志,优化向量化执行逻辑,修改model下载目录 2023-12-21 16:55:11 +08:00
main.py fix: 修改用户 提示语非必填 2023-12-20 12:15:20 +08:00
pyproject.toml feat: url获取文档数据工具 2023-12-27 18:33:23 +08:00

maxkb

1 项目结构

!!! Abstract ""

.
├── LICENSE # License 申明
├── README.md
├── apps #   后端项目根目录
│ ├── common    # 项目公共资源目录
│ ├── smartdoc  # 项目主目录 
│ ├── users     # 用户相关
│ ├── manage.py #  django项目入口
│ └── sdk # 项目通用的前后端依赖/网关的前端
├── pyproject.toml # 后端依赖 配置文件
└── ui # 前端项目根目录
├── config_example.yml # 项目配置示例 
├── main.py            # 项目入口文件 python main.py start 启动项目

2 环境准备

1 前端环境准备

2 后端环境准备

3 开发环境搭建

安装poetry包管理器

!!! Abstract ""

pip install poetry

3 开发准备

3.2 本地配置

!!! Abstract "" 若要项目启动,需要准备配置文件及目录

  • 准备配置文件
    #将config_example.yml配置文件 目录拷贝至 /opt/maxkb/conf目录下
    cp config_example.yml /opt/maxkb/conf
    
    • 配置/opt/maxkb/conf/config_example.yml
     # 邮箱配置
     EMAIL_ADDRESS: xxx
     EMAIL_USE_TLS: False
     EMAIL_USE_SSL: True
     EMAIL_HOST: smtp.qq.com
     EMAIL_PORT: 465
     EMAIL_HOST_USER:
     EMAIL_HOST_PASSWORD:
     # 数据库配置 
     DB_NAME: smart-doc
     DB_HOST: localhost
     DB_PORT: 5432
     DB_USER: root
     DB_PASSWORD: xxx
     DB_ENGINE: django.db.backends.postgresql_psycopg2
    

4 开发调试

4.1 启动前端项目

先在ui执行安装前端需要的依赖

npm install

启动项目

npm run dev

启动后端项目

4.2 启动后端项目

!!! Abstract "" 先在根目录执行安装后端需要的依赖

poetry install

启动项目

python main.py start