Skip to content

Conversation

@janumiko
Copy link
Owner

Implement Redis support for caching, which will enable easier caching in the future.

  • Update Readme
  • Create docker-compose with both redis and the app containers
  • Chore files with example config etc.

@janumiko janumiko requested a review from Copilot June 27, 2025 22:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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:

Copy link
Collaborator

@Kowalski1024 Kowalski1024 left a comment

Choose a reason for hiding this comment

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

LGTM

@janumiko janumiko merged commit 8b4966a into main Jul 7, 2025
1 check passed
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