by legendofbrando · 3y ago · 0 comments
This is an example of using pgvector that might be relevant for your use case:
SELECT d.id, d.doc, 1 - (embedding <=> (SELECT embedding FROM documentation_embedding WHERE id = 1)) AS similarity FROM documentation_embedding de join documentation d on de.documentation_id = d.id ORDER BY similarity desc;
be cautious with pgvector - the recall can be extremely bad (% retrieved nearest neighbors vs ground truth)