OpenClaw安装TencentDB-Agent-Memory
安装
2026年5月之后的版本直接安装openclaw plugins install @tencentdb-agent-memory/memory-tencentdb
OpenClaw 2026.4.23安装
2026.4.23使用上面的命令安装的是旧版本0.2.2,需要手动安装新版本
先用NPM安装,拉取软件包npm install -g @tencentdb-agent-memory/memory-tencentdb@latest
PS:查看已安装软件包npm list -g --depth=0
复制软件包到OpenClaw插件目录
cp -r~/.npm-global/lib/node_modules/@tencentdb-agent-memory/memory-tencentdb ~/.openclaw/extensions/安装到OpenClaw
cd ~/.openclaw/extensions/memory-tencentdb
npm install配置
插件配置
OpenClaw 2026.4.23需要打补丁,然后增加allowConversationAcces配置
补丁在Github源代码scripts/bugfix-20260423/bugfix-20260423.sh
"plugins": {
"entries": {
"memory-tencentdb": {
"enabled": true,
"hooks": {
"allowConversationAccess": true
}
}
}
}高级配置(指定处理记忆使用的模型)
如果OpenClaw使用了Coding Plan的API,在日志中可能会出现403调用错误(部分API限制了用途),需要切换大模型
"plugins": {
"entries": {
"memory-tencentdb": {
"enabled": true,
"hooks": {
"allowConversationAccess": true
},
"config": {
"extraction": {
"enabled": true,
"model": "DeepSeek/deepseek-v4-flash"
},
"persona": {
"model": "DeepSeek/deepseek-v4-flash"
},
"llm": {
"enabled": true,
"baseUrl": "https://api.deepseek.com",
"apiKey": "YOUR_API_KEY_HERE",
"model": "deepseek-v4-flash",
"maxTokens": 4096,
"timeoutMs": 120000,
}
}
}
}
}历史对话导入记忆步骤
为什么不用官方 Seed 导入
官方提供 openclaw memory-tdai seed --input ... 命令导入历史对话,但存在缺陷,所有记忆的created_time会变成导入当天,丢失历史时间线,这对需要按时间检索和分析的场景有影响
自定义脚本方案
1. 导出包含时间戳的对话记录(如Telegram可以导出json格式的对话记录)
2. 让AI Agent读取TencentDB-Agent-Memory,编写数据导入脚本,并明确表示不使用官方的seed数据导入方式
3. 数据导入脚本会按天拆分并转换成带时间戳的jsonl对话记录文件到.openclaw/memory-tdai/conversations
4. 数据导入脚本会调用大模型API读取对话内容,并将总结内容写入数据库数据库L1表(离散记忆),同时输出jsonl文件存入.openclaw/memory-tdai/records
5. 此时L2(场景块)和L3(人设画像)数据依然缺失,让AI Agent继续编写脚本读取数据库L1表的数据并调用大模型API生成L2和L3