仓库 | 说明 |
---|---|
https://github.com/YaoApp/yao-knowledge | 知识库 API 接口, 管理后台 |
https://github.com/YaoApp/yao-knowledge-web | 知识库网站源码 (Build 之后放在 public 目录) |
https://github.com/YaoApp/yao-knowledge-desktop | 文档上传客户端(当前支持 PDF 文件格式) |
https://github.com/YaoApp/yao-knowledge-pdf | YAO PDF 文档阅读器插件 (支持 Linux / MacOS) |
依赖 | 版本 | 说明 |
---|---|---|
YAO | v0.10.3+ (#45f83c0) | Yao 应用引擎 |
Weaviate | v0.19.6+ | Weaviate 向量数据库 |
OpenAI | gpt-3.5-turbo, text-embedding-ada-002 | OpenAI 接口 |
参考文档: 安装调试
#45f83c0
, Built: 2023-05-28T13:29:38+0000
运行 yao version 查看
yao version --all
Version: 0.10.3
Go version: go1.19.2
Git commit: 45f83c08fe59
Built: 2023-05-28T13:29:38+0000
OS/Arch: linux/amd64
Docker Compose: compose.yml
version: "3.4"
services:
weaviate:
command:
- --host
- 0.0.0.0
- --port
- "5080"
- --scheme
- http
image: semitechnologies/weaviate:latest
ports:
- 5080:5080
restart: unless-stopped
environment:
QUERY_DEFAULTS_LIMIT: 25
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: "true"
PERSISTENCE_DATA_PATH: "/var/lib/weaviate"
DEFAULT_VECTORIZER_MODULE: "text2vec-openai"
ENABLE_MODULES: "text2vec-openai,generative-openai,qna-openai"
CLUSTER_HOSTNAME: "node1"
all_proxy: socks5://172.17.0.1:7890
http_proxy: http://172.17.0.1:7890
https_proxy: http://172.17.0.1:7890
启动服务
docker compose up -d
git clone https://github.com/YaoApp/yao-knowledge.git
/data/app/.env
文件
YAO_DB_DRIVER="sqlite3"
YAO_DB_PRIMARY="/data/app/db/yao.db"
YAO_ENV="production"
YAO_HOST="0.0.0.0"
YAO_LANG="zh-cn"
YAO_LOG="/data/app/logs/application.log"
YAO_LOG_MODE="TEXT"
YAO_PORT="5099"
YAO_SESSION_FILE="/data/app/db/.session"
YAO_SESSION_STORE="file"
YAO_STUDIO_PORT="5077"
# YAO_EXTENSION_ROOT 设置 YAO 扩展目录; 插件目录为 $YAO_EXTENSION_ROOT/plugins。
# 将对应架构的 .so 文件复制到 /data/yao-exts/plugins/pdf.so
# PDF 文件阅读插件 https://github.com/YaoApp/yao-knowledge-pdf
YAO_EXTENSION_ROOT="/data/yao-exts"
WEAVIATE_HOST="http://<WEAVIATE HOST>:<WEAVIATE PORT>"
OPENAI_KEY=sk-xxxx
YAO_JWT_SECRET=LiQDE1kOnvv6Qv3if2KhEJ7Ihzz1XZ
初始化数据
yao migrate --reset && yao run scripts.doc.SchemaReset
启动服务
yao start
docker run -it --rm \
-v /data/app:/app \
-e APP_NAME="knowledge" \
-e PACK_FLAG="-l 123456" \
-e PACK_ENV="/app/pack.build.yao" \
yaoapp/yao-build:0.10.3-amd64 make
打包好的制品在 dist
目录下
dist
├── knowledge-0.10.3-linux-amd64
└── knowledge-0.10.3-linux-arm64
mkdir /data/empty
cd /data/empty
# 首次运行初始化数据
knowledge-0.10.3-linux-amd64 -k 123456 migrate --reset && knowledge-0.10.3-linux-amd64 -k 123456 run scripts.doc.SchemaReset
# 启动服务
knowledge-0.10.3-linux-amd64 -k 123456 start
仓库: https://github.com/YaoApp/yao-knowledge-desktop
配置文件: config.js
module.exports = { url: "http://127.0.0.1", port: 5099 };
参数 | 说明 |
---|---|
url | 知识库 API 地址 |
port | 端口号 |
制品打包参考 release workflow
仓库: https://github.com/YaoApp/yao-knowledge-web
可将打包后的文件,放到 public
目录
npm run build
cp -r dist/* /data/app/public/