HugeGraph-AI
hugegraph-ai 提供 HugeGraph 的 Python 客户端、图机器学习工具,以及面向知识图谱构建和 GraphRAG 的 LLM 工具。
Apache License 2.0 · Ask DeepWiki
模块
- hugegraph-llm:知识图谱构建、GraphRAG 和自然语言图查询。
- hugegraph-ml:从 HugeGraph 读取图数据并运行图学习模型。
- hugegraph-python-client:管理 Schema、图数据和 Gremlin 查询的 Python SDK。
- vermeer-python-client:调用 Vermeer 图计算服务的 Python SDK。
仓库使用 uv workspace,其成员是 hugegraph-llm 和 hugegraph-python-client。hugegraph-ml 和 vermeer-python-client 是可编辑的路径依赖,不在 workspace members 中。当前仓库版本为 1.7.0。客户端源码目录叫 hugegraph-python-client,但发行包名是 hugegraph-python。
环境要求
- HugeGraph-AI 根目录 workspace:Python 3.10 或更高版本;HugeGraph-LLM 还要求低于 3.12
- HugeGraph-ML:Python 3.10 或更高版本
- PyPI 上的
hugegraph-python1.5.0:Python 3.9 或更高版本;当前仓库源码随 workspace 使用 Python 3.10 或更高版本 - Vermeer Python 客户端:当前源码要求 Python 3.10 或更高版本;发行元数据仍声明
>=3.9,详见客户端页 uv0.7 或更高版本- HugeGraph Server 1.5.0 或更高版本;当前 workspace 的 Python 客户端会拒绝可探测到的更低版本
可选依赖组
根项目为每个模块声明一个 extra,另有几个组合项:
| Extra | 安装内容 |
|---|---|
llm | hugegraph-llm |
ml | hugegraph-ml |
python-client | hugegraph-python(源码目录 hugegraph-python-client) |
vermeer | vermeer-python-client |
dev | pytest、pytest-cov、coverage、pylint、ruff、mypy、ty、pre-commit |
nk-llm | hugegraph-llm、hugegraph-python-client,以及编译镜像所需的 Nuitka |
all | 四个模块包 |
hugegraph-llm 自身还声明了 vectordb extra,用于安装 pymilvus 和 qdrant-client。
Docker Compose 部署
仓库提供同时启动 HugeGraph Server 和 RAG 服务的 Compose 文件:
默认地址:
- HugeGraph Server:
http://localhost:8080 - RAG 服务和 Web 界面:
http://localhost:8001
从源码启动 RAG 服务
uv sync 会在仓库根目录创建 .venv。从根目录安装可让 uv 一起解析 workspace 成员和路径依赖。当前仓库不跟踪 uv.lock;uv sync 会按 pyproject.toml 中的依赖声明和版本约束解析依赖。
安装 ML 依赖
示例脚本位于 hugegraph-ml/src/hugegraph_ml/examples/。