0

My objective is to do keyword filtering in Chroma. I have a field called keywords with a list of strings and I want to filter with it, but chroma won't let me add lists as a field.

I checked my Chroma version and I have 1.1.0, which in theory accepts lists. Keywords contains exactly that. When I try to add a keyword list it tells me "Failed to add document: Expected metadata value to be a str, int, float, bool, SparseVector, or None, got ['yacht', 'meeting', 'design', 'fluid'] which is a list in add."

Has anyone experienced this? I tried uninstalling chromadb and chroma (which I had previously installed by accident) and just starting fresh with the latest version. I also checked the imports and I am using the correct version everywhere.

Also, coindicentally, the operator "$contains" isn't working either, which could potentially be used to filter without using lists, so I can't go anywhere with this.

If anyone knows a good way of doing metadata filtering without using a list or $contains, I'd appreciate. I'm using conda for the environment, if there's a way to check for chroma "scraps" or something that might be messing up my version that would help as well.

Have a good day!

1
  • Please provide enough code so others can better understand or reproduce the problem. Commented Sep 23 at 11:05

1 Answer 1

0

In the newer versions Chroma doesn't accept lists anymore. To bypass this I'm adding the keywords to my document and using where_document $contains to retrieve them. Doesn't work as well but it's better than nothing

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.