This repository was archived by the owner on Dec 28, 2025. It is now read-only.
forked from apache/incubator-hugegraph-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
feat(llm): vector-db #45
Closed
Closed
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
dae3e24
Refactor: Refactor Scheduler to Support Dynamic Workflow Scheduling a…
weijinglin 41aeae5
Refactor: Refactor hugegraph-ai to using CGraph & port some usecases …
weijinglin 78011d3
Refactor: text2germlin with PCgraph framework (#50)
fantasy-lotus 85e1296
Refactor RAG Workflow: Modularize Flows, Add Streaming, and Improve N…
weijinglin 591a0d1
feat(llm): index curd test passed
mikumifa 0692bca
feat(llm): some type bug && revert to FaissVectorIndex
mikumifa 70da993
feat(llm): some type bug
mikumifa 68fd974
feat(llm): some type bug(from mypy)
mikumifa 997d2e2
feat(llm): add License header
mikumifa 58777ff
feat(llm): import sort && change name
mikumifa 1a14a4b
feat(llm): vector db finished
mikumifa 9f7d64f
feat(llm): updata llm
mikumifa f470605
feat(llm): nexpected-keyword-arg,unused-import
mikumifa fce80a9
feat(llm): fit unitest
mikumifa f3a8a26
feat(llm): use lambda
mikumifa 77dd386
style: format code with black line-length 120
fantasy-lotus 8f3ba72
fix(security): add URL validation to avoid potential SSRF in test_api…
fantasy-lotus f90c1d5
small fix
fantasy-lotus 3561876
fix url
fantasy-lotus a1c128e
fix
fantasy-lotus 7eedb18
fix
fantasy-lotus 68e06fc
chore: mark vectordb optional
imbajin 6d088f7
fix cycle import & add docs
imbajin 12bf415
fix
fantasy-lotus 6d7c9ed
fix
fantasy-lotus f6fa0b7
fix
fantasy-lotus 6daf82c
fix schema g & prompt g
fantasy-lotus 17c72bc
fix black
fantasy-lotus 08f6857
fix
fantasy-lotus b78b051
fix: resolve leftover conflict markers and deps in hugegraph-llm/pypr…
fantasy-lotus 085e372
chore: clean remaining conflict markers by preferring PR-side chunks
fantasy-lotus 0a2e53d
fix: remove remaining conflict markers in operators and utils
fantasy-lotus 3c6a9ee
fix: finalize conflict marker cleanup in llm operators and utils
fantasy-lotus 895ba47
fix
fantasy-lotus e3d4ee1
feat(embeddings): drop QianFan provider and remove related configs
fantasy-lotus a4cfe05
feat(vector-index): UI config for Milvus/Qdrant and CUR_VECTOR_INDEX env
fantasy-lotus 6e31b87
refactor(nodes): unify embedding initialization via Embeddings().get_…
fantasy-lotus b446e4f
refactor(flow): use FaissVectorIndex + Embeddings for graph index info
fantasy-lotus 2df53b6
fix(embeddings): align wrappers with BaseEmbedding and async batch
fantasy-lotus 1893d64
style: apply black formatting with line-length 100
fantasy-lotus cb65760
fix pylint
fantasy-lotus 3571450
ci
fantasy-lotus 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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,24 @@ | ||
| ## 需求列表 | ||
|
|
||
| ### 核心框架设计 | ||
|
|
||
| **核心**:Scheduler类中的schedule_flow设计与实现 | ||
|
|
||
| **验收标准**: | ||
| 1.1. 核心框架尽可能复用资源,避免资源的重复分配和释放 | ||
| 1.2. 应该保证正常的请求处理指标要求 | ||
| 1.3. 应该能够配置框架整体使用的资源上限 | ||
|
|
||
| ### 固定工作流移植 | ||
|
|
||
| **核心**:移植Web Demo中的所有用例 | ||
| 2.1. 保证使用核心框架移植后的工作流的程序行为和移植之前保持一致即可 | ||
|
|
||
| **已完成的工作流类型**: | ||
| - build_vector_index: 向量索引构建工作流 | ||
| - graph_extract: 图抽取工作流 | ||
| - import_graph_data: 图数据导入工作流 | ||
| - update_vid_embeddings: 向量更新工作流 | ||
| - get_graph_index_info: 图索引信息获取工作流 | ||
| - build_schema: 模式构建工作流 | ||
| - prompt_generate: 提示词生成工作流 |
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,36 @@ | ||
| # HugeGraph-ai 固定工作流框架设计和用例移植 | ||
|
|
||
| 本文档将 HugeGraph 固定工作流框架设计和用例移植转换为一系列可执行的编码任务。 | ||
|
|
||
| ## 1. schedule_flow设计与实现 | ||
|
|
||
| - [x] **1.1 构建Scheduler框架1.0** | ||
| - 需要能够复用已经创建过的Pipeline(Pipeline Pooling) | ||
| - 使用CGraph(Graph-based engine)作为底层执行引擎 | ||
| - 不同Node之间松耦合 | ||
|
|
||
| - [ ] **1.2 优化Scheduler框架资源配置** | ||
| - 支持用户配置底层线程池参数 | ||
| - 现有的workflow可能会根据输入有细小的变化,导致相同的用例得到不同的workflow,怎么解决这个问题呢? | ||
| - Node/Operator解耦,Node负责生命周期和上下文,Operator只关注业务逻辑 | ||
| - Flow只负责组装Node,所有业务逻辑下沉到Node/Operator | ||
| - Scheduler支持多类型Flow注册,注册方式更灵活 | ||
|
|
||
| - [ ] **1.3 优化Scheduler框架资源使用** | ||
| - 根据负载控制每个PipelineManager管理的Pipeline数量,实现动态扩缩容 | ||
| - Node层支持参数区自动绑定和并发安全 | ||
| - Operator只需实现run(data_json)方法,Node负责调度和结果写回 | ||
|
|
||
| ## 2. 固定工作流用例移植 | ||
|
|
||
| - [x] **2.1 build_vector_index workflow移植** | ||
| - [x] **2.2 graph_extract workflow移植** | ||
| - [x] **2.3 import_graph_data workflow移植** | ||
| - 基于Node/Operator机制实现import_graph_data工作流 | ||
| - [x] **2.4 update_vid_embeddings workflow移植** | ||
| - 基于Node/Operator机制实现update_vid_embeddings工作流 | ||
| - [x] **2.5 get_graph_index_info workflow移植** | ||
| - [x] **2.6 build_schema workflow移植** | ||
| - 基于Node/Operator机制实现build_schema工作流 | ||
| - [x] **2.7 prompt_generate workflow移植** | ||
| - 基于Node/Operator机制实现prompt_generate工作流 |
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 |
|---|---|---|
|
|
@@ -31,8 +31,11 @@ def admin_http_api(router: APIRouter, log_stream): | |
| @router.post("/logs", status_code=status.HTTP_200_OK) | ||
| async def log_stream_api(req: LogStreamRequest): | ||
| if admin_settings.admin_token != req.admin_token: | ||
| raise generate_response(RAGResponse(status_code=status.HTTP_403_FORBIDDEN, #pylint: disable=E0702 | ||
| message="Invalid admin_token")) | ||
| raise generate_response( | ||
| RAGResponse( | ||
| status_code=status.HTTP_403_FORBIDDEN, message="Invalid admin_token" | ||
| ) # pylint: disable=E0702 | ||
| ) | ||
|
Comment on lines
34
to
38
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. 修复类型错误:不能抛出字典 代码尝试 这会导致运行时错误: 应用此修复: - raise generate_response(
- RAGResponse(
- status_code=status.HTTP_403_FORBIDDEN, # pylint: disable=E0702
- message="Invalid admin_token",
- )
- )
+ return generate_response(
+ RAGResponse(
+ status_code=status.HTTP_403_FORBIDDEN,
+ message="Invalid admin_token",
+ )
+ )🧰 Tools🪛 GitHub Actions: Pylint[error] 34-34: pylint: E0702: Raising dict while only classes or instances are allowed (raising-bad-type) 🤖 Prompt for AI Agents |
||
| log_path = os.path.join("logs", req.log_file) | ||
|
|
||
| # Create a StreamingResponse that reads from the log stream generator | ||
|
|
||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请固定 PyCGraph 的 Git 引用到稳定版本。
目前
pycgraph的 UV 源直接跟踪上游main分支(rev = "main"),这会导致:建议改为引用已发布的 tag 或明确的提交哈希,并在
dependencies中同步标注相应版本。例如:或使用 PyPI 上的正式版本(如
pycgraph==3.1.2)以保持可重复、可追溯的发布流程。📝 Committable suggestion
🤖 Prompt for AI Agents