lplalbert commented on code in PR #412:
URL: https://github.com/apache/hugegraph-ai/pull/412#discussion_r4523395661


##########
hugegraph-llm/src/hugegraph_llm/flows/rag_flow_graph_vector.py:
##########
@@ -74,7 +74,9 @@ def prepare(
         prepared_input.max_graph_items = max_graph_items or 
huge_settings.max_graph_items
         prepared_input.topk_return_results = topk_return_results or 
huge_settings.topk_return_results
         prepared_input.topk_per_keyword = topk_per_keyword or 
huge_settings.topk_per_keyword
-        prepared_input.vector_dis_threshold = vector_dis_threshold or 
huge_settings.vector_dis_threshold
+        # Keep 0.0 meaning "exact matches only"; each consumer resolves its own
+        # configured default (VECTOR_DIS_THRESHOLD / CHUNK_DIS_THRESHOLD).
+        prepared_input.vector_dis_threshold = vector_dis_threshold

Review Comment:
   Fixed in `b7fef91`. Root cause: the store filter was a strict `distance < 
dis_threshold`, so a forwarded `0` dropped even zero-distance results. The 
threshold is now an inclusive bound across the affected stores (Faiss, Milvus, 
Qdrant): a hit is kept when `distance <= dis_threshold`, so `0` keeps exact 
matches only. `VectorStoreBase.search` documents the inclusive contract.
   
   Store-level regression tests cover the zero boundary and an exact hit at the 
threshold distance for all three backends 
(`test_faiss_vector_index.py::TestThresholdSemantics`, 
`test_optional_vector_clients.py::test_qdrant_threshold_semantics_include_exact_matches`,
 
`test_optional_vector_clients.py::test_milvus_threshold_semantics_include_exact_matches`);
 this coverage also retires the cross-backend threshold-semantics FIXME in 
`test_faiss_vector_index.py`.
   
   Validation: `src/tests/indices/ src/tests/operators/index_op/ 
src/tests/api/test_rag_request_defaults.py` — 84 passed, 1 skipped; ruff clean 
on touched files.



-- 
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