This repository was archived by the owner on Dec 28, 2025. It is now read-only.
forked from apache/hugegraph-doc
-
Notifications
You must be signed in to change notification settings - Fork 2
docs: refactor documentation structure and add new content #1
Closed
Closed
Changes from 10 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0ac79ba
add doc on docker
weijinglin b120961
doc: add docker deploy doc
weijinglin 20420bd
Merge branch 'master' of https://github.com/apache/incubator-hugegrap…
weijinglin 73e1709
Hierarchizing the directory structure
weijinglin eb066c7
Merge branch 'master' of https://github.com/apache/incubator-hugegrap…
weijinglin 15d4975
Merge branch 'master' into doc
weijinglin 7423970
refactor all docs
weijinglin 5599c1b
fix link error caused by refactor
weijinglin c6f690e
order
weijinglin 33c9a53
fixed doc to add some config of docker deployment
weijinglin 1a2c622
minor fix
weijinglin 29aa986
improvement details
imbajin 593f22a
translate example page & remove 404 pages
imbajin 8c95ec9
fix link & add go/python docs
imbajin 5cda9bd
enhance clients info
imbajin a8d96d6
refacor quick start doc
weijinglin 85a686e
minor fix
weijinglin f4cfc89
minor fix
weijinglin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| title: "HugeGraph Client" | ||
| linkTitle: "HugeGraph Client" | ||
| weight: 4 | ||
| --- |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| title: "HugeGraph Computing" | ||
| linkTitle: "HugeGraph Computing" | ||
| weight: 3 | ||
weijinglin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --- | ||
2 changes: 1 addition & 1 deletion
2
.../cn/docs/quickstart/hugegraph-computer.md → ...uickstart/computing/hugegraph-computer.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t/cn/docs/quickstart/hugegraph-vermeer.md → ...quickstart/computing/hugegraph-vermeer.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,55 +1,126 @@ | ||
| --- | ||
| title: "HugeGraph-AI Quick Start" | ||
| linkTitle: "使用 HugeGraph-AI" | ||
| weight: 4 | ||
| title: "探索 HugeGraph-AI" | ||
| linkTitle: "探索 HugeGraph-AI" | ||
| weight: 2 | ||
| --- | ||
|
|
||
| > 请参考 AI 仓库的 [README](https://github.com/apache/incubator-hugegraph-ai/tree/main/hugegraph-llm#readme) 获取最新文档,官网会**定期**更新和同步~。 | ||
|
|
||
| > AI总结的项目文档:[](https://deepwiki.com/apache/incubator-hugegraph-ai) | ||
|
|
||
| ### 1 HugeGraph-AI 概述 | ||
| hugegraph-ai 旨在探索 HugeGraph 与人工智能(AI)的融合,包括与大模型结合的应用,与图机器学习组件的集成等,为开发者在项目中利用 HugeGraph | ||
| 的 AI 能力提供全面支持。 | ||
| `hugegraph-llm` 是一个用于实现和研究大语言模型相关功能的工具。该项目包含可运行的演示程序,也可以作为第三方库使用。 | ||
|
|
||
| 众所周知,图系统可以帮助大模型解决时效性和幻觉等挑战,而大模型可以帮助图系统解决成本相关的问题。 | ||
|
|
||
| 通过这个项目,我们旨在降低使用图系统的成本,并减少构建知识图谱的复杂性。该项目将为图系统和大语言模型提供更多应用和集成解决方案: | ||
| 1. 通过 LLM + HugeGraph 构建知识图谱 | ||
| 2. 使用自然语言操作图数据库(Gremlin/Cypher) | ||
| 3. 知识图谱补充答案上下文(GraphRAG → Graph Agent) | ||
|
|
||
| ### 2 环境要求 | ||
| - python 3.9+ (better to use `3.10`) | ||
| - hugegraph-server 1.3+ | ||
| > [!IMPORTANT] | ||
| > - python 3.10+(未在 3.12 中测试) | ||
| > - hugegraph-server 1.3+(建议使用 1.5+) | ||
| > - uv 0.7+ | ||
imbajin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
Comment on lines
+25
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 补充最低系统资源要求 🤖 Prompt for AI Agents |
||
| ### 3 准备工作 | ||
|
|
||
| #### 3.1 Docker部署 | ||
|
|
||
| **Docker部署** | ||
| 如果您希望使用Docker来部署HugeGraph-AI,请按照以下步骤操作: | ||
| - 确保您已安装Docker | ||
| - 我们提供了两种容器镜像: | ||
| - **镜像1**:[hugegraph/rag](https://hub.docker.com/r/hugegraph/rag/tags) | ||
| 用于构建和运行RAG功能,适合快速部署和开发使用 | ||
| - **镜像2**:[hugegraph/rag-bin](https://hub.docker.com/r/hugegraph/rag-bin/tags) | ||
| 使用Nuitka编译的二进制版本,在生产环境中提供更稳定和高效的性能 | ||
| - 拉取Docker镜像: | ||
| ```bash | ||
| docker pull hugegraph/rag:latest # 拉取镜像1 | ||
| docker pull hugegraph/rag-bin:latest # 拉取镜像2 | ||
| ``` | ||
| - 启动Docker容器: | ||
| ```bash | ||
| docker run -it --name rag -v path2project/hugegraph-llm/.env:/home/work/hugegraph-llm/.env -p 8001:8001 hugegraph/rag bash | ||
| docker run -it --name rag-bin -v path2project/hugegraph-llm/.env:/home/work/hugegraph-llm/.env -p 8001:8001 hugegraph/rag-bin bash | ||
| ``` | ||
| - 启动Graph RAG演示: | ||
| ```bash | ||
| # 镜像1 | ||
| python ./src/hugegraph_llm/demo/rag_demo/app.py # 或运行 python -m hugegraph_llm.demo.rag_demo.app | ||
|
|
||
| # 镜像2 | ||
| ./app.dist/app.bin | ||
| ``` | ||
| - 访问界面:http://localhost:8001 | ||
|
|
||
| #### 3.2 从源码构建 | ||
|
|
||
| 1. 启动HugeGraph数据库,可以通过 [Docker](https://hub.docker.com/r/hugegraph/hugegraph)/[Binary Package](https://hugegraph.apache.org/docs/download/download/) 运行它。 | ||
| 请参阅详细[文档](https://hugegraph.apache.org/docs/quickstart/hugegraph-server/#31-use-docker-container-convenient-for-testdev)以获取更多指导 | ||
| 2. 克隆项目 | ||
| 有一个简单的Docker方法: | ||
| ```bash | ||
| docker run -itd --name=server -p 8080:8080 hugegraph/hugegraph | ||
| ``` | ||
| 请参阅详细[文档](/cn/docs/quickstart/hugegraph/hugegraph-server/#31-use-docker-container-convenient-for-testdev)以获取更多指导 | ||
|
|
||
| 2. 配置uv环境,使用官方安装程序安装uv,其他安装方法请参见[uv文档](https://docs.astral.sh/uv/configuration/installer/) | ||
| ```bash | ||
| # 如果遇到网络问题,可以尝试使用pipx或pip安装uv,更多详情请参考uv文档 | ||
| curl -LsSf https://astral.sh/uv/install.sh | sh - # 安装最新版本,如0.7.3+ | ||
| ``` | ||
imbajin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| 3. 克隆项目 | ||
| ```bash | ||
| git clone https://github.com/apache/incubator-hugegraph-ai.git | ||
| ``` | ||
| 3. 安装 [hugegraph-python-client](../hugegraph-python-client) 和 [hugegraph_llm](src/hugegraph_llm) | ||
|
|
||
| 4. 配置依赖环境 | ||
| ```bash | ||
| cd incubator-hugegraph-ai/hugegraph-llm | ||
| uv venv && source .venv/bin/activate | ||
| uv pip install -e . | ||
| ``` | ||
| 如果由于网络问题导致依赖下载失败或速度过慢,建议修改 `hugegraph-llm/pyproject.toml`。 | ||
|
|
||
| 5. 安装 [hugegraph-python-client](../hugegraph-python-client) 和 [hugegraph_llm](src/hugegraph_llm) | ||
| ```bash | ||
| cd ./incubator-hugegraph-ai # better to use virtualenv (source venv/bin/activate) | ||
imbajin marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| pip install ./hugegraph-python-client | ||
| pip install -r ./hugegraph-llm/requirements.txt | ||
| ``` | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 4. 进入项目目录 | ||
|
|
||
| 6. 进入项目目录 | ||
| ```bash | ||
| cd ./hugegraph-llm/src | ||
| ``` | ||
| 5. 启动 **Graph RAG** 的 gradio 交互 demo,可以使用以下命令运行,启动后打开 http://127.0.0.1:8001 | ||
|
|
||
| 7. 启动 **Graph RAG** 的 gradio 交互 demo,可以使用以下命令运行,启动后打开 http://127.0.0.1:8001 | ||
| ```bash | ||
| python3 -m hugegraph_llm.demo.rag_demo.app | ||
| python -m hugegraph_llm.demo.rag_demo.app # 与 "uv run xxx" 相同 | ||
| ``` | ||
| 默认主机为 `0.0.0.0` ,端口为 `8001` 。您可以通过传递命令行参数 `--host` 和 `--port` 来更改它们。 | ||
| 默认主机为 `0.0.0.0` ,端口为 `8001` 。您可以通过传递命令行参数 `--host` 和 `--port` 来更改它们。 | ||
| ```bash | ||
| python3 -m hugegraph_llm.demo.rag_demo.app --host 127.0.0.1 --port 18001 | ||
| python -m hugegraph_llm.demo.rag_demo.app --host 127.0.0.1 --port 18001 | ||
| ``` | ||
| 6. 启动 **Text2Gremlin** 的 gradio 交互演示,可以使用以下命令运行,启动后打开 http://127.0.0.1:8002 ,您还可以按上述方式更改默认主机 `0.0.0.0` 和端口 `8002` 。(🚧ing) | ||
|
|
||
| 8. 启动 **Text2Gremlin** 的 gradio 交互演示,可以使用以下命令运行,启动后打开 http://127.0.0.1:8002 ,您还可以按上述方式更改默认主机 `0.0.0.0` 和端口 `8002` 。(🚧ing) | ||
| ```bash | ||
| python3 -m hugegraph_llm.demo.gremlin_generate_web_demo | ||
| ``` | ||
| 7. 在运行演示程序后,配置文件文件将被删除。`.env ` 将自动生成在 `hugegraph-llm/.env` 路径下。此外,还有一个与 prompt 相关的配置文件 `config_prompt.yaml` 。也会在`hugegraph-llm/src/hugegraph_llm/resources/demo/config_prompt.yaml`路径下生成。 | ||
|
|
||
| 9. 在运行演示程序后,配置文件 `.env` 将自动生成在 `hugegraph-llm/.env` 路径下。此外,还有一个与 prompt 相关的配置文件 `config_prompt.yaml` 也会在 `hugegraph-llm/src/hugegraph_llm/resources/demo/config_prompt.yaml` 路径下生成。 | ||
| 您可以在页面上修改内容,触发相应功能后会自动保存到配置文件中。你也可以直接修改文件而无需重启应用程序;只需刷新页面即可加载最新的更改。 | ||
| (可选)要重新生成配置文件,您可以将 `config.generate` 与 `-u` 或 `--update` 一起使用。 | ||
| (可选)要重新生成配置文件,您可以将 `config.generate` 与 `-u` 或 `--update` 一起使用。 | ||
| ```bash | ||
| python3 -m hugegraph_llm.config.generate --update | ||
| python -m hugegraph_llm.config.generate --update | ||
| ``` | ||
| 8. (**可选**)您可以使用 [hugegraph-hubble](https://hugegraph.apache.org/docs/quickstart/hugegraph-hubble/#21-use-docker-convenient-for-testdev) 来访问图形数据,可以通过 [Docker/Docker-Compose](https://hub.docker.com/r/hugegraph/hubble) 运行它以获得指导。 (Hubble 是一个图形分析仪表板,包括数据加载/模式管理/图形遍历/显示)。 | ||
| 9. (__可选__)离线下载 NLTK 停用词 | ||
| 注意:`Litellm` 支持多 LLM 提供商,参考 [litellm.ai](https://docs.litellm.ai/docs/providers) 进行配置 | ||
|
|
||
| 10. (**可选**)您可以使用 [hugegraph-hubble](/cn/docs/quickstart/toolchain/hugegraph-hubble/#21-use-docker-convenient-for-testdev) 来访问图形数据,可以通过 [Docker/Docker-Compose](https://hub.docker.com/r/hugegraph/hubble) 运行它以获得指导。 (Hubble 是一个图形分析仪表板,包括数据加载/模式管理/图形遍历/显示)。 | ||
|
|
||
| 11. (__可选__)离线下载 NLTK 停用词 | ||
| ```bash | ||
| python ./hugegraph_llm/operators/common_op/nltk_helper.py | ||
| ``` | ||
|
|
@@ -65,7 +136,7 @@ hugegraph-ai 旨在探索 HugeGraph 与人工智能(AI)的融合,包括与 | |
| - file: 上传文件:<u>TXT</u> 或 <u>.docx</u>(可同时选择多个文件) | ||
| - [Schema](https://hugegraph.apache.org/docs/clients/restful-api/schema/):(接受**2种类型**) | ||
| - 用户定义模式( JSON 格式,遵循[模板](https://github.com/apache/incubator-hugegraph-ai/blob/aff3bbe25fa91c3414947a196131be812c20ef11/hugegraph-llm/src/hugegraph_llm/config/config_data.py#L125)来修改它) | ||
| - 指定 HugeGraph 图实例的名称,它将自动从中获取模式(如 **“hugegraph”**) | ||
| - 指定 HugeGraph 图实例的名称,它将自动从中获取模式(如 **"hugegraph"**) | ||
| - Graph extract head: 用户自定义的图提取提示 | ||
| - 如果已经存在图数据,你应该点击 "**Rebuild vid Index**" 来更新索引 | ||
|
|
||
|
|
@@ -140,13 +211,13 @@ hugegraph-ai 旨在探索 HugeGraph 与人工智能(AI)的融合,包括与 | |
| graph_rag = RAGPipeline() | ||
| graph_rag.extract_keywords(text="Tell me about Al Pacino.").print_result() | ||
| ``` | ||
| 2. **根据关键字匹配 Vid**::将节点与图中的关键字匹配。 | ||
| ```python | ||
| 2. **根据关键字匹配 Vid**:将节点与图中的关键字匹配。 | ||
| ```python | ||
| graph_rag.keywords_to_vid().print_result() | ||
| ``` | ||
| ``` | ||
| 3. **RAG 的查询图**:从 HugeGraph 中检索对应的关键词及其多度关联关系。 | ||
| ```python | ||
| graph_rag.query_graphdb(max_deep=2, max_items=30).print_result() | ||
| graph_rag.query_graphdb(max_deep=2, max_graph_items=30).print_result() | ||
| ``` | ||
| 4. **重新排序搜索结果**:根据问题与结果之间的相似性对搜索结果进行重新排序。 | ||
| ```python | ||
|
|
@@ -160,3 +231,4 @@ hugegraph-ai 旨在探索 HugeGraph 与人工智能(AI)的融合,包括与 | |
| ```python | ||
| graph_rag.run(verbose=True) | ||
| ``` | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.