From 804c57519f31be5990bd79b5733f010a2175672b Mon Sep 17 00:00:00 2001 From: JT-Dev-215 <65767260+JT-Dev-215@users.noreply.github.com> Date: Wed, 8 May 2024 00:54:13 +0700 Subject: [PATCH] fix: PGVector similarity score (#817) --- packages/core/src/storage/vectorStore/PGVectorStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/storage/vectorStore/PGVectorStore.ts b/packages/core/src/storage/vectorStore/PGVectorStore.ts index b48848577c..3109d9d37c 100644 --- a/packages/core/src/storage/vectorStore/PGVectorStore.ts +++ b/packages/core/src/storage/vectorStore/PGVectorStore.ts @@ -294,7 +294,7 @@ export class PGVectorStore implements VectorStore { const ret = { nodes: nodes, - similarities: results.rows.map((row) => row.s), + similarities: results.rows.map((row) => 1 - row.s), ids: results.rows.map((row) => row.id), };