Proposal for a new feature below by @baptiste-pasquier
Checked
[X] I searched existing ideas and did not find a similar one
[X] I added a very descriptive title
[X] I've clearly described the feature request and motivation for it
Feature request
Add the ability to filter out documents with a similarity score less than a score_threshold in the MultiVectorRetriever.
Motivation
The VectorStoreRetriever base class has a "similarity_score_threshold" option for search_type, which adds the ability to filter out any documents with a similarity score less than a score_threshold by calling the .similarity_search_with_relevance_scores() method instead of .similarity_search().
This feature is not implementend in the MultiVectorRetriever class.
Proposal (If applicable)
In the _get_relevant_documents method of MultiVectorRetriever
Proposal for a new feature below by @baptiste-pasquier
Checked
Feature request
Add the ability to filter out documents with a similarity score less than a score_threshold in the
MultiVectorRetriever
.Motivation
The
VectorStoreRetriever
base class has a"similarity_score_threshold"
option forsearch_type
, which adds the ability to filter out any documents with a similarity score less than a score_threshold by calling the.similarity_search_with_relevance_scores()
method instead of.similarity_search()
.This feature is not implementend in the
MultiVectorRetriever
class.Proposal (If applicable)
In the
_get_relevant_documents
method ofMultiVectorRetriever
Replace :
https://github.com/langchain-ai/langchain/blob/b20c2640dac79551685b8aba095ebc6125df928c/libs/langchain/langchain/retrievers/multi_vector.py#L63-L68
With :
As in the
VectorStoreRetriever
base class :https://github.com/langchain-ai/langchain/blob/b20c2640dac79551685b8aba095ebc6125df928c/libs/core/langchain_core/vectorstores.py#L673-L687
Originally posted by @baptiste-pasquier in https://github.com/langchain-ai/langchain/discussions/19404