Skip to content

feat: Introduce Plugin System for Extensible Memory Processing #1534

@CaralHsi

Description

@CaralHsi

Pre-submission checklist | 提交前检查

  • I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
  • I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
  • This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题

Problem Statement | 问题陈述

As MemOS evolves, more and more optional capabilities are being added around memory ingestion, retrieval, and feedback (e.g., NLI-based relation judgment, memory versioning, custom post-processing pipelines). Embedding all of these directly into the core codebase leads to tight coupling, heavier dependencies, and makes it difficult for users to selectively enable only the features they need.

We need a lightweight plugin architecture that allows extra functionality to be developed, distributed, and activated independently — without modifying core MemOS code.

Proposal
Introduce a hook-based plugin framework with the following design goals:

Pluggable extras — Features like NLI relation judgment and memory history management can be packaged as standalone plugins, installed via pip and discovered automatically through importlib.metadata entry points.
Clean extension points — A @hookable decorator and hook registry (trigger_hook / trigger_single_hook) allow plugins to tap into key lifecycle events (add, search, feedback, mem_reader) without patching core code.
Minimal core footprint — The core framework (src/memos/plugins/) is intentionally small (~5 modules). It provides base classes, hook definitions, and a plugin manager — nothing else. All business logic lives in plugins.
Backward compatibility — When no plugins are installed, MemOS behaves exactly as before. Hooks with no registered callbacks are silently skipped (for multi-provider hooks) or raise clear errors (for single-provider hooks), making missing plugins immediately obvious during development.
Scope
New src/memos/plugins/ package (base class, hook registry, plugin manager, component bootstrap)
Integration points in server_api.py, component_init.py, scheduler initialization
memory_version_switch config field for opt-in memory versioning pipeline
Migration of NLI client and memory history manager out of core into plugin-managed components
Plugin test suite (tests/plugins/)

Willingness to Implement | 实现意愿

  • I'm willing to implement this myself | 我愿意自己解决
  • I would like someone else to implement this | 我希望其他人来解决

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestpendingPending items to be addressed | 待解决事项。

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions