Skip to content

Commit 4b9310e

Browse files
committed
CrateDB: Vector Store -- update docs in _euclidean_relevance_score_fn
1 parent 09db9e4 commit 4b9310e

File tree

1 file changed

+3
-2
lines changed
  • libs/community/langchain_community/vectorstores/cratedb

1 file changed

+3
-2
lines changed

libs/community/langchain_community/vectorstores/cratedb/base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ def _euclidean_relevance_score_fn(similarity: float) -> float:
469469
# (0 is most similar, sqrt(2) most dissimilar)
470470
# to a similarity function (0 to 1)
471471

472-
# Original:
473-
# return 1.0 - distance / math.sqrt(2)
472+
# CrateDB uses the `vector_similarity()` SQL function in this context,
473+
# 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
474475
return similarity

0 commit comments

Comments
 (0)