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, 
`yyyy-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]

Reply via email to