From cd89259c8db0bf233c50f8807ae27455cb9af856 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Sat, 27 Jul 2024 16:46:43 +0000 Subject: Use cosine similarity instead of l2 --- server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.py b/server.py index ac8ea15..6a04076 100644 --- a/server.py +++ b/server.py @@ -23,7 +23,7 @@ cur.execute( "CREATE TABLE IF NOT EXISTS idx (id INTEGER PRIMARY KEY, parent INTEGER, time INTEGER, path TEXT)" ) cur.execute( - "CREATE VIRTUAL TABLE IF NOT EXISTS emb USING vec0(id INTEGER PRIMARY KEY, embedding float[1024])" + "CREATE VIRTUAL TABLE IF NOT EXISTS emb USING vec0(id INTEGER PRIMARY KEY, embedding float[1024] distance_metric=cosine)" ) con.commit() -- cgit v1.2.3-70-g09d2