agentscope-ai / agentscope-ai/agentscope-java

[Bug] MilvusStore returns inverted scores for the L2 metric

Aberta
#3,069 3 comentários 0 reações 0 responsáveis Ver no GitHub
area/ext/rag bug
Linguagem predominante
Java
Estrelas
5.6k
Forks
1.3k
Merge médio
4d 12h
PRs com merge (30d)
77

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.