fix(vector_stores): normalize scores to similarity (higher = better) across all backends (#5391)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user