langchain
langchain copied to clipboard
Adds 'IN' metadata filter for pgvector for checking set presence
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
nice! could we add a simple integration test?
Added an integration test!
ready for merge, maintain needs to resolve linting issues
https://github.com/hwchase17/langchain/pull/4982 with lint fixes
landed #4982 !
@jadespanning please add this to docs