We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 09db9e4 commit 4b9310eCopy full SHA for 4b9310e
libs/community/langchain_community/vectorstores/cratedb/base.py
@@ -469,6 +469,7 @@ def _euclidean_relevance_score_fn(similarity: float) -> float:
469
# (0 is most similar, sqrt(2) most dissimilar)
470
# to a similarity function (0 to 1)
471
472
- # Original:
473
- # return 1.0 - distance / math.sqrt(2)
+ # CrateDB uses the `vector_similarity()` SQL function in this context,
+ # which already returns a normalized value.
474
+ # https://cratedb.com/docs/crate/reference/en/latest/general/builtins/scalar-functions.html#vector-similarity-float-vector-float-vector
475
return similarity
0 commit comments