启动前必须在 .env 中填好 memory 组和 proxy 组两套 LLM 参数;需 Node >= 22.16,OpenClaw 需 >= 2026.3.13;MongoDB 存储后端为实验性且默认关闭,从 v1.x/v0.x 升级需另跑迁移工具

TencentDB-Agent-Memory
TencentCloud活跃维护把对话、文档和代码沉淀成聊天记忆、技能、LLM-Wiki、代码图谱四类可复用记忆资产,让多个 AI Agent 跨框架共享和治理长期记忆。
TencentDB 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.
git clone https://github.com/TencentCloud/TencentDB-Agent-Memory.git
cd TencentDB-Agent-Memory/deploy/global-images
cp .env.example .env
./start-all.shREADME 未说明
把对话、文档和代码沉淀为四类可复用记忆资产,供团队内多个 Agent 共享
把对话、文档和代码沉淀成聊天记忆、技能、LLM-Wiki、代码图谱四类可复用记忆资产,让多个 AI Agent 跨框架共享和治理长期记忆。
核心能力
- 从对话与任务中自动抽取 Chat Memory 和 Skill
- 把文档转成带链接图的 Wiki 结构化页面
- 为代码库建立 CodeGraph 索引符号与调用关系
- 通过 Proxy 改 base URL 即可零代码接入各 Agent
- 按 private/team/restricted 三级控制资产可见性
容易踩的坑
- v2.0.3最新正式版2026-10-26 · 2026-10-26 14:09 UTC
[2.0.3] - 2026-10-26
v2.0.3 发布,相比 v2.0.3-beta.1 新增会话默认绑定与 Wiki 富文档,并把未单独配置超时的上游等待时间从 10 分钟改为 1 小时。同时修复 DeepSeek Harness 辅助接口、历史记忆时间格式、安装脚本、面板交互、Knowledge 启动,以及代理在 Redis 中断后不能自行恢复的问题。
产品定位:让 Agent 的经验、文档、代码沉淀成可复用资产,让下一位 Agent 直接读档。详见 README_CN.md。
🔁 会话默认绑定
- 用户可为自己保存 Team、Agent、Task 的默认组合。新会话会直接使用该组合,不再每次弹出选择
- 未设置时仍走原来的选择流程;默认组合失效时自动回到原流程,并说明原因
- 可在会话中锁定或解锁该默认组合,避免后续会话被意外改掉
📄 Wiki 富文档
- Wiki 新增 Word、Excel、PowerPoint、PDF 等富文档的导入、预览和内容抽取
- 原有 Markdown、文本和 HTML 导入保持可用;修复 Markdown 粘贴在部分情况下导入失败的问题
⏱️ 长回复不再被提前截断
- 未单独配置超时时,上游等待时间由 10 分钟改为 1 小时;已填写
forwardTimeoutMs的配置保持不变 - 流式回复连续 60 秒没有新内容时只记录告警,不再因此中断
🐛 修复
- 修复 DeepSeek Harness 的 token 计数、embeddings 等辅助接口返回 404 的问题
- 修复部分历史记忆因时间格式异常而无法生成 L1 记忆的问题
- 修复 macOS 上一键安装脚本遇到中文标点时退出的问题
- 修复面板拖拽结束后鼠标样式和文本选择未恢复的问题
- 修复面板标签页关闭键无法用键盘激活的问题
- 修复生成的 User Key 复制失败时没有提示的问题
- 修复 Knowledge 服务因 OpenTelemetry 依赖版本漂移而无法启动的问题
- 修复代理在 Redis 中断后不能自行恢复、必须重启进程的问题。短暂中断仍短暂排队;时间稍长则立即降级,不把请求拖住
- v2.0.3-beta.12026-10-13 · 2026-10-13 10:43 UTC
查看更新说明
[2.0.3-beta.1] - 2026-10-13
v2.0.3-beta.1 发布,相比 v2.0.2 新增可插拔的决策服务、技能按需选择与会话轨迹 记录能力,并补齐代码知识库的 SSH 克隆与可观测性信息。以上新能力均默认关闭, 旧配置无需修改、行为与之前保持一致。
产品定位:让 Agent 的经验、文档、代码沉淀成可复用资产,让下一位 Agent 直接读档。详见 README_CN.md。
🧩 可插拔决策服务(默认关闭)
Skill 选择与 Memory L3 更新判定统一收敛到决策服务,可灵活替换决策来源:
- 通过统一的决策服务接口调用,内置 JEV,也可接入其他 decision API
- 配置用
provider指定(默认jev),旧配置无需修改 - 默认不调用 JEV,行为与之前一致;开启后即使决策服务调用失败, 也不影响正常对话与记忆写入
🧰 技能(Skill)按需选择(默认关闭)
- 开启后由 Proxy 每轮自动选出合适的技能,通过一次客户端工具调用加载
- 不再向系统提示词注入完整技能目录,减少提示词开销
📼 会话轨迹记录
- Proxy 在每轮对话结束后,把发往上游的消息与模型回复记录到 MemoryCore
(新增
/v3/session/add,写入本地存储) - 随
tdai.enabled开启
🧠 代码知识库
- 私有代码仓支持 SSH 克隆(含非 22 端口),在面板获取 SSH 公钥后即可建图
📈 可观测性
/health新增ftsAvailable,便于排查 BM25 关键词召回不可用的问题- LLM 调用失败日志补充状态码、URL 与响应内容
- v2.0.22026-10-09 · 2026-10-09 11:19 UTC
查看更新说明
[2.0.2] - 2026-10-09
产品定位:让 Agent 的经验、文档、代码沉淀成可复用资产,让下一位 Agent 直接读档。详见 README_CN.md。
🗄️ 存储后端可扩展 · 支持 MongoDB
团队记忆不再绑定单一数据底座,MongoDB 后端能力进一步补全:
- 新增 memory-prompt 与 generation-ref 两类存储,覆盖更多记忆数据结构
- 一键入口
./start-all-mongo.sh会把STORE_MODE持久化写入.env,后续启动 保持同一后端,不再每次重复配置 - 修复索引冲突场景的自愈能力,重复的默认/抽取记录不再导致启动报错
🔀 更多客户端接入
- OpenCode 新增官方 Memory adapter 配置包(含
opencode.json与接入文档),按说明配置即可接入,无需编写插件代码 - OpenCode 支持 2.0 的 v2 provider 配置结构,新版客户端可直接复用官方
opencode.v2.json - DeepSeek Harness 新增 dsh 桌面端适配,配置方式可参考
./agents/dsh/README.md中 1.6 的部分 - 新增 Pi 客户端接入(类似 Codex 的 AI Agent 客户端,走 OpenAI Chat 协议)
🧠 外部源导入(Wiki / 代码 / 任务)
- 新增从外部任务管理系统导入 Task 的能力,任务卡片直接展示来源、支持 ID 复制与分页
- 新增外部代码源(私有仓)注册与凭据隔离,各团队持有独立凭据、互不可见
- 新增 Wiki 外部来源导入,与代码源、任务源一起补齐外部资产导入链路
🧰 技能(Skill)体验优化
- 冷启动批量技能抽取新增严格模式,抽取质量更可控
- 技能抽取自动跟随用户语言,生成内容更贴合使用习惯
- 技能列表支持按使用活跃度排序,高频技能更容易被找到
🎛️ Memory Hub 面板
- 任务卡片支持来源展示、ID 复制与分页优化,批量导入交互更顺畅
- 手动刷新时自动重置时间筛选,新产生的记忆能即时看到
🔄 会话与接入体验
- 会话引导在更多客户端下更稳定:自动选中唯一 Agent、资产确认更精准、预设失败时 自动绕过而非卡住
- 修复 WorkBuddy 并行子代理反复弹窗的问题,会话归一更稳健
- 修复多种客户端下记忆命令、工具结果污染、历史消息重复等影响体验的问题
🐛 修复
- 修复无 embedding 场景下 BM25 召回异常、L0 工具结果污染与原文展示问题
- 修复记忆召回为空、历史消息重复、多团队切换列表截断等问题
- 修复 Claude Code 的 AGENTS.md 指令丢失等问题
- 修复部署脚本在部分环境下的兼容性问题
- v1.0.3pre-release2026-09-22 · 2026-09-22 09:40 UTC
查看更新说明
[1.0.3] - 2026-09-22
🐛 修复
OpenClaw 宿主兼容
- 兼容 OpenClaw 9.5:适配新版宿主的 gateway-ized 插件安装流程与 sqlite-vec 加载方式,并前向兼容旧版本(8.2 / 9.4)。
- 修复首次 install 缺少
enabled字段:OpenClaw 9.5 在 gateway 进程内执行plugins install,存在竞态导致插件首次安装缺少enabled配置。采用版本分流:>= 9.5延迟 60s +manualPatch直写文件,< 9.5保持立即写入 + restart 原行为。 - 修复 sqlite-vec native 扩展加载失败:OpenClaw 9.5 将插件依赖 staged 到隔离的
package-N目录,原有sqliteVec.load路径失效。新增「先新后旧」回退:优先定位package-N嵌套的vec0.so直连loadExtension,失败回退原sqliteVec.load;无条件加载失败即降级(degraded)保持原行为。
- 修复首次 install 缺少
- 兼容 OpenClaw 9.5:适配新版宿主的 gateway-ized 插件安装流程与 sqlite-vec 加载方式,并前向兼容旧版本(8.2 / 9.4)。
- v2.0.2-beta.3pre-release2026-09-21 · 2026-09-21 08:41 UTC
查看更新说明
[2.0.2-beta.3] - 2026-09-21
v2.0.2-beta.3 发布,相比 v2.0.1 新增可选的 MongoDB 存储后端、更丰富的面板登录方式、 全新的数据分析与可观测能力,并优化了技能展示、会话接入体验,修复了记忆召回、 多团队切换等若干问题。
产品定位:让 Agent 的经验、文档、代码沉淀成可复用资产,让下一位 Agent 直接读档。详见 README_CN.md。
🗄️ 存储后端可扩展 · 支持 MongoDB
团队记忆不再绑定单一存储,数据底座可按需选择:
- 新增 MongoDB 作为可选后端,大规模团队、高并发场景下更稳、更易横向扩展
- 本地 / 开源镜像新增一键 MongoDB 模式入口,部署时可按需切换存储方案
- 写入策略更稳健,数据一致性得到保障,减少高负载下的写入隐患
🔐 登录方式更丰富
- 面板新增企业登录能力,适配内部办公账号体系,登录更省心
- 账号鉴权更稳健,身份识别更准确
📊 数据分析与可观测性
- 全新数据分析页,团队使用情况一目了然,辅助你判断记忆资产的沉淀效果
- 关键环节补充埋点与可观测数据,运维排查更直观
🧰 技能(Skill)体验优化
- 技能检索与展示更结构化,信息更清晰、调用更稳定
- 历史遗留的异常技能数据自动修复,旧资产无缝兼容
🔄 会话与接入体验
- 更多客户端接入更顺畅,文字模式客户端也能开箱即用
- 团队 / Agent 选择列表完整展示,团队较多时不再漏选
- 会话重置完成提示更清晰
🐛 修复
- 修复部分场景下记忆召回为空、检索降级不生效的问题
- 修复个别情况下记忆解析失败、历史消息重复的问题
- 修复多团队切换时列表被截断、显示不全的问题
- 修复部署脚本在部分环境下的兼容性问题
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Agents remember. Humans innovate.
Installation · Supported Agents · What is it? · Team Play · Technical Implementation · Benchmark · Roadmap
Latest: Team Memory Beta is evolving quickly — install it and start exploring in minutes.
Installation
Start all three services in one go (memory-core + memory-hub + proxy):
git clone https://github.com/TencentCloud/TencentDB-Agent-Memory.git
cd TencentDB-Agent-Memory/deploy/global-images
cp .env.example .env
$EDITOR .env # Fill in two sets of LLM parameters (memory group + proxy group)
./start-all.sh # Launch everything with one command; when finished, it prints a one-liner you can paste directly into Claude
Open the panel: http://localhost:8125.
Complete installation documentation (standalone Memory Hub deployment, Proxy + Claude Code / CodeBuddy usage, stop and cleanup, port reference, etc.) is available in INSTALL.md (中文: INSTALL_CN.md). The MongoDB storage backend is experimental (off by default); see INSTALL.md · MongoDB storage backend.
Migrating data from an older version
If you're already on an older release (v1.x / v0.x) and want to bring your existing data over to v2.0.0+, we provide a migration tool:
See Data Migration Tool (v2 → v3) for full usage and flags. New installations can skip this.
All Agents Share the Same Memory Server
One Proxy, unchanged protocol, zero-code integration — point the Agent's base URL to the Proxy and it's done. No plugin, hook, or MCP server is required.
See INSTALL.md for the exact configuration steps of each client.
Don't see your favorite Agent? You can try adapting it yourself with the Generic integration guide — and we'd love a PR adding native support for it. See CONTRIBUTING.md to get started.
What is TencentDB Agent Memory?
We started from a practical question: How do you reduce repetitive work when using Agents?
If project context has already been explained, it shouldn't need to be repeated in a new session. If documents have already been read, every Agent shouldn't have to start again from page one. A workflow that already works shouldn't have to be rediscovered next time.
Memory here means more than just "remembering conversations." Any information that helps the next Agent avoid reinventing the wheel should be saved, organized, and reused.
Existing information → Reusable memory assets → Fewer turns → Less rework → More stable results and higher efficiency
Let experience accumulate, flow, and pass on to the next Agent
Memory Hub for Agent teams closes the loop across the entire experience lifecycle: work produces assets, assets circulate through the team, and new members can load the team's save file on day one.
- Automatic asset extraction: Extract Chat Memory and Skills from conversations and tasks; convert documents and code into Wiki and CodeGraph; then manage, review, and route them consistently.
- Portable & multi-Agent compatible: Memory assets are decoupled from Agent frameworks — they can move across frameworks and be shared and maintained by multiple Agents and team members.
- Cold-start friendly: Import existing documents, codebases, and Agent conversation sessions. New Agent teams can start from existing experience instead of learning from scratch.
🧠 A brain that remembers people and context
- Chat Memory retains preferences, facts, decisions, and interaction history.
- Each Agent automatically gets its own memory when created — no need to re-introduce yourself next time.
- L0 Conversation → L1 Atom → L2 Scenario → L3 Persona — raw conversations are distilled layer by layer.
"Don't refactor the old auth module — mobile is still using it." — Context this costly shouldn't depend on humans repeating it every time.
⚡ A Skill library that accumulates expertise
- After completing complex work, Agents can extract and manage reusable Skills from conversations and tool calls, and import them into the context of a designated Agent when needed.
- A Skill isn't just a prompt snippet; it has versions, resource files, trigger boundaries, execution steps, and validation rules.
- Personal Skills are private by default; after review, they can be shared with the team and assigned to other Agents.
Troubleshooting, code review, release checklists — learn it once, and the whole team can use it.
📖 A knowledge map that reads both docs and code
- Wiki turns product docs, design specs, and ops runbooks into structured pages with a link graph. (Inspired by Karpathy's LLM knowledge base.)
-
CodeGraph indexes code symbols, files, call relationships, and impact paths.
-
Agents can search, read, inspect callers/callees, and perform impact analysis before modifying code.
Wiki keeps Agents from reading every file list before getting to work. CodeGraph doesn't just tell them "the code is here" — it tells them "changing this might affect those."
🛡️ A team memory panel controlled by humans
- Create teams and Agents in Memory Hub; review, share, and equip memory assets.
- Manage ownership, versions, status, visibility, usage counts, and Agent bindings in one place.
privatebelongs strictly to the Owner;teamis visible to all team members;restrictedgrants precise access via User / Role / Agent ACLs.- Two role layers: global System Admin manages users and teams (creating teams, adding members) and can also use Wiki, CodeGraph, Skill, and other asset management features; Team-level roles include Admin (team manager) and Member (regular member), responsible for asset collaboration and access control within a team. Asset ownership is tracked via Owner — the Owner automatically has management permissions for their assets.
Cold Start: Load the Save File, Then Get to Work
Most Agents' first task is re-learning your project. TencentDB Agent Memory turns the learning cost you've already paid into a save file:
Specifically, these existing assets can be imported directly and processed automatically in the panel:
- Codebases: Import existing repositories — CodeGraph automatically indexes symbols, files, call relationships, and impact paths.
- Documents & files: Import relevant docs and files — Wiki automatically generates structured pages with a link graph.
- Conversation sessions: Import past Agent conversation sessions — Skills and Chat Memory are automatically extracted as reusable assets.
Stop retraining every Agent. Give it the save file.
One Play Style: Build a Growing Agent Team for a One-Person Company
Open Memory Hub and create a team:
Tiny but Serious Inc.
├── 👤 You · Set goals / Make decisions
├── 🔭 Scout · Research / Find opportunities
├── 🛠 Builder · Write code / Build products
├── 🧪 Reviewer · Test / Find issues
└── 🧠 Agent Memory · Preserve the team's experience
You're not opening four disconnected chat windows — you're assembling a squad with different roles that can inherit the team's accumulated experience.
Recruit first, then equip
🔭 Scout
├── User interview Chat Memory
├── Market research Wiki
└── Competitive analysis Skill
🛠 Builder
├── Product Wiki
├── Project CodeGraph
└── Feature Delivery Skill
🧪 Reviewer
├── Historical incident Chat Memory
├── Project CodeGraph
└── Release Checklist Skill
Different roles, different loadouts. Less noise — give each Agent the memory assets it actually needs to get work done.
The company can be tiny. Experience can compound forever.
Memory Assets, Not a Chat Log Warehouse
RAG answers "what can be found?" Team Memory also answers "who can use it, which version is valid, and which Agent should receive it."
| Chat History | Standard RAG | TencentDB Agent Memory | |
|---|---|---|---|
| Cross-session user understanding | △ | △ | ✅ Chat Memory |
| Distilled executable experience | — | — | ✅ Skill |
| Document structure & relationships | — | △ Chunk retrieval | ✅ Wiki + Link Graph |
| Code call graphs & impact scope | — | △ Text match | ✅ CodeGraph |
| Ownership / Version / Status | — | — | ✅ |
| Team sharing & Agent loadout | — | — | ✅ |
| Private / Team / ACL | — | △ | ✅ |
Memory Hub Is Not a Display Board — It's a Control Panel
| Play Style | What you do in the Hub |
|---|---|
| Team Up | Create teams, add people and Agents, define sharing boundaries |
| Asset Library | Browse, search, review, and manage Chat Memory, Skills, Wiki, and CodeGraph |
| Agent Loadout | Bind different memory assets to different Agents; adjust priority and usage mode |
| Knowledge Workshop | Build Wiki and CodeGraph; monitor processing status and asset metadata |
| Access Control | Switch between private, team, and ACL-based access; revoke sharing when needed |
When you open an asset, what matters is not just "what it says," but also "where it came from, which version it is, who it's assigned to, and whether it's been used recently."
Every Loop Gains Experience
Memory doesn't run the Agent loop; it ensures the next iteration inherits the previous one's results: valuable interactions stay in Chat Memory, proven workflows are distilled into Skills, and document/code changes are updated through Wiki ingest and CodeGraph sync.
Without Memory, loops may just repeat faster. With inherited memory, each iteration has the chance to be better than the last.
One Agent Team: Shared Experience, Not Shared Privacy
New Chat Memory and Skills are private by default. Sharing is an explicit action, not a default leak.
| Visibility | Semantics |
|---|---|
private | Only the Owner can read — not even team admins |
team | Team members can read; the Owner / Admin can manage |
restricted | Precise access via User / Role / Agent ACL |
agent | For targeted equipping of Agents within the same team |
You can assign the "Release Skill" to the Release Agent, the "Architecture Wiki" to all development Agents, and CodeGraph to Coder and Reviewer.
Technical Implementation
TencentDB Agent Memory doesn't aim to "store everything." It solves three problems: what's worth keeping, who can use it, and how to retrieve less while retrieving the right things next time.
1. Memory isn't flat records — it grows in layers
Conversations are first saved as L0, then refined by an async pipeline into multiple levels of granularity:
| Layer | What it stores | Primary use |
|---|---|---|
| L0 Conversation | Raw conversations with full context | Verify exact wording, timestamps, and sources |
| L1 Atom | Facts, preferences, constraints, and events extracted from conversations | Precise recall of actionable information |
| L2 Scenario | Knowledge blocks organized around projects or scenarios | Quickly restore a working context |
| L3 Core / Persona | Long-term profiles, stable patterns, and high-level cognition | Let Agents rapidly enter a user's and team's context |
Both generation and retrieval are layered: normally, L2/L3 provide a quick context bootstrap; when specific facts are needed, BM25 + vector retrieval + RRF fall back to L1/L0. Results are further capped by item count, character budget, and timeout limits to prevent memory from overwhelming the context window.
2. Memory isn't a global prompt — it's the Agent's loadout
Chat Memory, Skills, Wiki, and CodeGraph are all registered uniformly as Memory Assets. Memory Hub uses Fixed Binding + ACL to determine which assets a given Agent can use: first narrow the permission scope by Team, User, Agent, and visibility, then retrieve based on the current query.
This lets teams share experience without exposing all their private information; switching Agents or frameworks only requires re-equipping, not retraining.
3. Knowledge isn't injected wholesale — it's called on demand
Documents are organized into searchable Wiki pages that support link-graph drill-down; codebases are indexed into CodeGraph assets containing files, symbols, and call relationships. Agents first discover capabilities via /v3/tools/list, then use /v3/tools/call to read relevant pages, source code, or impact paths.
This makes documents and code part of memory as well — but they remain available tools that only enter context when truly needed.
Benchmark
| Benchmark | Without TencentDB Agent Memory | With it enabled | Relative improvement |
|---|---|---|---|
| PersonaMem | 48% | 76% | +59% |
PersonaMem tests whether an Agent can correctly understand and apply user information after extended interactions.
Notes
- Wiki and CodeGraph are built asynchronously; allow some processing time before they reach
readystatus. - CodeGraph currently prioritizes public HTTPS repositories; support for private repositories and SSH credentials is still being refined.
- The Hub supports manual asset binding; fully automated memory routing is still under iteration.
Related Documentation
- Roadmap (what we're building next)
- Full Installation Guide (Memory Core + Hub + Proxy one-click deployment)
- Roadmap (what we're building next; 中文: ROADMAP_CN.md)
- Data Migration Tool (v2 → v3) (if you're on an older release and want to migrate existing data)
- Knowledge OpenAPI
- API Documentation:
- Contributing Guide
Agent Memory doesn't have a settled standard yet. Bug reports, documentation, benchmarks, new framework adapters, and more creative Memory Hub use cases are all welcome.
Roadmap
Current release is v2.0.0. Next up (v2.0.1): zero-config cold start, faster Wiki generation, user/team custom prompts, Skill export, and Codex (IDE Plan mode) support.
👉 See the full plan in ROADMAP.md (中文: ROADMAP_CN.md).
Acknowledgements
TencentDB Agent Memory stands on the shoulders of the open-source community:
- CodeGraph — our CodeGraph asset module uses code from this project. Its design of a pre-indexed code graph is the foundation of our implementation.
- Hermes Agent (Nous Research) — our Skill asset management uses part of the Skill-related code from Hermes Agent and builds further optimizations base on it.
- "LLM Wiki" by Andrej Karpathy — the idea of treating documentation as an LLM-maintained, incrementally growing knowledge artifact directly informed how our Wiki layer is built and kept up to date.
We are grateful to the authors and contributors of these projects.
Community & Contributing
We welcome contributions of all kinds — bug reports, feature suggestions, documentation fixes, benchmark reproductions, ecosystem integrations, or pull requests. Agent memory is far from settled, and we hope to build it together with the community.
- 🐞 Found a bug or have a question? Open an issue in GitHub Issues — we respond within 24 hours.
- 💡 Have an idea to share? Start a thread in GitHub Discussions.
- 🛠️ Want to contribute code? Please read CONTRIBUTING.md first.
- 💬 Want to chat with us? Join our Discord community and talk to the core developers directly.
✨ Contributors
💡 Thanks to the following contributors building with us — you make TencentDB Agent Memory better.
Star History
MIT © TencentDB Agent Memory Team