Help: Any way do query via pgvector operators AND supabase client js in frontend?
just want a simple cosine similarity to query in frontend via supabase client.
I already have the embeddings for both
my current code:
PLEASE any advice will help really need this feature to work!
I already have the embeddings for both
my current code:
const queryEmbedding = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0];
const similarityThreshold = 0.7;
const matchCount = 5;
const { data, error } = await supabase
.from('docs')
.select('*')
.gte(1 - (embedding <=> ARRAY[${queryEmbedding.join(',')}], similarityThreshold)
.order(embedding <=> ARRAY[${queryEmbedding.join(',')}], { ascending: false })
.limit(matchCount);PLEASE any advice will help really need this feature to work!