microsoft / microsoft/semantic-kernel-java

Java: Use functions/stored procedures for calculating similarity

Open
#60 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

java stale
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.