Skip to content

Conversation

stenwire
Copy link

@stenwire stenwire commented Aug 10, 2025

feat: Add Redis caching for performance for issue #26

This commit introduces Redis caching to improve the application's performance by caching frequently accessed data.

Key changes include:

  • A new RedisService to handle all Redis-related operations, including getting/setting data, clearing the cache, and retrieving statistics.
  • Integration of the RedisService into the APIConfAgent, csv_schedule_tools, and web_scraping_service.
  • Caching of agent responses in the APIConfAgent.chat method.
  • Caching of the conference schedule data in the _load_csv_data function.
  • Replacement of the file-based cache in the web_scraping_service with Redis.
  • Implementation of time-based (TTL) and manual cache invalidation.
  • A new protected endpoint for monitoring cache metrics.
  • Addition of fakeredis and pytest-mock for testing.
  • Unit tests for the RedisService and RedisRouter logic.

Some nice-to-haves additions in this PR:

  • Makefile to centralize commands, for reference.
  • Docker redis service if not running locally
  • Added Volumes for:
  ./app:/app/app
  ./tests:/app/tests
  ./scripts:/app/scripts
  ./main.py:/app/main.py
  ./pyproject.toml:/app/pyproject.toml
  ./poetry.lock:/app/poetry.lock

So that changes accross those folders would reflect on the docker container.

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.

1 participant