- 添加了Web服务器,以支持真即时流式输出。
 - 添加了建议问题API。
 - 添加了实体或者关系等链接到输出中,你可以直接点击访问参考实体、关系、数据源或者报告。
 - 支持任意兼容OpenAI大模型桌面应用或者Web应用UI接入。
 - 增加Docker构建
 - 最新版本Graphrag 1.1.2
 
你可以使用Docker安装,也可以拉取本项目使用。You can install by docker or pull this repo.
- 克隆本项目 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
- 创建input文件夹 Create Input Foler
 
mkdir input
然后将你的文件放入。
- 配置settings.yaml Config settings.yaml
 
按照GraphRAG官方配置文档配置 GraphRAG Configuration 当前项目中,默认配置为智普免费的glm-4-flash,你只需要创建.env文件并配置你的key即可。
- 索引
 
在配置好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- 拉取镜像 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 \
           -p 20213:20213 kylinmountain/graphrag-server:0.3.1
- 索引 Index
 
docker run kylinmountain/graphrag-server:0.3.1 python -m graphrag.index --root .

