Skip to content

After successfully adding chromaDB data, return the ID. #6666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lanbaoshen
Copy link
Contributor

@lanbaoshen lanbaoshen commented Jun 11, 2025

Why are these changes needed?

After creation, return the ID that can index the data, allowing direct data operations via the ID.

Related issue number

No related issue

Checks

After creation, return the ID that can index the data, allowing direct data operations via the ID.
@victordibia
Copy link
Collaborator

victordibia commented Jun 12, 2025

Thanks for the contribution.

Can you provide more details on the use case you are exploring? e.g, what are some examples of "direct data operations via the ID."

Note that the base Memory class does not have a return type, and adding a return type breaks the abstraction. (please see the readme here on how to run tests.)

We should only do this when the use case is clear.

@lanbaoshen
Copy link
Contributor Author

Thanks for the contribution.

Can you provide more details on the use case you are exploring? e.g, what are some examples of "direct data operations via the ID."

Note that the base Memory class does not have a return type, and adding a return type breaks the abstraction. (please see the readme here on how to run tests.)

We should only do this when the use case is clear.

Hi @victordibia , in my case, I want to implement a feature that automatically clears outdated memory data. For example, when I store data in ChromaDB, I will use the UUID and collection as keys in Redis and set a timeout. When Redis sends a keyevent expired message, I will directly delete the data in the collection using the UUID.

Instead of directly modifying the return type, perhaps introducing an optional parameter to allow users to customize IDs would be better?

Additionally, are there any plans to expand additional methods, such as upsert?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants