用途:将已有的 mem0 导出文件或其它来源的记忆导入当前项目,便于迁移、备份恢复或从其它 AI 工具切换过来。
主要能力:1) 导入 mem0 导出文件:若提供 /mem0:import <filename> 则用该文件,否则列出当前目录含 mem0-export 的 .md 文件供选择;用 python3 "<PLUGIN_ROOT>/scripts/parse_export_file.py" "<文件>" 解析为 JSON,记录含 id、type、confidence、branch、files、categories、content。2) 导入其它 AI 工具配置:加 --tools 后检测 .cursorrules、.github/copilot-instructions.md、memory-bank/、.continue/rules.md,确认后用 python3 "<PLUGIN_ROOT>/scripts/import_competing_tools.py" <tool> --path <file> 导入,工具名 cursorrules、copilot、cline、continue。3) 导入 Claude Code 原生 MEMORY.md:按非空行拆分,每行一条记忆,跳过短于 20 字符或纯标题行。
使用方式:先确定 plugin root(Claude Code 为 ${CLAUDE_PLUGIN_ROOT},Codex 为 ${CODEX_PLUGIN_ROOT},Cursor 为 ${CURSOR_PLUGIN_ROOT});身份取自 MEM0_USER_ID(否则 $USER,再否则 default)与 MEM0_PROJECT_ID。每条记录调用 add_memory,infer=False,metadata.source 标记来源(import、<tool>-import、memory-md-import)。原 id 不传入,由平台分配新 id;单条失败继续导入并统计成功数;结果打印 Imported N memories into project <project_id>。
限制:解析脚本缺失时停止;脚本失败或输出 [] 时报错停止;连续失败(如认证错误)提前终止。其它工具导入时会跳过不足 50 字符的 section、截断超 1 万字符的 chunk,可安全重复运行。使用 MEMORY.md 后建议在 ~/.claude/settings.json 设 "autoMemoryEnabled": false 避免重复记忆系统。资料未说明收费与平台支持细节。