pgvector / pgvector-node

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

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

Closed lancejpollard closed 4 months ago

lancejpollard commented 4 months 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 4 months ago

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