Tencent has released TencentDB Agent Memory, an open-source memory system for AI agents. The project is shipped under the MIT License. This targets problems familiar to anyone who ships long-term agents: context bloat and recall failure.
It is symbolic short-term memory along with layered long-term memory. It integrates with OpenClaw as a plugin and with Hermes Agent through a gateway adapter. The default backend is local SQLite with the sqlite-vec extension, so no external API is required.
Why is it difficult to remember agents?
Most current memory stacks shred data into pieces and dump them into flat vector stores. In this case, recall becomes a blind similarity search across the truncated fragments without macro-level guidance. This architecture is based on two pillars: memory layering and symbolic memory.
4-layer semantic pyramid
For long-term personalization, TencentDB Agent Memory builds a four-level pyramid instead of a flat log. The layers are L0 Conversation, L1 Atom, L2 Scenario, and L3 Persona. These correspond to raw dialogs, atomic facts, scene blocks, and user profiles.
The persona layer contains day-to-day user preferences and is queried first. The system drills down to Atom or the live conversation only when deeper details are needed. Lower layers preserve evidence. The upper layer preserves the structure.
Storage is heterogeneous. Facts, logs, and traces are stored in a database for full-text search. Personas, scenes, and canvases are saved as human-readable Markdown files. Layered memory artifacts exist in ~/.openclaw/memory-tdai/.
Symbolic short-term memory via mermaids
Long-running agent tasks consume tokens through detailed tool logs, search results, code, and error traces. TencentDB agent memory addresses this issue through context offloading combined with symbolic memory.
Complete tool logs are offloaded to the following external files: refs/*.md. State transitions are encoded in Mermaid syntax within the lightweight task canvas. The agent examines the symbol graph in the context window.
If you want the raw text, run grep. node_id And get the corresponding file. The Tencent development team describes this as a definitive drill-down from symbols at the top layer, to indexes at the middle layer, and then to the raw text at the bottom layer.
Benchmark numbers
Results are measured over continuous long-term sessions rather than isolated turns. For example, the SWE bench runs 50 consecutive tasks per session to simulate the pressure of context accumulation.
WideSearch increased the pass rate from 33% to 50% by integrating the plugin with OpenClaw, a relative improvement of 51.52%. Token usage decreased from 221.31 million to 85.64 million, a reduction of 61.38%.
On the SWE bench, the success rate increased from 58.4% to 64.2%, but tokens decreased from 3,474.1 million to 2,375.4 million, a decrease of 33.09%. For AA-LCR, the success rate varies from 44.0% to 47.5%. Tokens decreased from 112 million to 77.3 million, a decrease of 30.98%.
Regarding long-term memory, PersonaMem’s accuracy increases from 48% to 76%. Note: These numbers are based on Tencent’s own evaluation.
Recall and search
Acquisition defaults to a hybrid strategy. This system combines BM25 keyword search and vector embedding and fuses them using reciprocal rank fusion (RRF). Developers can switch to pure keyword or embedding Set the mode through the settings field. BM25 tokenizer supports both Chinese (jieba) and English.
The default configuration triggers L1 memory extraction every 5 turns. A user persona is generated for every 50 new memories. Recall returns 5 items with a default timeout of 5 seconds. When timed out, the system skips the injection rather than blocking the conversation.
Installation and developer surfaces
OpenClaw integration is shipped as a single npm package. @tencentdb-agent-memory/memory-tencentdb. The project requires Node.js 22.16 or later. One configuration flag is required to enable this. The plugin then handles conversation capture, memory extraction, scene aggregation, persona generation, and invocation.
For Hermes, the Docker image bundles the agent, plugin, and TDAI Memory Gateway. The default model is Tencent Cloud’s DeepSeek-V3.2. All OpenAI compatible endpoints are MODEL_PROVIDER=custom Flag.
Two tools are exposed to the agent during the session. tdai_memory_search and tdai_conversation_search. Both return the following reference node_id and result_ref Field for traceback. Tencent Cloud Vector Database (TCVDB) backend is also available as a local SQLite alternative.
Visual explanation of Marktechpost
curator mark tech post · AI Research, Designed for Builders
Important points
- TencentDB Agent Memory is Tencent’s open source (MIT) memory system for AI agents, built on symbolic short-term memory with a layered long-term memory pipeline with no external API dependencies.
- Long-term memory is structured as a four-layer semantic pyramid (L0 Conversations → L1 Atoms → L2 Scenarios → L3 Personas) and is constructed by drilling down.
node_idandresult_refInstead of flat vector recall. - Short-term memory offloads redundant tool logs.
refs/*.mdIt also keeps only the compact Mermaid task canvas in context, reducing token usage while maintaining full traceability. - Improvements are reported when integrated with OpenClaw: WideSearch pass rate went from 33% → 50% (token reduction 61.38%), SWE bench went from 58.4% → 64.2%, AA-LCR went from 44.0% → 47.5%, and PersonaMem accuracy went from 48% → 76%.
- It ships as a single npm plugin for OpenClaw and a Docker image for Hermes, with default local SQLite + sqlite-vec, hybrid BM25 + vector + RRF retrieval, and an optional Tencent Cloud Vector Database (TCVDB) backend.
Please check Repo. Please feel free to follow us too Twitter Don’t forget to join us 150,000+ ML subreddits and subscribe our newsletter. hang on! Are you on telegram? You can now also participate by telegram.
Need to partner with us to promote your GitHub repository, Hug Face Page, product release, webinar, etc.? connect with us

Michal Sutter is a data science expert with a master’s degree in data science from the University of Padova. With a strong foundation in statistical analysis, machine learning, and data engineering, Michal excels at transforming complex datasets into actionable insights.
