RAGFlow 是一款基于深度文档理解构建的开源 RAG(Retrieval-Augmented Generation)引擎。RAGFlow 可以为各种规模的企业及个人提供一套精简的 RAG 工作流程,结合大语言模型(LLM)针对用户各类不同的复杂格式数据提供可靠的问答以及有理有据的引用。
请登录网址 https://demo.ragflow.io 试用 demo。
vm.max_map_count 不小于 262144:如需确认
vm.max_map_count的大小:> $ sysctl vm.max_map_count > ``` > > 如果 `vm.max_map_count` 的值小于 262144,可以进行重置: > > ```bash > # 这里我们设为 262144: > $ sudo sysctl -w vm.max_map_count=262144 > ``` > > 你的改动会在下次系统重启时被重置。如果希望做永久改动,还需要在 **/etc/sysctl.conf** 文件里把 `vm.max_map_count` 的值再相应更新一遍: > > ```bash > vm.max_map_count=262144 > ``` 2. 克隆仓库: ```bash $ git clone https://github.com/infiniflow/ragflow.git
   $ cd ragflow/docker
   $ chmod +x ./entrypoint.sh
   $ docker compose -f docker-compose-CN.yml up -d
请注意,运行上述命令会自动下载 RAGFlow 的开发版本 docker 镜像。如果你想下载并运行特定版本的 docker 镜像,请在 docker/.env 文件中找到 RAGFLOW_VERSION 变量,将其改为对应版本。例如 RAGFLOW_VERSION=v0.11.0,然后运行上述命令。
核心镜像下载大小为 9 GB,可能需要一定时间拉取。请耐心等待。
   $ docker logs -f ragflow-server
出现以下界面提示说明服务器启动成功:
       ____                 ______ __
      / __ \ ____ _ ____ _ / ____// /____  _      __
     / /_/ // __ `// __ `// /_   / // __ \| | /| / /
    / _, _// /_/ // /_/ // __/  / // /_/ /| |/ |/ /
   /_/ |_| \__,_/ \__, //_/    /_/ \____/ |__/|__/
                 /____/
    * Running on all addresses (0.0.0.0)
    * Running on http://127.0.0.1:9380
    * Running on http://x.x.x.x:9380
    INFO:werkzeug:Press CTRL+C to quit
如果您跳过这一步系统确认步骤就登录 RAGFlow,你的浏览器有可能会提示
network abnormal或网络异常,因为 RAGFlow 可能并未完全启动成功。
user_default_llm 栏配置 LLM factory,并在 API_KEY 栏填写和你选择的大模型相对应的 API key。好戏开始,接着奏乐接着舞!
系统配置涉及以下三份文件:
SVR_HTTP_PORT、MYSQL_PASSWORD、MINIO_PASSWORD 等。请务必确保 .env 文件中的变量设置与 service_conf.yaml 文件中的配置保持一致!
./docker/README 文件提供了环境变量设置和服务配置的详细信息。请一定要确保 ./docker/README 文件当中列出来的环境变量的值与 service_conf.yaml 文件当中的系统配置保持一致。
如需更新默认的 HTTP 服务端口(80), 可以在 docker-compose-CN.yml 文件中将配置 80:80 改为 <YOUR_SERVING_PORT>:80。
所有系统配置都需要通过系统重启生效:
> $ docker compose -f docker-compose-CN.yml up -d > ``` ## 🛠️ 源码编译、安装 Docker 镜像 如需从源码安装 Docker 镜像: ```bash $ git clone https://github.com/infiniflow/ragflow.git $ cd ragflow/ $ docker build -t infiniflow/ragflow:v0.11.0 . $ cd ragflow/docker $ chmod +x ./entrypoint.sh $ docker compose up -d
如需从源码启动服务,请参考以下步骤:
$ git clone https://github.com/infiniflow/ragflow.git
$ cd ragflow/
$ conda create -n ragflow python=3.11.0
$ conda activate ragflow
$ pip install -r requirements.txt
如果 cuda > 12.0,需额外执行以下命令:
$ pip uninstall -y onnxruntime-gpu
$ pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
$ cp docker/entrypoint.sh .
$ vi entrypoint.sh
使用以下命令获取python路径及ragflow项目路径:
$ which python
$ pwd
将上述 which python 的输出作为 PY 的值,将 pwd 的输出作为 PYTHONPATH 的值。
LD_LIBRARY_PATH 如果环境已经配置好,可以注释掉。
# 此处配置需要按照实际情况调整,两个 export 为新增配置
PY=${PY}
export PYTHONPATH=${PYTHONPATH}
# 可选:添加 Hugging Face 镜像
export HF_ENDPOINT=https://hf-mirror.com
$ cd docker
$ docker compose -f docker-compose-base.yml up -d 
检查配置文件 确保docker/.env中的配置与conf/service_conf.yaml中配置一致, service_conf.yaml中相关服务的IP地址与端口应该改成本机IP地址及容器映射出来的端口。
启动服务
$ chmod +x ./entrypoint.sh
$ bash ./entrypoint.sh
$ cd web
$ npm install --registry=https://registry.npmmirror.com --force
$ vim .umirc.ts
# 修改proxy.target为http://127.0.0.1:9380
$ npm run dev 
$ cd web
$ npm install --registry=https://registry.npmmirror.com --force
$ umi build
$ mkdir -p /ragflow/web
$ cp -r dist /ragflow/web
$ apt install nginx -y
$ cp ../docker/nginx/proxy.conf /etc/nginx
$ cp ../docker/nginx/nginx.conf /etc/nginx
$ cp ../docker/nginx/ragflow.conf /etc/nginx/conf.d
$ systemctl start nginx
详见 RAGFlow Roadmap 2024 。
RAGFlow 只有通过开源协作才能蓬勃发展。秉持这一精神,我们欢迎来自社区的各种贡献。如果您有意参与其中,请查阅我们的 贡献者指南 。
扫二维码添加 RAGFlow 小助手,进 RAGFlow 交流群。