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
VectorStoreRetriever supports passing arbitrary parameters into the underlying VectorStore through search_kwargs. Similarly, base VectorStore methods pass kwargs through its inner methods; see this.
However, this is not done properly in the PGVector methods: similarity_search, similarity_search_with_score and max_marginal_relevance_search_with_score_by_vector breaks the kwargs chain, hence any additional named parameters are lost upon building the query.
As example, please look at similarity_search_with_score in base VectorStore and PGVector: the former pass kwargs into the inner method as expected, while the latter isn't.
This has important impacts as kwargs is typically used to pass additional params into inner methods to enable customizability. For example, if I want to customize a query to join other tables, I should be able to just inherit PGVector, override __query_collection and provide my custom query building logic. However, this would not be possible if kwargs is not passed through the search methods.
The text was updated successfully, but these errors were encountered:
VectorStoreRetriever
supports passing arbitrary parameters into the underlyingVectorStore
throughsearch_kwargs
. Similarly, baseVectorStore
methods passkwargs
through its inner methods; see this.However, this is not done properly in the
PGVector
methods:similarity_search
,similarity_search_with_score
andmax_marginal_relevance_search_with_score_by_vector
breaks thekwargs
chain, hence any additional named parameters are lost upon building the query.As example, please look at
similarity_search_with_score
in baseVectorStore
andPGVector
: the former passkwargs
into the inner method as expected, while the latter isn't.This has important impacts as
kwargs
is typically used to pass additional params into inner methods to enable customizability. For example, if I want to customize a query to join other tables, I should be able to just inheritPGVector
, override__query_collection
and provide my custom query building logic. However, this would not be possible ifkwargs
is not passed through the search methods.The text was updated successfully, but these errors were encountered: