拓冰建站拓冰建站
首页 / 资讯中心 / 正文

TencentDB Agent Memory批量导入工具:如何快速迁移历史对话数据?

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记忆中枢能够将对话、文档和代码转化为四种可复用的记忆资产聊天记忆、技能、LLM知识库、代码图谱实现跨Agent和框架的治理、共享与装备。本文将详细介绍如何使用其批量导入工具快速迁移历史对话数据帮助你轻松完成数据迁移工作。为什么需要批量迁移历史对话数据在AI Agent的应用过程中历史对话数据是非常宝贵的资源。这些数据包含了用户的偏好、需求以及Agent的交互模式等重要信息。将历史对话数据迁移到TencentDB Agent Memory中能够让AI Agent更好地理解用户提供更加个性化、精准的服务。随着数据量的不断增长手动迁移历史对话数据变得效率低下且容易出错。TencentDB Agent Memory提供的批量导入工具能够帮助用户快速、准确地完成历史对话数据的迁移节省大量时间和精力。认识TencentDB Agent Memory的记忆层次TencentDB Agent Memory采用了分层的记忆结构将记忆分为L0原始日志、L1原子记忆、L2场景块和L3角色画像四个层次。这种分层结构能够有效地组织和管理记忆数据提高记忆的检索和利用效率。L0原始日志Raw Log全面保留原始对话和事件流确保原始信息不丢失为数据提供依据。L1原子记忆Atomic Memory自动提取事实、偏好、约束和状态从繁杂的语音中稳定提取关键信息。L2场景块Scene Block按项目、主题或工作流场景进行聚类结合上下文召回减少跨场景误用。L3角色画像Persona稳定的用户偏好与服务方式画像让Agent按照用户习惯协作。批量迁移工具SQLite → 腾讯云向量数据库迁移工具TencentDB Agent Memory提供了一款离线迁移工具用于将memory-tdai的数据从本地SQLite存储迁移到腾讯云向量数据库TCVDB。该工具位于项目的scripts/migrate-sqlite-to-tcvdb/目录下主要文件包括cli-entry.tsCLI入口、sqlite-to-tcvdb.ts迁移核心逻辑、config-write.tsOpenClaw配置更新和manifest-write.tsManifest重写等。前置条件在使用迁移工具之前需要确保满足以下条件Node.js 22.16.0插件已通过openclaw plugins install安装迁移脚本已编译编译迁移脚本迁移脚本使用TypeScript编写运行前需要先进行编译。打开终端进入项目根目录执行以下命令npm run build:migrate-sqlite-to-vdb编译产物将输出到scripts/migrate-sqlite-to-tcvdb/dist/目录下可直接用Node运行。迁移步骤1. 预检模式可选在正式迁移之前可以先使用预检模式查看源数据确保数据准备无误。执行以下命令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-run2. 正式迁移预检无误后执行正式迁移命令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常用参数说明参数必填默认值说明--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二选一必须提供其中一个。高级迁移场景1. 指定自定义SQLite路径当数据库不在默认vectors.db位置时可以通过--sqlite-path参数指定自定义路径npm run migrate:sqlite-to-tcvdb -- \ --plugin-data-dir ~/.openclaw/memory-tdai \ --sqlite-path /backup/2026-04/vectors-snapshot.db \ --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 \ --yes2. 迁移指定记忆层如果只需要迁移部分记忆层可以使用--layers参数指定# 只迁移L1记忆层 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 \ --yes3. 英文语料场景对于英文语料可以使用英文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总结TencentDB Agent Memory的批量导入工具为历史对话数据的迁移提供了便捷、高效的解决方案。通过本文的介绍你已经了解了迁移工具的基本使用方法、参数说明以及高级迁移场景。希望这些内容能够帮助你顺利完成历史对话数据的迁移工作充分利用TencentDB Agent Memory的强大功能提升AI Agent的服务质量和效率。如果你在使用过程中遇到任何问题可以查阅项目中的官方文档或相关源码获取更多帮助。迁移工具的源码位于scripts/migrate-sqlite-to-tcvdb/目录下你可以通过阅读源码深入了解迁移的实现细节。现在就开始使用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),仅供参考
分享:

看完干货,该让你的企业上线了

免费需求沟通 · 48 小时内出具建站方案 · 河南本地可上门