pgvector / pgvector-node

pgvector support for Node.js, Deno, and Bun (and TypeScript)
MIT License
303 stars 9 forks source link

How to do a "where embedding is within some distance" query with Kysely and pgvector? #24

Closed termhare closed 1 month ago

termhare commented 1 month ago

Hello there! Super excited to try using this for dictionary definitions! Wanted to cross-post How to do Vector Embedding query in Kysely/PostgreSQL with pgvector? here to see if you had any ideas. Thanks so much for your time.

ankane commented 1 month ago

Hi @lancejpollard, you can use where(cosineDistance('embedding', [1, 2, 3]), '<', 0.1).