Skip to content

Conversation

@CaralHsi
Copy link
Collaborator

@CaralHsi CaralHsi commented Oct 20, 2025

Description

This PR introduces an asynchronous memory add pipeline for TreeTextMemory, leveraging the MemScheduler module to handle deferred memory reading, refreshing, and organizing tasks.
The update refactors the add() workflow in mem_os/core.py, enabling fast concurrent ingestion of textual memories, and delegates heavy operations (e.g., semantic parsing, tree reorganization) to background schedulers.

Summary

  • Added mode field (sync / async) in TreeTextMemoryConfig
  • Integrated async add logic in MOSCore.add()
  • Enhanced MemScheduler with new task types: MEM_READ, MEM_ORGANIZE, and async refresh
  • Introduced dual-mode memory reader (fast / fine) for lightweight async parsing
  • Improved concurrency, token-based window splitting, and error handling in SimpleStructMemReader
  • Optimized NebulaGraphDB delete logic and added basic property index creation
  • Added async-compatible memory organization in tree_text_memory.organize.manager

Fix: #(issue)

Docs Issue/PR: (docs-issue-or-pr-link)

Reviewer: @(reviewer)

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 created related documentation issue/PR in MemOS-Docs (if applicable) | 我已在 MemOS-Docs 中创建了相关的文档 issue/PR(如果适用)
  • 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 changed the title feat: async add feat: introduce async memory add for TreeTextMemory using MemScheduler Oct 23, 2025
@CaralHsi CaralHsi marked this pull request as ready for review October 23, 2025 03:13
@CaralHsi CaralHsi requested review from fridayL and tangg555 October 23, 2025 03:13
Copy link
Collaborator

@tangg555 tangg555 left a comment

Choose a reason for hiding this comment

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

looks good to me

@CaralHsi CaralHsi merged commit b5ea7e6 into MemTensor:dev Oct 23, 2025
39 of 40 checks passed
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