fix(vector_stores): normalize scores to similarity (higher = better) across all backends (#5391)

This commit is contained in:
Kartik
2026-06-05 19:13:26 +05:30
committed by GitHub
parent b00a1a1065
commit 7ac8ab154b
20 changed files with 970 additions and 50 deletions
+1 -1
View File
@@ -444,7 +444,7 @@ export class RedisDB implements VectorStore {
return {
id: doc.value.memory_id,
payload: toCamelCase(resultPayload),
score: Number(doc.value.__vector_score) ?? 0,
score: Math.max(0, 1 - (Number(doc.value.__vector_score) ?? 0)),
};
});
} catch (error) {