{"id":38033742,"url":"https://github.com/jasonkylelol/graphrag-chinese","last_synced_at":"2026-01-16T19:47:29.445Z","repository":{"id":256932534,"uuid":"856894515","full_name":"jasonkylelol/graphrag-chinese","owner":"jasonkylelol","description":"支持中文🇨🇳🇨🇳🇨🇳 的 microsoft/graphrag","archived":false,"fork":false,"pushed_at":"2025-04-03T10:43:32.000Z","size":1435,"stargazers_count":40,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T11:34:46.818Z","etag":null,"topics":["chinese","graphrag"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jasonkylelol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-13T12:12:19.000Z","updated_at":"2025-04-03T10:43:36.000Z","dependencies_parsed_at":"2024-09-14T00:32:49.276Z","dependency_job_id":"aff8d51c-e4d2-4c1a-868c-e1e3d1403717","html_url":"https://github.com/jasonkylelol/graphrag-chinese","commit_stats":null,"previous_names":["jasonkylelol/graphrag-chinese"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jasonkylelol/graphrag-chinese","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonkylelol%2Fgraphrag-chinese","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonkylelol%2Fgraphrag-chinese/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonkylelol%2Fgraphrag-chinese/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonkylelol%2Fgraphrag-chinese/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasonkylelol","download_url":"https://codeload.github.com/jasonkylelol/graphrag-chinese/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonkylelol%2Fgraphrag-chinese/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28481954,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chinese","graphrag"],"created_at":"2026-01-16T19:47:29.381Z","updated_at":"2026-01-16T19:47:29.439Z","avatar_url":"https://github.com/jasonkylelol.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# graphrag-chinese\n\n支持**中文**🇨🇳🇨🇳🇨🇳的 microsoft graphrag\n\n来自 [microsoft/graphrag](https://github.com/microsoft/graphrag)\n\n- 可以使用OpenAI协议兼容的中文大模型API，或者开源中文模型搭建的OpenAI协议兼容的API server\n- 使用开源模型搭建API server可以显著降低索引构建成本\n\n## 更新\n\n- 🚀 `2025/04/03` **DRIFT query**支持streaming输出了，`cli.query`支持了`multi-index`查询，升级graphrag版本为 **v2.1.0**\n- 🚀 `2025/01/14` 新增 **BASIC query** 模式，升级graphrag版本为 **v1.1.2**\n- 🚀 `2024/11/27` 新增了 **DRIFT query** 模式，升级graphrag版本为 **v0.5.0**\n- 🚀 `2024/09/13` 适配中文，graphrag版本为 **v0.3.3**\n\n## 与原生 graphrag 的区别\n- 定制的基于中文字符和标点符号的分词器\n- 将 index 和 query 使用到的 prompt 翻译为中文\n\n## tips\n- 深度思考模型可能不适用\n\n## 用法\n\n### 配置env\n新建`.env`文件到根目录，写入环境变量  \nGRAPHRAG_API_BASE: OpenAI api 兼容的服务  \nGRAPHRAG_API_BASE_EMBEDDING: OpenAI api 兼容的embedding服务  \nGRAPHRAG_API_KEY: OpenAI api key  \n\n### index\n```\nGRAPHRAG_INPUT_FILE_TYPE=text python index.py --root /working_root --input /input_files --lang chinese\n```\n\n--root: graphrag 工作目录  \n--input: index 用到的输入文件夹  \n--lang: 可选, 默认 english, 可用 chinese  \n--update: 可选，更新已有的知识图谱索引  \nGRAPHRAG_INPUT_FILE_TYPE: graphrag input 类型, text/csv  \n\n### query\nindex 完成后, 使用 ```python serving.py``` 启动 FastAPI server，支持流式查询  \nmethod: POST  \nbody:  \n```\n{\n    \"root\": \"/working_root\",\n    \"method\": \"local\",  # graphrag query method, can be local, global, drift or basic\n    \"query\": \"query prompt\",\n    \"streaming\": false  # streaming output\n}\n```\n调用示例:  \n```\ncurl -N -X POST -H 'Content-Type:application/json' -d '{\"root\":\"/workspace/test\", \"method\":\"local\", \"query\":\"why Musk is essential for OpenAI?\", \"streaming\": false}' 'http://192.168.0.20:38062/query'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonkylelol%2Fgraphrag-chinese","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasonkylelol%2Fgraphrag-chinese","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonkylelol%2Fgraphrag-chinese/lists"}