lplalbert commented on PR #412:
URL: https://github.com/apache/hugegraph-ai/pull/412#issuecomment-6755334266
Thanks for the careful review — both points land, and the fix is pushed
(1da8b0d).
Root cause: the PR routed chunk retrieval through `VECTOR_DIS_THRESHOLD` and
defaulted the
request field to 0.9, so (a) requests that omit the threshold silently
switched chunk
pruning from 2.0 to 0.9 and lost chunks without opting in, and (b) the
suggested
`VECTOR_DIS_THRESHOLD=2.0` escape hatch also loosened keyword-to-vertex
matching in
`SemanticIdQuery`. On squared-L2 stores (`FaissVectorIndex`, Milvus `L2`)
the distances are
squared anyway, so a cosine-scale 0.9 there drops even more chunks — the
historical 2.0
cutoff is what those index paths were effectively tuned against.
Structural fix:
- Chunk retrieval now has its own knob: `CHUNK_DIS_THRESHOLD` (default 2.0 =
the historical
hard-coded value) used by `VectorIndexQuery` when a request omits the
threshold — the
default chunk behavior is unchanged.
- `VECTOR_DIS_THRESHOLD` (0.9) stays dedicated to `SemanticIdQuery`.
- `vector_dis_threshold` is now `Optional[float] = None` on both request
models: omitted →
each path resolves its own configured default; explicit → per-call
override of both.
- Flows pass explicit values through verbatim, so `0` keeps meaning "exact
matches only"
(previously `x or default` swallowed it).
- `config.md` documents both knobs.
Validation (offline): 453 passed in operators/nodes/api; full suite 1295
passed, 16 skipped,
2 pre-existing Windows failures (POSIX mode bits in
`test_external_config.py`, unrelated).
ruff clean; ty 269 (main baseline 271 — `VectorQueryNode` now narrows
`wk_input` through the
repo's `cast(WkFlowInput, ...)` idiom instead of adding another None-union
deref).
--
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]