Skip to content

Conversation

@CaralHsi
Copy link
Collaborator

@CaralHsi CaralHsi commented Jul 11, 2025

Description

Summary:

Add Shared Database Multi-Tenant Mode to the Neo4j graph store implementation and provide end-to-end working examples for both:

  • Dedicated DB Mode (use_multi_db = True)
  • Shared DB Mode (use_multi_db = False with user_name)

Highlights:

  • Added user_name field for logical tenant separation when using a single database.
  • All CRUD and query operations now enforce user_name filters for strict isolation.
  • Automatic B-tree index for user_name to maintain query performance.
  • Added practical working examples:
    examples/basic_modules/neo4j_example.py
    example_multi_db — shows per-tenant data in separate databases with automatic creation.
    example_shared_db — demonstrates multiple users sharing a single DB with logical separation.
    use_multi_db tree config: examples/data/config/tree_config_shared_database.json

Fix: #79

Reviewer: @J1awei-Yang

Checklist:

  • I have performed a self-review of my own code | 我已自行检查了自己的代码
  • I have commented my code in hard-to-understand areas | 我已在难以理解的地方对代码进行了注释
  • I have added tests that prove my fix is effective or that my feature works | 我已添加测试以证明我的修复有效或功能正常
  • I have added necessary documentation (if applicable) | 我已添加必要的文档(如果适用)
  • I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用)
  • I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人

@CaralHsi CaralHsi marked this pull request as ready for review July 15, 2025 06:57
@CaralHsi CaralHsi requested a review from J1awei-Yang July 15, 2025 06:57
Copy link
Collaborator

@J1awei-Yang J1awei-Yang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

waiting for adding user_name field in config

@CaralHsi
Copy link
Collaborator Author

waiting for adding user_name field in config

done ^_^

@J1awei-Yang J1awei-Yang merged commit 339c756 into MemTensor:dev Jul 15, 2025
16 checks passed
@Gaojianli
Copy link
Contributor

没有太看懂这个怎么使用,感觉一般不会直接使用graph,都是使用memos。使用memos的情况下怎么给每个用户修改graph的config呢?有没有example

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.

3 participants