feat: Add RyuGraph support with full backwards compatibility for Kuzu #3719
+2,108
−337
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
This PR adds RyuGraph as the new graph store provider while maintaining complete backwards compatibility with existing Kuzu configurations.
Background: Kuzu has been archived and is no longer maintained. RyuGraph is a community-maintained fork of Kuzu with an identical API, ensuring ongoing support and updates.
Key Changes:
ryu_memory.pyas native RyuGraph implementationkuzu_memory.pyto use RyuGraph internally (backwards compatibility wrapper)kuzu>=0.11.0toryugraph>=25.9.0Backwards Compatibility:
provider: "kuzu"continues to work without modificationType of change
How Has This Been Tested?
Test Results:
pytest tests/memory/test_kuzu.py tests/memory/test_ryu.py -v # ======================== 10 passed, 5 warnings in 0.55s ========================All tests pass successfully:
Test Coverage:
Checklist:
Documentation Updates
docs/changelog.mdx- Added v1.0.1 entry emphasizing backwards compatibilitydocs/open-source/features/graph-memory.mdx- Added both Kuzu (deprecated) and RyuGraph sectionsdocs/platform/features/graph-threshold.mdx- Listed both providersexamples/graph-db-demo/kuzu-example.ipynbwith deprecation noticeexamples/graph-db-demo/ryu-example.ipynbfor new usersLLM.mdandMakefilereferencesFiles Changed
New Files:
mem0/memory/ryu_memory.py- Native RyuGraph implementationtests/memory/test_ryu.py- Test suite for RyuGraphexamples/graph-db-demo/ryu-example.ipynb- Example notebook for RyuGraphtools/migrate_kuzu_to_ryu.py- Optional migration scriptModified Files:
mem0/memory/kuzu_memory.py- Wrapper using RyuGraph internallymem0/utils/factory.py- Supports both "kuzu" and "ryu" providersmem0/graphs/configs.py- Keeps both KuzuConfig and RyuConfigtests/memory/test_kuzu.py- Backwards compatibility testsexamples/graph-db-demo/kuzu-example.ipynb- Added deprecation noticepyproject.toml- Updated dependency to ryugraph>=25.9.0Makefile- Updated install_all targetMigration Guide for Users
For existing Kuzu users:
provider: "kuzu"toprovider: "ryu"at your convenienceFor new users:
provider: "ryu"in your configurationpip install "mem0ai[graph]"Why this change?
Maintainer Checklist