langchain icon indicating copy to clipboard operation
langchain copied to clipboard

ChromaDB does not support filtering when using ```similarity_search``` or ```similarity_search_by_vector```

Open StephaneBereux opened this issue 1 year ago • 1 comments

Whereas it should be possible to filter by metadata :

  • langchain.vectorstores.chroma.similarity_search takes a filter input parameter but do not forward it to langchain.vectorstores.chroma.similarity_search_with_score
  • langchain.vectorstores.chroma.similarity_search_by_vector don't take this parameter in input, although it could be very useful, without any additional complexity - and it would thus be coherent with the syntax of the two other functions

StephaneBereux avatar Mar 12 '23 23:03 StephaneBereux

Feel free to close my duplicate fix or incorporate the unit tests from that branch into the original fix PR.

In either case, any idea when this might make it into a release? The ability to search over a subset of documents in a Chroma store will be monumentally easier than maintaining many different stores for different search spaces.

ejdb00 avatar Mar 21 '23 22:03 ejdb00

Hello, do we now have the ability to search in chroma over a subset of docs? i.e. we want to allow user to select multiple docs and pass that back to the 'filter' to force retriever to only get answers from those docs selected by user. saw another thread mentioned 'search_kwargs' being passed into a chain, but that seems to be quite old so not sure if it's still valid.

ItsJustSmellz avatar Jun 16 '23 23:06 ItsJustSmellz

Hi, @StephaneBereux! I'm Dosu, and I'm here to help the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, you opened an issue stating that ChromaDB does not currently support filtering when using the similarity_search or similarity_search_by_vector functions. There has been some discussion in the comments, with ejdb00 suggesting a fix and asking about a potential release date. ItsJustSmellz also commented, asking if there is now the ability to search in Chroma over a subset of documents.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself or it will be automatically closed in 7 days.

Thank you for your contribution to the LangChain repository!

dosubot[bot] avatar Sep 20 '23 16:09 dosubot[bot]