diff --git a/README.md b/README.md index 019b9be..b2378d5 100644 --- a/README.md +++ b/README.md @@ -78,12 +78,18 @@ SELECT * FROM items WHERE embedding <-> '[3,1,2]' < 5; Note: Combine with `ORDER BY` and `LIMIT` to use an index -Get the average of vectors +Average vectors ```sql SELECT AVG(embedding) FROM items; ``` +Average groups of vectors + +```sql +SELECT category_id, AVG(embedding) FROM items GROUP BY category_id; +``` + ## Indexing Speed up queries with an approximate index. Add an index for each distance function you want to use.