Re: [I] [Feature] Improvement of Prompt Configuration for rag_demo Graph Index generation [hugegraph-ai]

2026-09-09 Thread via GitHub


kai-dong123 commented on issue #185:
URL: https://github.com/apache/hugegraph-ai/issues/185#issuecomment-5602307448

   > 嗨!我一直在本地运行流水线(通过 Docker 使用 HugeGraph + 一个兼容 OpenAI 
的大型语言模型端点),我重现了这里描述的失败类——包括 
-即字符串的工件和未明确说明的问题。我想参加这份工作并提交永久居民申请。`rag_demo``"age": "30"``propertykeys`
   > 
   > 从头到尾追踪,根本原因看起来有两层:
   > 
   > **1. 提示符/配置合同不一致。** 
的shipping没有类型化,因此退回并声明所有属性——而提取提示自身的引用示例声明为INT。同一文件的两半存在分歧,因此结果取决于模型“错过”的方向:如果模式最终
 
实现且模型返回该数字——或者模式说了而模型返回——导入无论如何都会失败。这符合你测试过的模型间差异很大。`config_prompt.yaml``graph_schema``propertykeys``CheckSchema``TEXT``age``TEXT``30``INT``"30"`
   > 
   > **2. 导入路径将一个坏属性转化为整个顶点的失败。**在 
中,如果单个属性值与声明类型不符,代码会跳过_整个顶点_(日志显示“跳过”,但实际上丢失了顶点),任何引用该顶点的边都会被发送到服务器,带有原始本地 
ID,失败。我把那份精确的复制品归档为[#373](https://github.com/apache/hugegraph-ai/issues/373)。`commit_to_hugegraph.load_into_graph``continue``Server
 Exception: Invalid vertex id '1:Sarah'`
   > 
   > 根据您的偏好,拟议范围:
   > 
   > * **(a) 配置/提示符对齐**——给出与提示声明类型一致的类型(小型、面向演示);和/或`graph_schema``propertykeys`
   > * **(b) 完全修复** — 同时加固导入路径(该[[Bug] load_into_graph 
在某个属性值与声明类型不符时,丢弃整个顶点,然后边失败,带有一个神秘的“无效顶点 id” 
#373](https://github.com/apache/hugegraph-ai/issues/373)work):无损强制(数值字符串↔编号,LIST/SET基数的标量→列表,DATE);当_可归性_质不可强制时,只舍弃该性质并保留顶点;当主键/不可空值不可用时,跳过该顶点及其相关边,并有命名理由;从未以无法解决的结局结束;只有在无法进口的情况下才加薪。边缘属性也受到同样的强制力。`-MM-dd``addEdge`
   > 
   > 
我在本地端到端验证了流程,并在与模式对齐后,可以用单元测试覆盖分支(模拟客户端,不使用外部服务)——其实已经有“中”要求完全符合这种覆盖范围。你希望我继续用(a)、(a)+(b)还是其他方式?`FIXME``hugegraph-llm/src/tests/operators/hugegraph_op/test_commit_to_hugegraph_load_into_graph.py`
   
   Hi, gentle follow-up on my message from Sep 7.
   
   While checking current HEAD I noticed PR #331 ("resolve edge creation 
failure due to vertex ID mismatch") is merged — so the LLM-generated vs numeric 
server vertex-id normalization half of this issue family is handled via 
vid_mapping.
   
   What still reproduces on current code is the other half, tracked in #373: 
when one property value doesn't match its declared type/format, load_into_graph 
silently skips the whole vertex, so edges referencing it are sent with an 
unmapped id and fail server-side with the cryptic "Invalid vertex id". The 
FIXME at test_commit_to_hugegraph_load_into_graph.py:29 still asks for exactly 
this coverage, and the current data-type-failure test codifies the silent skip 
rather than an explicit outcome.
   
   If a fix for this residual branch is still wanted, I can open a small PR: 
lossless coercion (numeric string ↔ number, scalar → LIST/SET), drop only an 
un-coercible nullable property and keep the vertex, skip a vertex (and name its 
dependent edges) only when a primary-key value is unusable, and raise only if 
nothing could be imported — with mock-client unit tests per the FIXME. If it's 
already covered or not a priority, just say so and I'll leave it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



Re: [I] [Feature] Improvement of Prompt Configuration for rag_demo Graph Index generation [hugegraph-ai]

2026-09-07 Thread via GitHub


kai-dong123 commented on issue #185:
URL: https://github.com/apache/hugegraph-ai/issues/185#issuecomment-5572054284

   Hi! I've been running the `rag_demo` pipeline locally (HugeGraph via Docker 
+ an OpenAI-compatible LLM endpoint) and I reproduced the failure class 
described here — including the `"age": "30"`-as-string artifact and the 
underspecified `propertykeys` problem. I'd like to take this one and submit a 
PR.
   
   After tracing it end to end, the root cause looks two-layered:
   
   **1. Prompt/config contract inconsistency.** `config_prompt.yaml`'s 
`graph_schema` ships without typed `propertykeys`, so `CheckSchema` falls back 
and declares every property `TEXT` — while the extract prompt's own reference 
example declares `age` as INT. The two halves of the same file disagree, so the 
outcome depends on which way the model "misses": if the schema ends up `TEXT` 
and the model returns the number `30` — or the schema says `INT` and the model 
returns `"30"` — import breaks either way. That fits the wide variance you saw 
across the models you tested.
   
   **2. The import path turns one bad property into a whole-vertex failure.** 
In `commit_to_hugegraph.load_into_graph`, a single property value that 
mismatches the declared type makes the code skip the *entire vertex* (the log 
says "skip it", but the `continue` drops the vertex), and any edge referencing 
that vertex is then sent to the server with the raw local id and fails with 
`Server Exception: Invalid vertex id '1:Sarah'`. I filed that precise repro as 
#373.
   
   Proposed scope, depending on your preference:
   - **(a) config/prompt alignment** — give `graph_schema` typed `propertykeys` 
consistent with the prompt's declared types (small, demo-facing); and/or
   - **(b) full fix** — also harden the import path (the #373 work): lossless 
coercion (numeric string ↔ number, scalar → list for LIST/SET cardinality, 
`-MM-dd` for DATE); when a *nullable* property is un-coercible, drop only 
that property and keep the vertex; when a primary-key / non-nullable value is 
unusable, skip that vertex and its dependent edges with named reasons; never 
`addEdge` with an unresolvable endpoint; raise only if nothing could be 
imported. Edge properties get the same coercion.
   
   I've verified the pipeline end-to-end locally after aligning the schema, and 
I can cover the branches with unit tests (mock client, no external services) — 
there is already a `FIXME` in 
`hugegraph-llm/src/tests/operators/hugegraph_op/test_commit_to_hugegraph_load_into_graph.py`
 asking for exactly this coverage. Would you like me to proceed with (a), 
(a)+(b), or a different split?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]