Files
mai-bot/docs/a_memorix_sync.md
A-Dawn 15d436b3a1 refactor: 将 A_Memorix 重构为主线长期记忆子系统并重建管理界面
- 将 A_Memorix 从旧 submodule / 插件形态迁入主线源码,主体落到 src/A_memorix
- 调整主程序接入方式,使 A_Memorix 作为源码内长期记忆子系统运行
- 回收父项目插件体系中针对 A_Memorix 的特判,减少对 plugin 通用层的侵入
- 将长期记忆配置、运行时、自检、导入、调优等能力收口到 memory 路由与主线服务层
- 重做长期记忆控制台与图谱页面,按 MaiBot 现有 dashboard 风格接入
- 补充实体关系图与证据视图双视图能力,支持查看节点、关系、段落及其证据链路
- 新增长期记忆配置编辑器与 memory-api,支持主线内配置管理
- 补齐删除管理能力:删除预览、混合删除、来源批量删除、删除操作恢复
- 优化删除预览与删除操作详情的前端展示,支持分页、检索,并以实体名/关系内容/段落摘要替代单纯 hash 展示
- 修复图谱与控制台相关前端问题,包括证据视图切换、查询触发时机、删除弹层空值保护等
- 新增或更新 A_Memorix 相关测试、WebUI 路由测试、前端 vitest 测试与辅助验证脚本
- 移除旧 plugins/A_memorix、.gitmodules 及相关历史维护文档
2026-04-03 08:08:24 +08:00

1.2 KiB

A_Memorix 同步说明

当前约定

  • A_Memorix 主线源码位于 src/A_memorix
  • 宿主接入层位于 src/services/memory_service.pysrc/webui/routers/memory.py 与 dashboard 长期记忆页面
  • 运行配置位于 config/a_memorix.toml
  • 运行数据位于 data/plugins/a-dawn.a-memorix/
  • 上游同步方式固定为 git subtree

首次接入

./scripts/sync_a_memorix_subtree.sh add

默认同步源:

  • 远端:https://github.com/A-Dawn/A_memorix.git
  • 分支:MaiBot_branch
  • 前缀:src/A_memorix

后续更新

./scripts/sync_a_memorix_subtree.sh pull

等价命令:

git subtree pull --prefix=src/A_memorix https://github.com/A-Dawn/A_memorix.git MaiBot_branch --squash

本地修改边界

  • src/A_memorix 只保留上游源码和必须的宿主兼容补丁
  • 宿主接入、配置暴露、图谱页与控制台页优先放在 MaiBot 侧 host service / memory router / dashboard 页面中
  • 不再通过插件框架特判承载 A_Memorix

同步后检查

  1. 确认 config/a_memorix.toml 仍指向 data/plugins/a-dawn.a-memorix
  2. 运行 python src/A_memorix/scripts/runtime_self_check.py --help
  3. 运行 A_memorix 相关测试或最少执行一次针对性导入验证