Skip to content

feat(example): add MOSProduct multi-user locomo example with shared Neo4j database - #109

Merged
CaralHsi merged 10 commits into
MemTensor:devfrom
CaralHsi:feat/mos_locomo_example_for_shared_database
Jul 21, 2025
Merged

feat(example): add MOSProduct multi-user locomo example with shared Neo4j database#109
CaralHsi merged 10 commits into
MemTensor:devfrom
CaralHsi:feat/mos_locomo_example_for_shared_database

Conversation

@CaralHsi

@CaralHsi CaralHsi commented Jul 16, 2025

Copy link
Copy Markdown
Collaborator

Description

Summary:

  • Added a new example locomo_shared_database_memos.py under examples/mem_os/
  • Demonstrates how to use MOSProduct to manage multiple users in locomo
  • Both users share the same Neo4j database with isolated user_id and cube_id namespaces
  • Conversation messages are processed with dual-perspective role mapping (user ↔ assistant)
  • Uses SimpleStructMemReader with chunker + universal embedder for flexible LLM + embedding workflow
  • Includes clear logging for each session and message for easier debugging

Reviewer: @fridayL

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 requested a review from fridayL July 16, 2025 15:07
@CaralHsi
CaralHsi changed the base branch from main to dev July 16, 2025 15:07
@CaralHsi CaralHsi changed the title Feat/mos locomo example for shared database feat(example): add MOSProduct multi-user locomo example with shared Neo4j databas Jul 16, 2025
@CaralHsi CaralHsi changed the title feat(example): add MOSProduct multi-user locomo example with shared Neo4j databas feat(example): add MOSProduct multi-user locomo example with shared Neo4j database Jul 16, 2025
@CaralHsi
CaralHsi marked this pull request as ready for review July 16, 2025 15:10

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

mos_product.add(user_id=users[speaker_a]["user_id"], messages=role1_msgs)
mos_product.add(user_id=users[speaker_b]["user_id"], messages=role2_msgs)

this code doesn't seem to cause errors, but For multi-user operations on diff cubes, it's better to input cube ID :
mos_product.add(user_id=users[speaker_a]["user_id"], messages=role1_msgs, mem_cube_id=users[speaker_a]["default_cube_id"])

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Okkk, I see. Will update soon.

@CaralHsi
CaralHsi marked this pull request as draft July 17, 2025 13:05
@CaralHsi
CaralHsi requested a review from J1awei-Yang July 17, 2025 13:05
@CaralHsi

Copy link
Copy Markdown
Collaborator Author

@J1awei-Yang Please fix 'never close' issue for this.

@CaralHsi
CaralHsi marked this pull request as ready for review July 21, 2025 09:23
@CaralHsi
CaralHsi merged commit 01797eb into MemTensor:dev Jul 21, 2025
20 checks passed
tianxing02 pushed a commit to tianxing02/MemOS that referenced this pull request Feb 24, 2026
…eo4j database (MemTensor#109)

* feat: add share-db multi user mode locomo showcase

* fix: turn on reorganize

* fix: try to fix 'never clsoe' issue, try-1

* fix: try to fix 'never clsoe' issue, try-2

* fix: mos_product.add in example

---------

Co-authored-by: jiawei yang <103758578+J1awei-Yang@users.noreply.github.com>
Co-authored-by: dany <973031439@qq.com>
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