feat: abstract CubeView to Add & Search Handler#498
Merged
CaralHsi merged 7 commits intoMemTensor:devfrom Nov 21, 2025
Merged
Conversation
…ic into feat/knowledge_db
tianxing02
pushed a commit
to tianxing02/MemOS
that referenced
this pull request
Feb 24, 2026
* feat: abstract CubeView to Add Handler * feat: add readable and writable memcube-ids * feat: multi-cube search router
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Summary:
Simplified AddHandler.handle_add_memories to only handle logging, request normalization (memory_content → messages), and delegation, while moving actual write logic into cube view layers (e.g. MemCubeView).
Removed internal methods like _process_text_mem, _process_pref_mem, _get_sync_mode, and _schedule_memory_tasks from AddHandler, so the handler no longer directly manipulates naive_mem_cube or scheduling queues.
Kept and reused _convert_content_messsage to support the memory_content-only input path, consistently converting it into the standard messages format.
Preserved the external API behavior and response shape while slimming down AddHandler to improve maintainability and testability, paving the way for multi-cube view abstractions (e.g. SingleCubeView / CompositeCubeView).
Fix: #(issue)
Docs Issue/PR: (docs-issue-or-pr-link)
Reviewer: @(reviewer)
Checklist: