You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR was squashed before being merged into the main branch.
Discussion
----------
[Store][InMemory] Fix cosine similarity sorting
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Docs? | no <!-- required for new features -->
| Issues | Fix#187 ... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
This PR fixes#187, the issue where cosine similarity values were incorrectly treated as distances in the InMemoryStore::query() method, resulting in reversed result ordering.
The fix converts cosine similarity to distance using `1-similarity`, which is the common conversion between similarity and distance.
Ensuring consistent sorting behavior across all strategies. Includes updated unit tests to validate.
Commits
-------
10a69f5 [Store][InMemory] Fix cosine similarity sorting
0 commit comments