Open MarkintoshZ opened 7 months ago
@MarkintoshZ, we already have this kind of feature. Check these locations in the codebase:
https://github.com/chroma-core/chroma/blob/e5ec1b39171f62db4efe549207e488bbbdb9a12c/chromadb/config.py#L143-L144 (configuration)
https://github.com/chroma-core/chroma/blob/e5ec1b39171f62db4efe549207e488bbbdb9a12c/chromadb/segment/impl/manager/cache/cache.py#L47 (LRU cache implementation).
Let me know if you need any more help in running this.
Describe the problem
In some situations, developers don't know how long the embedding collections need to persist in the database and would use ChromaDB as a cache. Manually deleting collections when the memory fills up becomes cumbersome and error-prone.
Describe the proposed solution
I would like to see the implementation of a time-to-live feature or a data eviction strategy within ChromaDB. This would automatically remove collections based on specified criteria, such as their age or a predefined expiration time.
Alternatives considered
Other solutions could involve periodically removing old data or implementing manual data pruning logic. However, these alternatives are less efficient and incur more overhead.
Importance
would make my life easier
Additional Information
No response