Skip to content

Conversation

@xprojects-de
Copy link

Q A
Bug fix? no
New feature? no
Docs? no
Issues
License MIT

To work properly with embeddings, the text context is also needed, otherwise LLM won't get the overall context. Therefore, it's possible to query the text context from the database too.

@carsonbot carsonbot changed the title fix chromadb store adding documents for text context fix chromadb store adding documents for text context Nov 27, 2025
@xprojects-de xprojects-de changed the title fix chromadb store adding documents for text context [Store] ChromaDb - add documents for text context Nov 27, 2025
@OskarStark OskarStark changed the title [Store] ChromaDb - add documents for text context [Store][ChromaDB] Add documents for text context Nov 28, 2025
@chr-hertel chr-hertel added the Store Issues & PRs about the AI Store component label Nov 28, 2025

/**
* @param array{where?: array<string, string>, whereDocument?: array<string, mixed>} $options
* @param array{where?: array<string, string>, whereDocument?: array<string, mixed>, include?: array<string>} $options
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which expectations do we have here for the include option?

if i just want embeddings, metadatas and distances - how would i enable that?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't want to specify anything, simply leave it out. Then the default from the ChromaDB extension will be used. That's how it was before. However, as soon as something is passed by the user, we should ensure that at least the metadata and embeddings are included, which the array merge does (maybe we can remove distance)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't want to specify anything, simply leave it out.

yup, got that, that's good 👍

i understand that we basically treat ['embeddings', 'metadatas', 'distances'] as the default here, right?
what would i need to do, to enable that default? i'm questioning if that even works with that current implementation. adding a test here would be great

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing the code and for the comments.

I've added some tests.
The default $include = null should work since CodeWithKyrian/chromadb-php has the correct default (see link).

https://github.com/CodeWithKyrian/chromadb-php/blob/3bf9f8db6ebfbd805774fa81176f5029afab0371/src/Resources/CollectionResource.php#L279

However, we can also define our own default if you like...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Reviewed Store Issues & PRs about the AI Store component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants