Skip to content
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

[Feature Request]: Collection Eviction Strategy or TTL Support #2042

Open
MarkintoshZ opened this issue Apr 23, 2024 · 1 comment
Open

[Feature Request]: Collection Eviction Strategy or TTL Support #2042

MarkintoshZ opened this issue Apr 23, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@MarkintoshZ
Copy link

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

@MarkintoshZ MarkintoshZ added the enhancement New feature or request label Apr 23, 2024
@tazarov
Copy link
Contributor

tazarov commented Apr 23, 2024

@MarkintoshZ, we already have this kind of feature. Check these locations in the codebase:

chroma/chromadb/config.py

Lines 143 to 144 in e5ec1b3

chroma_memory_limit_bytes: int = 0
chroma_segment_cache_policy: Optional[str] = None
(configuration)

class SegmentLRUCache(BasicCache):
(LRU cache implementation).

Let me know if you need any more help in running this.

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

No branches or pull requests

2 participants