Skip to content

添加🚀流式 Web 服务到 GraphRAG,兼容 OpenAI SDK,支持可访问的实体链接🔗,支持建议问题,兼容本地嵌入模型,修复诸多问题。Add streaming web server to GraphRAG, compatible with OpenAI SDK, support accessible entity link, support advice question, compatible with local embedding model, fix lots of issues.

License

Notifications You must be signed in to change notification settings

KylinMountain/graphrag-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphRAG Server

Features

  • 添加了Web服务器,以支持真即时流式输出。
  • 添加了建议问题API。
  • 添加了实体或者关系等链接到输出中,你可以直接点击访问参考实体、关系、数据源或者报告。
  • 支持任意兼容OpenAI大模型桌面应用或者Web应用UI接入。
  • 增加Docker构建
  • 最新版本Graphrag 1.1.2

image

image

如何安装How to install

你可以使用Docker安装,也可以拉取本项目使用。You can install by docker or pull this repo.

拉取源码 Pull the source code

  • 克隆本项目 Clone the repo
git clone https://github.com/KylinMountain/graphrag-server.git
cd graphrag-server
  • 建立虚拟环境 Create virtual env
conda create -n graphrag python=3.10
conda activate graphrag
  • 安装依赖 Install dependencies
pip install -r requirements.txt
  • 初始化GraphRAG Initialize GraphRAG
graphrag init --root .
  • 创建input文件夹 Create Input Foler
mkdir input
  • 配置settings.yaml Config settings.yaml

按照GraphRAG官方配置文档配置 GraphRAG Configuration

  • 索引

在配置好settings.yaml后,运行以下命令进行索引。After config the settings.yaml, run the following command to index.

graphrag index --root .
  • 配置webserver Config webserver

你可能需要修改webserver/configs/settings.py配置以下设置,但默认即可支持本地运行。 You may need config the following item, but you can use the default param.

    server_port: int = 20213
    cors_allowed_origins: list = ["*"]  # Edit the list to restrict access.
    data: str = ("./output")
    community_level: int = 2
    dynamic_community_selection: bool = False
    response_type: str = "Multiple Paragraphs"
  • 启动web server
python -m webserver.main

更多的参考配置,可以访问公众号文章B站视频

使用Docker安装 Install by docker

  • 拉取镜像 pull the docker image
docker pull kylinmountain/graphrag-server:0.3.1

启动 Start 在启动前 你可以创建output、input、prompts和settings.yaml等目录或者文件 Before start, you can create output、input、prompts and settings.yaml etc.

docker run -v ./output:/app/output \
           -v ./input:/app/input \
           -v ./prompts:/app/prompts \
           -v ./settings.yaml:/app/settings.yaml \
           -v ./lancedb:/app/lancedb -p 20213:20213 kylinmountain/graphrag-server:0.3.1

  • 索引 Index
docker run kylinmountain/graphrag-server:0.3.1 python -m graphrag.index --root .

About

添加🚀流式 Web 服务到 GraphRAG,兼容 OpenAI SDK,支持可访问的实体链接🔗,支持建议问题,兼容本地嵌入模型,修复诸多问题。Add streaming web server to GraphRAG, compatible with OpenAI SDK, support accessible entity link, support advice question, compatible with local embedding model, fix lots of issues.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 78.2%
  • HTML 20.5%
  • Dockerfile 1.3%