Skip to content

feat: introduce async memory add for TreeTextMemory using MemScheduler#373

Merged
CaralHsi merged 29 commits intoMemTensor:devfrom
CaralHsi:feat/Async-add
Oct 23, 2025
Merged

feat: introduce async memory add for TreeTextMemory using MemScheduler#373
CaralHsi merged 29 commits intoMemTensor:devfrom
CaralHsi:feat/Async-add

Conversation

@CaralHsi
Copy link
Copy Markdown
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
Copy Markdown
Contributor

@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
tianxing02 pushed a commit to tianxing02/MemOS that referenced this pull request Feb 24, 2026
MemTensor#373)

* feat: define mem-read schedular message&consumer; add async mem-reader mode in core;

* feat: add fast/fine mode in mem-reader;

* feat: add mem-reader in scheduler

* feat: change async remove

* feat: modify async-add in core.py

* feat: add 'remove and refresh memory in schedular'

* feat: add naive fast mode in mem-reader

* feat: finish fast mode in mem-reader

* feat: add token-based window splitting and concurrency improvements

* feat: add split chunker into  mode in simple struct mem reader

* feat: update async-mode add

* chore: update gitignore

* feat: improve database note write performance

* feat: fix mem-read scheduler

* fix: nebula group-by bug

* fix: bug in adding mem scheduler

* fix: nebula index; mem-reader chat-time;

* format: searcher

* fix: some bug in shceduler and mem-reader

* feat: add mem-organize in scheduler

* feat: add tree.mode to config; modify scheduler config

* fix: test bug
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