如何迁移现有AI项目到TencentDB Agent Memory完整数据迁移指南【免费下载链接】TencentDB-Agent-MemoryTencentDB Agent Memory is a team-level memory hub for AI Agents — turning conversations, docs, and code into four reusable memory assets (Chat Memory, Skill, LLM-Wiki, Code-Graph) that are governed, shared, and equipped across agents and frameworks.项目地址: https://gitcode.com/GitHub_Trending/te/TencentDB-Agent-MemoryTencentDB Agent Memory是AI Agent的团队级记忆中枢能将对话、文档和代码转化为四种可重用的记忆资产Chat Memory、Skill、LLM-Wiki、Code-Graph实现跨Agent和框架的治理、共享与赋能。本文将为你提供完整的数据迁移指南帮助你轻松将现有AI项目迁移到TencentDB Agent Memory。TencentDB Agent Memory的记忆层次结构在开始迁移前让我们先了解TencentDB Agent Memory的记忆层次结构。它采用了四层金字塔结构从下到上分别是L0 Raw Log全量保留原始对话与事件流确保原始信息不丢失提供证据兜底。L1 Atomic Memory自动提取事实、偏好、约束、状态从语音中稳定抽出关键信息。L2 Scene Block按项目/主题/工作流场景聚类带上文召回减少单场误用。L3 Persona稳定的用户偏好与服务方式画像让Agent按用户习惯协作。这个层次结构能够帮助AI Agent更好地组织和利用记忆提高协作效率和服务质量。迁移前的准备工作在进行数据迁移之前需要确保满足以下前置条件环境要求Node.js 22.16.0插件安装已通过openclaw plugins install安装TencentDB Agent Memory插件脚本编译迁移脚本需要先进行编译编译迁移脚本迁移脚本使用TypeScript编写位于项目的scripts/migrate-sqlite-to-tcvdb/目录下。编译命令如下npm run build:migrate-sqlite-to-vdb编译产物将输出到scripts/migrate-sqlite-to-tcvdb/dist/目录可直接用Node运行。数据迁移的完整步骤1. 克隆项目仓库首先需要克隆TencentDB Agent Memory项目仓库到本地git clone https://gitcode.com/GitHub_Trending/te/TencentDB-Agent-Memory2. 进入项目目录并安装依赖cd TencentDB-Agent-Memory npm install3. 执行迁移命令TencentDB Agent Memory提供了灵活的迁移命令支持多种场景和参数配置。以下是一些常用的迁移命令示例预检模式仅查看源数据不执行写入npm run migrate:sqlite-to-tcvdb -- \ --plugin-data-dir ~/.openclaw/memory-tdai \ --openclaw-config-path ~/.openclaw/openclaw.json \ --tcvdb-url http://127.0.0.1:80 \ --tcvdb-username root \ --tcvdb-api-key-env TCVDB_API_KEY \ --tcvdb-database agent_memory_prod \ --tcvdb-embedding-model bge-large-zh \ --dry-run正式迁移npm run migrate:sqlite-to-tcvdb -- \ --plugin-data-dir ~/.openclaw/memory-tdai \ --openclaw-config-path ~/.openclaw/openclaw.json \ --tcvdb-url http://127.0.0.1:80 \ --tcvdb-username root \ --tcvdb-api-key-env TCVDB_API_KEY \ --tcvdb-database agent_memory_prod \ --tcvdb-embedding-model bge-large-zh \ --yes只迁移特定记忆层如果你只需要迁移部分记忆层可以使用--layers参数指定# 只迁移L1记忆层跳过L0原始消息和Profile npm run migrate:sqlite-to-tcvdb -- \ --plugin-data-dir ~/.openclaw/memory-tdai \ --openclaw-config-path ~/.openclaw/openclaw.json \ --tcvdb-url http://127.0.0.1:80 \ --tcvdb-username root \ --tcvdb-api-key-env TCVDB_API_KEY \ --tcvdb-database agent_memory_prod \ --tcvdb-embedding-model bge-large-zh \ --layers l1 \ --yes英文语料场景迁移对于英文语料可以使用英文BM25分词npm run migrate:sqlite-to-tcvdb -- \ --plugin-data-dir ~/.openclaw/memory-tdai \ --openclaw-config-path ~/.openclaw/openclaw.json \ --tcvdb-url http://127.0.0.1:80 \ --tcvdb-username root \ --tcvdb-api-key-env TCVDB_API_KEY \ --tcvdb-database agent_memory_prod \ --tcvdb-embedding-model bge-large-en-v1.5 \ --bm25-language en \ --yes迁移参数详细说明迁移命令支持多种参数配置以下是主要参数的详细说明参数必填默认值说明--plugin-data-dir是—插件数据目录路径--openclaw-config-path是—openclaw.json配置文件路径--sqlite-path否plugin-data-dir/vectors.dbSQLite数据库文件路径--tcvdb-url是—TCVDB服务地址--tcvdb-username是—TCVDB用户名--tcvdb-api-key*—TCVDB API密钥明文--tcvdb-api-key-env*—包含API密钥的环境变量名--tcvdb-database是—TCVDB数据库名--tcvdb-embedding-model是—Embedding模型名称--layers否l0,l1,l2,l3要迁移的层逗号分隔--dry-run否false仅预览不执行写入--yes否false跳过交互确认注意--tcvdb-api-key和--tcvdb-api-key-env二选一必须提供其中一个。迁移后的验证与配置迁移完成后建议进行以下验证和配置步骤验证迁移结果迁移命令默认会校验迁移前后的记录数确保数据完整性。你也可以通过--summary-json-path参数将迁移摘要输出到JSON文件便于后续分析。检查配置更新迁移工具默认会更新openclaw.json配置文件和manifest.json如果你希望手动管理配置可以使用--no-apply-config和--no-rewrite-manifest参数禁用自动更新。测试Agent功能迁移完成后启动AI Agent测试其记忆功能是否正常工作确保迁移的数据能够被正确读取和使用。常见问题解决迁移过程中遇到连接超时怎么办可以通过--tcvdb-timeout-ms参数增加请求超时时间例如npm run migrate:sqlite-to-tcvdb -- \ ...其他参数... --tcvdb-timeout-ms 30000 \ --yes目标数据库已存在数据如何进行追加迁移可以使用--no-fail-if-target-nonempty和--no-verify-counts参数允许目标库已有数据并跳过计数验证npm run migrate:sqlite-to-tcvdb -- \ ...其他参数... --no-fail-if-target-nonempty \ --no-verify-counts \ --yes总结通过本文的指南你已经了解了如何将现有AI项目迁移到TencentDB Agent Memory。从记忆层次结构的理解到迁移前的准备工作再到完整的迁移步骤和参数配置以及迁移后的验证和问题解决我们覆盖了迁移过程中的各个方面。TencentDB Agent Memory的强大记忆管理能力将帮助你的AI Agent更好地组织和利用知识提高协作效率和服务质量。如果你在迁移过程中遇到任何问题可以参考项目中的详细文档或寻求社区支持。祝你迁移顺利让你的AI项目在TencentDB Agent Memory的支持下发挥更大的潜力 【免费下载链接】TencentDB-Agent-MemoryTencentDB Agent Memory is a team-level memory hub for AI Agents — turning conversations, docs, and code into four reusable memory assets (Chat Memory, Skill, LLM-Wiki, Code-Graph) that are governed, shared, and equipped across agents and frameworks.项目地址: https://gitcode.com/GitHub_Trending/te/TencentDB-Agent-Memory创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考