chroma icon indicating copy to clipboard operation
chroma copied to clipboard

[Feature Request]: Support lists in metadata

Open itaismith opened this issue 11 months ago • 20 comments

Describe the problem

This issue tracks the feature request to add support for storing and querying lists as values within Chroma's metadata fields. Currently, metadata fields are limited to single values (strings, integers, floats, booleans). This limitation hinders use cases that require associating multiple values with a single metadata key, such as tags, categories, or other multi-value attributes.

Related user issues:

  • #227
  • #936
  • #2487
  • #3153

Describe the proposed solution

  • Allow storing lists of primitive data types (strings, numbers, booleans) as values in metadata fields during document insertion or updates.
  • Provide query operators to efficiently filter documents based on list contents. This includes, at a minimum:
    • $contains (or similar): To check if a list field contains a specific value.
    • $in (or similar): To check if a list field contains any value from a given set.
    • Potentially other operators like $all (contains all values), $size (matches list size), etc., based on community needs and feasibility.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

itaismith avatar Jan 06 '25 19:01 itaismith

Is there are any in progress development for this solution? If not I could do it

ZumelzuR avatar Feb 14 '25 09:02 ZumelzuR

Yes! Supporting lists in metadata would significantly improve flexibility in handling multi-value attributes

ivandda avatar Feb 14 '25 13:02 ivandda

+1

Mohammadtvk avatar Feb 18 '25 09:02 Mohammadtvk

Are there any plans for adding lists to metadata?

dickreuter avatar Feb 28 '25 17:02 dickreuter

+1

robertobalestri avatar Mar 13 '25 18:03 robertobalestri

Has anyone had luck converting the values in a list to keys for metadata. That’s what I’m implementing to get around this. For example if I have a list ‘tags’ with values foo and bar, metadata would look like { other items… tags_foo: 1, tags_bar: 1 }, then my metadata filter for documents tagged foo would be { tags_foo: 1 }. It’s a bit cumbersome but I’m hoping it works well enough to get around this issue. If anyone has tried this or some other workaround I’d like to hear it.

rose-pace avatar Mar 13 '25 20:03 rose-pace

+1

Zast996 avatar May 02 '25 18:05 Zast996

+1

bnuzhouwei avatar May 07 '25 06:05 bnuzhouwei

Yeah it is quite needed! Hope developers respond to this.

MohammadAmmargk8497 avatar May 12 '25 05:05 MohammadAmmargk8497

+1

koponk04 avatar Jun 12 '25 05:06 koponk04

+1

SCantergiani avatar Jul 27 '25 16:07 SCantergiani

+1

qylbj2016 avatar Jul 30 '25 08:07 qylbj2016

+1

varna9000 avatar Aug 08 '25 05:08 varna9000

+1

MarcoChava avatar Aug 28 '25 19:08 MarcoChava

+1

AdriaGuilera avatar Sep 23 '25 08:09 AdriaGuilera

+1

namanjain27 avatar Sep 25 '25 01:09 namanjain27

+1 and dict as well

b3j0f avatar Oct 08 '25 17:10 b3j0f

+1

cassina avatar Oct 09 '25 14:10 cassina

+1

laotoutou avatar Oct 29 '25 19:10 laotoutou

+1

ma7555 avatar Nov 10 '25 12:11 ma7555

+1

armouti avatar Nov 19 '25 14:11 armouti

+1

tnorlund avatar Nov 27 '25 21:11 tnorlund

Any news about the $contains operator?

Salvatore-tech avatar Dec 01 '25 10:12 Salvatore-tech

+1

thewebscraping avatar Dec 07 '25 08:12 thewebscraping