Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements Redis support for caching along with related infrastructure updates, including documentation and Docker configuration. Key changes include:
- Added a RedisManager for connection pooling and client management.
- Updated the RetrosynthesisCache to support both in-memory and Redis backends.
- Enhanced type annotations in the MainAgent and updated Docker and configuration files.
Reviewed Changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/reagentai/common/utils/redis.py | Introduces Redis connection management using a pool. |
| src/reagentai/common/utils/cache.py | Integrates Redis caching with an in-memory fallback. |
| src/reagentai/agents/main/main_agent.py | Updates to type annotations and client configuration. |
| pyproject.toml | Adds redis dependency. |
| docker-compose.yml | Adds Redis container and configuration. |
| README.md | Updates deployment command. |
| .env.example | Adds Redis password variable. |
Comments suppressed due to low confidence (2)
src/reagentai/common/utils/cache.py:56
- Consider normalizing the target_smile key (e.g., using target_smile.strip().lower()) when adding to the memory cache to ensure consistency with the Redis cache key generation.
cls._memory_cache[target_smile] = data
src/reagentai/common/utils/cache.py:34
- Add a @classmethod decorator to _deserialize_data to ensure consistent method behavior and usage within the class.
def _deserialize_data(cls, data: bytes) -> RouteCollection:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement Redis support for caching, which will enable easier caching in the future.