-
Notifications
You must be signed in to change notification settings - Fork 721
feat: fs-cache #1645
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
base: dev
Are you sure you want to change the base?
feat: fs-cache #1645
Conversation
Please make sure all the checkboxes are checked:
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Looks like redislite has issues with win 32 |
|
@daukadolt do you need a review of this one? |
|
Only distributed cognee is failing due to poetry.lock |
|
I tested it. Problems I found: Also I think it would be a good idea to cover this adapter with the Conversation sessions tests so we test both Redis and fs behavior. |
|
Just validated it works with kuzu multiprocessing test. I'll make a copy of the test for FS caching |
|
I fixed the two redis tests. Tested sessions they don't work now. |
| data_root_directory = storage_config["data_root_directory"] | ||
| cache_directory = os.path.join(data_root_directory, ".cognee_fs_cache", lock_key) | ||
|
|
||
| os.makedirs(cache_directory, exist_ok=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this to always be in the local filesystem?
|
|
||
| self.lock.release() | ||
|
|
||
| async def add_qa( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have this in redis adapter as well?
|
|
||
|
|
||
| def test_can_release_lock(): | ||
| cache = FSCacheAdapter(timeout=5, blocking_timeout=10, lock_key="test_release") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is the same as previous.
| def test_releasing_non_acquired_lock(): | ||
| try: | ||
| cache = FSCacheAdapter(timeout=5, blocking_timeout=10, lock_key="test_non_acquired") | ||
| cache.acquire_lock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We acquire it, how is it non acquired?
| @pytest.mark.asyncio | ||
| async def test_closing_connection(): | ||
| cache = FSCacheAdapter(timeout=1, blocking_timeout=10, lock_key="test_closing") | ||
| await cache.close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we call cache.cache.close() above and cache.close() here?
Description
This PR implements filesystem-based cache for cognee short-term memory (#1545)
Type of Change
Screenshots/Videos (if applicable)
Pre-submission Checklist
DCO Affirmation
I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.