chroma icon indicating copy to clipboard operation
chroma copied to clipboard

[Feature Request]: Switch to row-oriented dictionary for GetResult and QueryResult

Open HammadB opened this issue 2 years ago • 2 comments

Describe the problem

The return objects for GetResult and QueryResult are confusing to many users right now as they require you to match data up to your input ordering as well as internally in the result.

Describe the proposed solution

We should change GetResult and QueryResult to be row oriented dicts with id keys, or similar.

{"id" : {"embeddings", "distances", "metadata", "documents"}}

Alternatives considered

Sorting the results based on input ids. This doesn't always work (the case of ids and a where clause) and also doesn't solve all the problems

Importance

would make my life easier

Additional Information

No response

HammadB avatar Apr 24 '23 23:04 HammadB

What about a QueryResult and GetResult Object in Python. What about a QueryResult and GetResult Interface in Typescript.

"Skate to where the puck is going" On another note, as Chroma adds more features and complexity grows, simple objects intuitively fitting in a simple model will be the best approach to reduce complexity. Requires forward planning.

naynaly10 avatar Apr 29 '23 16:04 naynaly10

can confirm the column oriented query results are very disorienting.

if api compatibility is a concern, at least add documentation examples to mark it as column oriented, and add builtins to convert to row oriented

renxida avatar Oct 05 '23 20:10 renxida