agentscope-ai / agentscope-ai/agentscope-java

[Bug] MilvusStore returns inverted scores for the L2 metric

未關閉
#3,069 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area/ext/rag bug
主要語言
Java
星號
5.6k
分支
1.3k
平均合併
4 天 12 小時
30 天內合併 PR
77

描述

## Description

When `MilvusStore` is configured with `IndexParam.MetricType.L2`, Milvus returns Euclidean distances, where smaller values indicate greater similarity.

`MilvusStore` currently exposes the raw distance as `Document.score`, while AgentScope retrieval consumers and `scoreThreshold` use a higher-is-better score contract.

For example, distances `1.0` and `3.0` are exposed as scores `1.0` and `3.0`. This exposes a less similar result with a higher score, which can cause consumers that rank by higher-is-better scores to order it incorrectly and makes threshold filtering inconsistent.

## Expected behavior

`Document.score` should preserve AgentScope higher-is-better semantics, and `scoreThreshold` should filter results consistently.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。