Skip to content

Conversation

@ChristianZaccaria
Copy link
Contributor

@ChristianZaccaria ChristianZaccaria commented Sep 8, 2025

What does this PR do?

Make distance_metric configurable in vector stores:

  • Configurable distance_metric enabled for PGVector.
  • Added plumbing to support configuring more distance metrics for each vector provider.

We should create GitHub issues for each provider.

Closes #3213

Test Plan

  • Added test cases:
    • TBC

Copy link
Contributor

@r3v5 r3v5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ChristianZaccaria ! Thanks for your PR, nice work. I proposed some improvements.

@ehhuang
Copy link
Contributor

ehhuang commented Sep 11, 2025

I made a comment on the issue. Would like to discuss this more.

Copy link
Contributor

@ehhuang ehhuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see linked issue

- Configurable distance_metric enabled for PGVector.
- Added plumbing to support configuring more distance metrics for each vector provider.
@ChristianZaccaria ChristianZaccaria changed the title fix(vector-io): unify score calculation to use cosine and normalize to [0,1] feat: make distance_metric configurable in vector stores Oct 23, 2025
Raises:
NotImplementedError: If the distance metric is not supported yet
"""
if distance_metric != "COSINE":
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vector_io providers do not calculate scores correctly when cosine distance being used

4 participants