microsoft / microsoft/semantic-kernel-java
Java: Use functions/stored procedures for calculating similarity
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 276
- Forks
- 56
- Avg merge
- 17h 45m
- Merged PRs (30d)
- 4
Description
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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the memory nearest match API and its withEmbeddings behavior. Investigate how cosine similarity, sorting, and limiting are currently handled, then assess whether database functions or stored procedures can move that work to the database. The issue does not define a concrete implementation or completion criterion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100