Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kwargs chain is broken in PGVector's search methods #133

Open
Voileexperiments opened this issue Oct 28, 2024 · 0 comments
Open

kwargs chain is broken in PGVector's search methods #133

Voileexperiments opened this issue Oct 28, 2024 · 0 comments

Comments

@Voileexperiments
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant