I found Chroma to be really slow. I recently switched to pgvector and I'm really happy with it.
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;
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;