
### TencentDB Agent Memory
Help your Agent remember fixed workflows, accumulate past experience, and reuse user preferences — **so people can pull their attention out of repetitive work and back to creation, judgment, and life itself**.
[](https://www.npmjs.com/package/@tencentdb-agent-memory/memory-tencentdb)
[](./LICENSE)
[](https://nodejs.org/)
[](https://github.com/openclaw/openclaw)

[](https://discord.gg/kDtHb5RW2)
[Highlights](#-highlights) · [Overview](#overview) · [Quick Start](#quick-start) · [Design Highlights](#-design-highlights)
---
## ✨ Highlights
> **TencentDB Agent Memory = Short-term context compression + Long-term personalized memory.**
>
> - **Short-term context compression**: lighten the long-task context so the Agent no longer reasons while carrying every tool log on its back.
> - **Long-term personalized memory**: distill fragmented conversations into structured memories, scene blocks, and user personas.
**Plugged into OpenClaw**, it saves up to **63.59% tokens**, lifts pass rate by **+41.18%** (relative), and pushes PersonaMem accuracy from **48%** to **76%**.
| Memory Capability | Benchmark | Clawpro Success | With Plugin | Relative Δ | Clawpro Tokens | With Plugin Tokens | Relative Δ |
| :--- | :--- | :---: | :---: | :---: | :---: | :---: | :---: |
| **Short-term** | WideSearch | 8.5% | **12%** | **+41.18%** | 174.31M | **63.46M** | **−63.59%** |
| **Short-term** | SWE-bench | 58.4% | **64.2%** | **+9.93%** | 3474.1 | **2375.4** | **−33.09%** |
| **Short-term** | AA-LCR | 44.0% | **47.5%** | **+7.95%** | 112.0M | **77.3M** | **−31%** |
| **Long-term** | PersonaMem | 48% | **76%** | **+59%** | — | — | — |
> These are long-session evaluations, not single-turn isolated runs. Multiple tasks are concatenated into the same session and executed back-to-back. For example, each SWE-bench session runs 50 tasks consecutively to simulate the context-accumulation pressure faced by a real long-horizon Agent.
---
## Overview
**Memory is not about letting AI store everything — it is about freeing humans from repeating everything.**
TencentDB Agent Memory helps the Agent learn your workflows, retain task context, and reuse past experience, so that humans can spend their attention on judgment, creation, and work that actually matters.
In real work, plenty of things should not need to be re-explained: fixed SOPs, common analysis conventions, project background, user preferences, and so on. We capture these stable experiences and let the Agent reuse them automatically when the moment is right.
TencentDB Agent Memory is not a plain chat log, not a one-way irreversible summary, and not just RAG. We design memory as a layered information management system: the database carries the searchable, filterable, recallable factual base; the file system carries the readable, editable, progressively-disclosable task canvases, scene blocks, and user personas. Short-term compression solves in-task information overload, while long-term personalized memory solves cross-session user understanding.
> **Let the Agent remember what should be remembered, so humans can focus on what is actually worth creating.**
It is built from two capabilities:
### Short-term Compression: Mermaid Infinite Canvas ✖️ Context Offload
In long tasks, what eats your context window is rarely the user's goal — it is the byproducts of tool calls: search results, web page bodies, file chunks, test logs, error traces, diffs, intermediate versions. TencentDB Agent Memory offloads these full payloads to external files, keeping only summaries, paths, and task state near the active context.
```text
Tool result
└─► refs/*.md full original payload
└─► offload-*.jsonl per-tool-call summary + result_ref
└─► mmds/*.mmd Mermaid task canvas
└─► Context only the structured state the current task needs
```
The point here is not "deleting history" but "folding history": most of the time the Agent looks at the task map; when it needs detail it drills down through `node_id` and `result_ref` back to the raw evidence.
### Long-term Personalized Memory: From Fragments to a User Persona
Cross-session memory is a different problem. Raw conversation logs are a low-density ore: they contain preferences, facts, emotions, long-term goals — and a lot of noise. Plain vector retrieval can only find "similar fragments" and rarely surfaces the user's stable, long-term traits.
TencentDB Agent Memory uses an L0 → L3 pyramid pipeline to refine information layer by layer: