From 31a007933c4bf3dbe01ff84c1fcd64a84904757d Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sun, 14 Apr 2024 08:40:27 -0700 Subject: [PATCH] Updated readme [skip ci] --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 017519d..5118da0 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,12 @@ Get the nearest neighbors to a vector SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5; ``` +Supported distance functions are: + +- `<->` - L2 distance +- `<#>` - (negative) inner product +- `<=>` - cosine distance + Get the nearest neighbors to a row ```sql @@ -509,7 +515,7 @@ Insert vectors INSERT INTO items (embedding) VALUES ('{1:1,3:2,5:3}/5'), ('{1:4,3:5,5:6}/5'); ``` -Note: The format is `{index1:value1,index2:value2,...}/dimensions` and indices start at 1 like SQL arrays +The format is `{index1:value1,index2:value2}/dimensions` and indices start at 1 like SQL arrays Get the nearest neighbors by L2 distance