Skip to content

feat: abstract CubeView to Add & Search Handler#498

Merged
CaralHsi merged 7 commits intoMemTensor:devfrom
CaralHsi:feat/knowledge_db
Nov 21, 2025
Merged

feat: abstract CubeView to Add & Search Handler#498
CaralHsi merged 7 commits intoMemTensor:devfrom
CaralHsi:feat/knowledge_db

Conversation

@CaralHsi
Copy link
Copy Markdown
Collaborator

@CaralHsi CaralHsi commented Nov 17, 2025

Description

Summary:

  1. 精简 AddHandler 主流程,只保留日志、参数整理(memory_content → messages)和统一入口,具体写入逻辑下沉到后续的 MemCubeView 等视图层。
    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).
  2. 移除 AddHandler 内部的 _process_text_mem / _process_pref_mem / _get_sync_mode / _schedule_memory_tasks 等底层实现,使 Handler 不再直接操作 naive_mem_cube 与调度队列。
    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.
  3. 保留并复用 _convert_content_messsage,继续支持仅传 memory_content 的调用路径,将其统一转换为标准 messages 结构。
    Kept and reused _convert_content_messsage to support the memory_content-only input path, consistently converting it into the standard messages format.
  4. 在保持对外接口与返回结构不变的前提下,瘦身 AddHandler 以提升可维护性和可测试性,为后续引入多 Cube 视图(Single/CompositeCubeView)打基础。
    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:

  • 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: abstract CubeView to Add Handler feat: abstract CubeView to Add & Search Handler Nov 21, 2025
@CaralHsi CaralHsi marked this pull request as ready for review November 21, 2025 10:50
@CaralHsi CaralHsi merged commit 1043377 into MemTensor:dev Nov 21, 2025
20 checks passed
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
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.

1 participant