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

Enhance Caching System and Optimize Memory Usage with Customizable Storage Support #1016

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

AlboCode
Copy link
Contributor

Description

Add a caching system and optimize memory usage by removing stray_cats from the app state and storing the working memory in the cache.

Related to issue #846

Next, I would like to add a hook to customize the cache initialization, allowing to integrate the preferred storage, such as Redis, through a plugin.
I'm still unsure how to make the TTL of the working_memory customizable. Open to suggestions.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@pieroit
Copy link
Member

pieroit commented Jan 25, 2025

Thanks @AlboCode this is an important feat.
Will review asap!

@pieroit pieroit changed the base branch from main to develop February 5, 2025 18:18
@pieroit pieroit merged commit 2dd3ac1 into cheshire-cat-ai:develop Feb 6, 2025
1 of 2 checks passed
@pieroit
Copy link
Member

pieroit commented Feb 6, 2025

@AlboCode great contribution thanks.
I adapted the naming to convention we have around in core and fixed the stray flow a little more.

Unfortunately there are mismatches between HTTP and WS strays in working memory, need to investigate a little more and write many tests.

Hopefully this is a step more to make the Cat stateless :D
Let me know when you are around for a little chat, I'd like to show you some cetriolis

If not I'll write them down in issues, I'm cooked

@AlboCode
Copy link
Contributor Author

AlboCode commented Feb 6, 2025

@pieroit Would be great to have a chat, unfortunately my time shift doesn't help 🥲
I'm online when in Italy is 1:00 AM until 2:00 PM

@pieroit
Copy link
Member

pieroit commented Feb 7, 2025

@pieroit Would be great to have a chat, unfortunately my time shift doesn't help 🥲 I'm online when in Italy is 1:00 AM until 2:00 PM

available tonight

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