Skip to content
This repository was archived by the owner on Dec 28, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
dae3e24
Refactor: Refactor Scheduler to Support Dynamic Workflow Scheduling a…
weijinglin Sep 16, 2025
41aeae5
Refactor: Refactor hugegraph-ai to using CGraph & port some usecases …
weijinglin Sep 25, 2025
78011d3
Refactor: text2germlin with PCgraph framework (#50)
fantasy-lotus Sep 29, 2025
85e1296
Refactor RAG Workflow: Modularize Flows, Add Streaming, and Improve N…
weijinglin Sep 30, 2025
591a0d1
feat(llm): index curd test passed
mikumifa May 20, 2025
0692bca
feat(llm): some type bug && revert to FaissVectorIndex
mikumifa May 20, 2025
70da993
feat(llm): some type bug
mikumifa May 20, 2025
68fd974
feat(llm): some type bug(from mypy)
mikumifa May 20, 2025
997d2e2
feat(llm): add License header
mikumifa May 20, 2025
58777ff
feat(llm): import sort && change name
mikumifa May 20, 2025
1a14a4b
feat(llm): vector db finished
mikumifa May 21, 2025
9f7d64f
feat(llm): updata llm
mikumifa May 22, 2025
f470605
feat(llm): nexpected-keyword-arg,unused-import
mikumifa May 22, 2025
fce80a9
feat(llm): fit unitest
mikumifa May 22, 2025
f3a8a26
feat(llm): use lambda
mikumifa May 22, 2025
77dd386
style: format code with black line-length 120
fantasy-lotus Aug 12, 2025
8f3ba72
fix(security): add URL validation to avoid potential SSRF in test_api…
fantasy-lotus Aug 12, 2025
f90c1d5
small fix
fantasy-lotus Aug 12, 2025
3561876
fix url
fantasy-lotus Aug 12, 2025
a1c128e
fix
fantasy-lotus Aug 13, 2025
7eedb18
fix
fantasy-lotus Aug 13, 2025
68e06fc
chore: mark vectordb optional
imbajin Aug 27, 2025
6d088f7
fix cycle import & add docs
imbajin Aug 27, 2025
12bf415
fix
fantasy-lotus Aug 28, 2025
6d7c9ed
fix
fantasy-lotus Aug 28, 2025
f6fa0b7
fix
fantasy-lotus Aug 28, 2025
6daf82c
fix schema g & prompt g
fantasy-lotus Sep 3, 2025
17c72bc
fix black
fantasy-lotus Sep 3, 2025
08f6857
fix
fantasy-lotus Sep 3, 2025
b78b051
fix: resolve leftover conflict markers and deps in hugegraph-llm/pypr…
fantasy-lotus Oct 9, 2025
085e372
chore: clean remaining conflict markers by preferring PR-side chunks
fantasy-lotus Oct 9, 2025
0a2e53d
fix: remove remaining conflict markers in operators and utils
fantasy-lotus Oct 9, 2025
3c6a9ee
fix: finalize conflict marker cleanup in llm operators and utils
fantasy-lotus Oct 9, 2025
895ba47
fix
fantasy-lotus Oct 9, 2025
e3d4ee1
feat(embeddings): drop QianFan provider and remove related configs
fantasy-lotus Oct 10, 2025
a4cfe05
feat(vector-index): UI config for Milvus/Qdrant and CUR_VECTOR_INDEX env
fantasy-lotus Oct 10, 2025
6e31b87
refactor(nodes): unify embedding initialization via Embeddings().get_…
fantasy-lotus Oct 10, 2025
b446e4f
refactor(flow): use FaissVectorIndex + Embeddings for graph index info
fantasy-lotus Oct 10, 2025
2df53b6
fix(embeddings): align wrappers with BaseEmbedding and async batch
fantasy-lotus Oct 10, 2025
1893d64
style: apply black formatting with line-length 100
fantasy-lotus Oct 10, 2025
cb65760
fix pylint
fantasy-lotus Oct 12, 2025
3571450
ci
fantasy-lotus Oct 12, 2025
89151c2
feat: support batch build gremlin examples & delete some doc related …
weijinglin Oct 12, 2025
ff52f11
adopt some suggestions proposed by ai
weijinglin Oct 13, 2025
1d56c5c
Merge upstream/agenticrag/dev: integrate flows/nodes architecture + p…
fantasy-lotus Oct 17, 2025
b1d08f8
fix: update imports for merged architecture
fantasy-lotus Oct 17, 2025
6928338
fix: update graph_index_utils to use modular vector stores
fantasy-lotus Oct 17, 2025
bd89ab6
fix: use HEAD version of demo UI blocks
fantasy-lotus Oct 17, 2025
3a75916
fix: add missing vector_index parameter to BuildSemanticIndex
fantasy-lotus Oct 17, 2025
a10730c
fix: remove KgBuilder and resolve circular import
fantasy-lotus Oct 17, 2025
77343c2
fix: add missing vector_index parameter to BuildVectorIndex
fantasy-lotus Oct 17, 2025
d212091
fix: add missing vector_index parameter to VectorIndexQuery
fantasy-lotus Oct 17, 2025
c5e4bb0
fix: add missing vector_index parameter to SemanticIdQuery
fantasy-lotus Oct 17, 2025
0c87dec
Merge upstream/vector-db: keep agenticrag/dev integration and fixes
fantasy-lotus Oct 17, 2025
ccc6b9a
fix: add missing vector_index parameter to BuildGremlinExampleIndex
fantasy-lotus Oct 17, 2025
31de3b4
fix: add missing vector_index parameter to GremlinExampleIndexQuery
fantasy-lotus Oct 17, 2025
0bdbf89
refactor: refactor scheduler to support dynamic workflow scheduling a…
weijinglin Sep 16, 2025
b90925a
refactor: refactor hugegraph-ai to integrate with CGraph & port some …
weijinglin Sep 25, 2025
d36d41d
refactor: text2germlin with PCGraph framework (#50)
fantasy-lotus Sep 29, 2025
6ad8fd9
refactor(RAG workflow): modularize flows, add streaming, and improve …
weijinglin Sep 30, 2025
edae389
refactor: port batch build gremlin examples & delete some doc related…
weijinglin Oct 12, 2025
8bbd29b
chore: commit staged changes before merge
fantasy-lotus Oct 27, 2025
9ad00c0
Merge upstream/agenticrag/dev: integrate new flows/nodes architecture…
fantasy-lotus Oct 27, 2025
4ba51ca
fix: update GetGraphIndexInfoFlow to use new vector index API
fantasy-lotus Oct 27, 2025
66b0961
fix: update graph_index_utils to use new vector index API
fantasy-lotus Oct 27, 2025
9690da7
fix conflicts
fantasy-lotus Oct 27, 2025
90feadb
Update hugegraph-llm/src/hugegraph_llm/operators/index_op/build_seman…
fantasy-lotus Oct 27, 2025
e0797fe
Update hugegraph-llm/src/hugegraph_llm/indices/vector_index/milvus_ve…
fantasy-lotus Oct 27, 2025
e74e09c
Update hugegraph-llm/src/hugegraph_llm/demo/rag_demo/admin_block.py
fantasy-lotus Oct 27, 2025
221effe
Update hugegraph-llm/src/hugegraph_llm/demo/rag_demo/app.py
fantasy-lotus Oct 27, 2025
b040918
fix(qdrant): use UUID for point IDs to prevent data loss from ID coll…
fantasy-lotus Oct 27, 2025
9b67afd
Merge apache/main: integrate official upstream changes with vector-db…
fantasy-lotus Oct 27, 2025
0ebbd98
Merge remote-tracking branch 'origin/vector-db' into vector-db
fantasy-lotus Oct 27, 2025
e74d11a
style: fix pylint issues (trailing whitespace, unused imports, line l…
fantasy-lotus Oct 27, 2025
9ae2c12
style: suppress remaining pylint warnings with proper justifications
fantasy-lotus Oct 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions hugegraph-llm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ python -m hugegraph_llm.demo.rag_demo.app --host 127.0.0.1 --port 18001
> The following commands assume you're in the activated virtual environment from step 4 above

```bash
# To use vector database backends (e.g., Milvus, Qdrant), sync the optional dependencies:
uv sync --extra vectordb

# Download NLTK stopwords for better text processing
python ./src/hugegraph_llm/operators/common_op/nltk_helper.py

Expand Down
13 changes: 13 additions & 0 deletions hugegraph-llm/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- [LiteLLM 配置](#litellm-配置)
- [重排序配置](#重排序配置)
- [HugeGraph 数据库配置](#hugegraph-数据库配置)
- [向量数据库配置](#向量数据库配置)
- [管理员配置](#管理员配置)
- [配置使用示例](#配置使用示例)
- [配置文件位置](#配置文件位置)
Expand Down Expand Up @@ -130,6 +131,18 @@
| `TOPK_PER_KEYWORD` | Optional[Integer] | 1 | 每个关键词返回的 TopK 数量 |
| `TOPK_RETURN_RESULTS` | Optional[Integer] | 20 | 返回结果数量 |

### 向量数据库配置

| 配置项 | 类型 | 默认值 | 说明 |
|------------------|------------------|-------|------------------------|
| `QDRANT_HOST` | Optional[String] | None | Qdrant 服务器主机地址 |
| `QDRANT_PORT` | Integer | 6333 | Qdrant 服务器端口 |
| `QDRANT_API_KEY` | Optional[String] | None | Qdrant API 密钥(如果设置了的话) |
| `MILVUS_HOST` | Optional[String] | None | Milvus 服务器主机地址 |
| `MILVUS_PORT` | Integer | 19530 | Milvus 服务器端口 |
| `MILVUS_USER` | String | "" | Milvus 用户名 |
| `MILVUS_PASSWORD`| String | "" | Milvus 密码 |

### 管理员配置

| 配置项 | 类型 | 默认值 | 说明 |
Expand Down
33 changes: 30 additions & 3 deletions hugegraph-llm/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ description = "A tool for the implementation and research related to large langu
authors = [
{ name = "Apache HugeGraph Contributors", email = "[email protected]" },
]
maintainers = [
{ name = "Apache HugeGraph Contributors", email = "[email protected]" },
]
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.10,<3.12"


dependencies = [
# Common dependencies
"decorator",
Expand All @@ -39,9 +40,9 @@ dependencies = [
"numpy",
"pandas",
"pydantic",
"tqdm",
"scipy",
"python-igraph",


# LLM specific dependencies
"openai",
Expand All @@ -63,6 +64,13 @@ dependencies = [
"hugegraph-python-client",
"pycgraph",
]

[project.optional-dependencies]
vectordb = [
"pymilvus==2.5.9",
"qdrant-client==1.14.2",
]

[project.urls]
homepage = "https://hugegraph.apache.org/"
repository = "https://github.com/apache/incubator-hugegraph-ai"
Expand Down Expand Up @@ -92,3 +100,22 @@ hugegraph-python-client = { workspace = true }
# We encountered a bug in PyCGraph's latest release version, so we're using a specific commit from the main branch (without the bug) as the project dependency.
# TODO: Replace this command in the future when a new PyCGraph release version (after 3.1.2) is available.
pycgraph = { git = "https://github.com/ChunelFeng/CGraph.git", subdirectory = "python", rev = "248bfcfeddfa2bc23a1d585a3925c71189dba6cc"}

[tool.mypy]
disable_error_code = ["import-untyped"]
check_untyped_defs = true
disallow_untyped_defs = false

[tool.ruff]
line-length = 120
indent-width = 4
extend-exclude = []

# TODO: move this config in the root pyproject.toml & add more rules for it
[tool.ruff.lint]
extend-select = ["I"]

[tool.ruff.format]
quote-style = "preserve"
indent-style = "space"
line-ending = "auto"
8 changes: 5 additions & 3 deletions hugegraph-llm/src/hugegraph_llm/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@
# under the License.


__all__ = ["huge_settings", "admin_settings", "llm_settings", "resource_path"]
__all__ = ["huge_settings", "admin_settings", "llm_settings", "resource_path", "index_settings"]

import os

from .prompt_config import PromptConfig
from .hugegraph_config import HugeGraphConfig
from .admin_config import AdminConfig
from .hugegraph_config import HugeGraphConfig
from .index_config import IndexConfig
from .llm_config import LLMConfig
from .prompt_config import PromptConfig

llm_settings = LLMConfig()
prompt = PromptConfig(llm_settings)
prompt.ensure_yaml_file_exists()

huge_settings = HugeGraphConfig()
admin_settings = AdminConfig()
index_settings = IndexConfig()

package_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
resource_path = os.path.join(package_path, "resources")
9 changes: 8 additions & 1 deletion hugegraph-llm/src/hugegraph_llm/config/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@

import argparse

from hugegraph_llm.config import huge_settings, admin_settings, llm_settings, PromptConfig
from hugegraph_llm.config import (
PromptConfig,
admin_settings,
huge_settings,
index_settings,
llm_settings,
)

if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Generate hugegraph-llm config file")
Expand All @@ -30,4 +36,5 @@
huge_settings.generate_env()
admin_settings.generate_env()
llm_settings.generate_env()
index_settings.generate_env()
PromptConfig(llm_settings).generate_yaml_file()
23 changes: 12 additions & 11 deletions hugegraph-llm/src/hugegraph_llm/config/hugegraph_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,29 @@
# under the License.

from typing import Optional

from .models import BaseConfig


class HugeGraphConfig(BaseConfig):
"""HugeGraph settings"""

# graph server config
graph_url: Optional[str] = "127.0.0.1:8080"
graph_name: Optional[str] = "hugegraph"
graph_user: Optional[str] = "admin"
graph_pwd: Optional[str] = "xxx"
graph_url: str = "127.0.0.1:8080"
graph_name: str = "hugegraph"
graph_user: str = "admin"
graph_pwd: str = "xxx"
graph_space: Optional[str] = None

# graph query config
limit_property: Optional[str] = "False"
max_graph_path: Optional[int] = 10
max_graph_items: Optional[int] = 30
edge_limit_pre_label: Optional[int] = 8
limit_property: str = "False"
max_graph_path: int = 10
max_graph_items: int = 30
edge_limit_pre_label: int = 8

# vector config
vector_dis_threshold: Optional[float] = 0.9
topk_per_keyword: Optional[int] = 1
vector_dis_threshold: float = 0.9
topk_per_keyword: int = 1

# rerank config
topk_return_results: Optional[int] = 20
topk_return_results: int = 20
38 changes: 38 additions & 0 deletions hugegraph-llm/src/hugegraph_llm/config/index_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

import os
from typing import Optional

from .models import BaseConfig


class IndexConfig(BaseConfig):
"""LLM settings"""

qdrant_host: Optional[str] = os.environ.get("QDRANT_HOST", None)
qdrant_port: int = int(os.environ.get("QDRANT_PORT", "6333"))
qdrant_api_key: Optional[str] = (
os.environ.get("QDRANT_API_KEY") if os.environ.get("QDRANT_API_KEY") else None
)

milvus_host: Optional[str] = os.environ.get("MILVUS_HOST", None)
milvus_port: int = int(os.environ.get("MILVUS_PORT", "19530"))
milvus_user: str = os.environ.get("MILVUS_USER", "")
milvus_password: str = os.environ.get("MILVUS_PASSWORD", "")

cur_vector_index: str = os.environ.get("CUR_VECTOR_INDEX", "Faiss")
2 changes: 2 additions & 0 deletions hugegraph-llm/src/hugegraph_llm/config/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@

from .base_config import BaseConfig
from .base_prompt_config import BasePromptConfig

__all__ = ["BaseConfig", "BasePromptConfig"]
3 changes: 1 addition & 2 deletions hugegraph-llm/src/hugegraph_llm/demo/rag_demo/admin_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from collections import deque

import gradio as gr
from gradio import Request

from hugegraph_llm.config import admin_settings
from hugegraph_llm.utils.log import log
Expand Down Expand Up @@ -70,7 +69,7 @@ def clear_llm_server_log():


# Function to validate password and control access to logs
def check_password(password, request: Request = None):
def check_password(password, request: gr.Request | None = None):
client_ip = request.client.host if request else "Unknown IP"
admin_token = admin_settings.admin_token

Expand Down
2 changes: 1 addition & 1 deletion hugegraph-llm/src/hugegraph_llm/demo/rag_demo/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def init_rag_ui() -> gr.Interface:
def refresh_ui_config_prompt() -> tuple:
# we can use its __init__() for in-place reload
# settings.from_env()
huge_settings.__init__() # pylint: disable=C2801
huge_settings.__init__() # type: ignore[misc] # pylint: disable=C2801
prompt.ensure_yaml_file_exists()
return (
huge_settings.graph_url,
Expand Down
Loading
Loading