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.
Description
Currently, creating multiple
[Async]Memoryinstances pointing to the same Kuzu DB file will raise an error (Could not set lock on file : /path/to/database/example.kuzu). This is due to limitations in the way that Kuzu handles file locking and concurrency - see Connections and Concurrency | Kuzu. Specifically, in order to use the same Kuzu DB file, connections need to use the samekuzu.Databaseobject. This PR ensures thatkuzu.Databaseobjects are reused when attempting to connect to the same.kuzuDB file.This allows multiple
[Async]Memoryinstances to point to the same Kuzu DB file without error and function as expected. (This is often the case in Jupyter notebooks and async code, for example.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Small change - tested accessing the same Kuzu DB file from two separate mem0
MemoryandAsyncMemoryinstances and validated that read/write operations to the same underlying Kuzu DB file works as expected. Previously an error related to file locking was raised when attempting to create the second mem0[Async]Memoryinstance pointing to the same Kuzu DB.Please delete options that are not relevant.
Checklist:
Maintainer Checklist