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

Adds 'IN' metadata filter for pgvector for checking set presence #4982

Merged
merged 5 commits into from
May 19, 2023

Conversation

eyurtsev
Copy link
Collaborator

Adds "IN" metadata filter for pgvector to all checking for set presence

PGVector currently supports metadata filters of the form:

{"filter": {"key": "value"}}

which will return documents where the "key" metadata field is equal to "value".

This PR adds support for metadata filters of the form:

{"filter": {"key": { "IN" : ["list", "of", "values"]}}}

Other vector stores support this via an "$in" syntax. I chose to use "IN" to match postgres' syntax, though happy to switch.
Tested locally with PGVector and ChatVectorDBChain.

@dev2049

@dev2049
Copy link
Contributor

dev2049 commented May 19, 2023

thanks @jadespanning!

@dev2049 dev2049 merged commit 0ff5956 into master May 19, 2023
12 checks passed
@dev2049 dev2049 deleted the eugene/pgvector_in branch May 19, 2023 20:53
@danielchalef danielchalef mentioned this pull request Jun 5, 2023
This was referenced Jun 25, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants