The implementation of the memory nearest match API computes cosine similarity on the client side.
Is it possible to compute cosine similarity on the database side through a database function or stored procedure?
If so, withEmbeddings could be pushed to the database side (i.e., should the embeddings column be selected?)
- Could sorting and limiting be done on the database side, too?
- Is the extra overhead on the database a good tradeoff for less overhead in data on the wire?