Skip to content

feat(plugin): add ReMe integration skeleton for QwenPaw (towards #349) - #403

Open
RerankerGuo wants to merge 1 commit into
agentscope-ai:mainfrom
RerankerGuo:feat/qwenpaw-plugin-skeleton
Open

feat(plugin): add ReMe integration skeleton for QwenPaw (towards #349)#403
RerankerGuo wants to merge 1 commit into
agentscope-ai:mainfrom
RerankerGuo:feat/qwenpaw-plugin-skeleton

Conversation

@RerankerGuo

Copy link
Copy Markdown
Contributor

背景

QwenPaw 是 Qwen 系列助理,与 ReMe 集成后可获得持久、文件原生的长期记忆能力。Issue #349 提出了完整的 Python SDK 级集成需求,但该需求涉及 QwenPaw 内部调度器和会话管理器的深度耦合,实现成本高且需要分阶段推进。

本轮先交付 可安装的 QwenPaw 插件骨架,使 QwenPaw 用户当前就可以通过 ReMe MCP (HTTP) 接口完成 80% 的长期记忆能力(召回 + 自动持久化)。完整深度 SDK 集成留给后续 PR 或社区贡献者。

改动内容

plugins/qwenpaw/ 下新增一套与 plugins/claude_code 结构完全同构的 QwenPaw 插件骨架(共 5 个新文件 + 4 级目录):

  1. plugins/qwenpaw/README.md — 安装说明、前置条件(启动 ReMe MCP server)、目录结构、多用户隔离使用提示。
  2. plugins/qwenpaw/reme/.mcp.json — ReMe streamable-http MCP 配置,默认 http://127.0.0.1:2333/mcp,与其他插件保持一致。
  3. plugins/qwenpaw/reme/hooks/hooks.json — Stop Hook 注册,使用 QWENPAW_PLUGIN_ROOT 环境变量定位插件根目录。
  4. plugins/qwenpaw/reme/hooks/auto_memory.py — fire-and-forget 型 Stop Hook:
    • 从 stdin 读取 QwenPaw 插件框架下发的 conversation_id / session_id + profile_id
    • 通过 double-fork 守护进程化,立即返回主进程(避免阻塞 QwenPaw 退出)
    • 使用最小 streamable-http MCP 客户端(initialize → initialized → tools/call)调用 ReMe server 侧 auto_memory 工具
    • 最佳实践:ReMe 未启动或不可达只写日志不抛错;健康检查、检索、写入使用独立超时
  5. plugins/qwenpaw/reme/skills/reme-memory/SKILL.md — ReMe 记忆召回 SOP,覆盖 3 种召回模式(语义 search / 拓扑 traverse / 状态 daily_list+frontmatter_read),并补充 多用户/多 profile scoping 章节,显式说明如何利用 tags: [user:alice] frontmatter + tags search filter 实现 profile 隔离。

与 Issue #349 的关系

  • 本次交付 不声称关闭 feat(plugin): add ReMe integration for QwenPaw #349。PR 描述为 "towards feat(plugin): add ReMe integration for QwenPaw #349",因为以下在 Issue 中列出的项明确 未实现,留给后续:
    • 通过 Python SDK 深度嵌入到 QwenPaw 应用生命周期管理(当前走 MCP 协议层)
    • QwenPaw conversations/profiles 到 ReMe session/user 边界的 1:1 自动映射(当前在 SKILL.md 中给出了 frontmatter tags 实现范式,未写 SDK 级映射代码)
    • 自动 memory consolidation 与 proactive memory workflow 的 QwenPaw scheduler 集成(当前由 ReMe server 侧 dream/cron 驱动)
    • 完整 lifecycle 与 memory 单元测试套件

验证方式

  1. Pre-commit: ~/.pyenv/versions/3.12.12/bin/python -m pre_commit run --files <5 个新文件>全通过(check-json / add-trailing-comma / black / flake8 / pylint C0116 修复 / pyroma 共 12 个 hook)。
  2. Unit tests: ~/.pyenv/versions/3.12.12/bin/python -m pytest tests/unit -x -q858 passed,零回归。
  3. JSON 合法性独立验证: python3 -c "json.load(open('.mcp.json')); json.load(open('hooks.json'))" → OK。
  4. 手动冒烟(README 路径)
    • 执行 reme start service.backend=mcp service.transport=streamable-http 启动服务
    • 在 QwenPaw 侧 qwenpaw plugins add ./plugins/qwenpaw + qwenpaw plugins enable reme
    • 运行 /mcp 或等价命令,应能看到 reme server 已连接且 search/traverse/daily_list/read 工具可用

影响范围

  • 仅新增 5 个文件,零修改现有源代码。无 Breaking Change。
  • 与现有 3 个插件(claude_code / codex / openclaw)目录结构保持严格对齐,维护成本均匀。
  • 不影响 ReMe 核心运行逻辑。

Checklist

  • 单元测试全部通过 (858 passed)
  • Pre-commit hooks 全部通过 (12/12 hooks,含 check-json / add-trailing-comma / black / flake8 / pylint / pyroma)
  • README 写清前置条件、安装步骤、多用户 scoping 指南、故障排查入口
  • hooks.json 与 .mcp.json JSON 合法,无 trailing comma
  • 明确声明 "towards feat(plugin): add ReMe integration for QwenPaw #349",不做 SDK 级深度集成,避免过度承诺

…tscope-ai#349)

Introduces an installable plugin skeleton under plugins/qwenpaw/ so QwenPaw
users can connect to a running ReMe MCP server and get durable, file-native
long-term memory today without waiting for deeper Python-SDK-level
integration tracked in agentscope-ai#349.

Contents:
- README.md: prerequisites, install steps, directory layout, scoping notes
- .mcp.json: streamable-http MCP endpoint shared with sibling plugins
- hooks/hooks.json + hooks/auto_memory.py: fire-and-forget Stop hook that
  daemonizes via double-fork and calls server-side auto_memory over MCP,
  anchored on conversation_id and profile_id; best-effort logging only
- skills/reme-memory/SKILL.md: three-mode recall SOP (semantic/topological/
  state) plus a multi-profile scoping section showing tags-based isolation

Deliberately out of scope and left for follow-ups: deep Python-SDK embed,
QwenPaw scheduler-driven consolidation/proactive workflows, and full
lifecycle plus memory tests.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

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