Tencent releases new release TencentDB Agent MemoryOpen-source AI memory system. It is distributed under MIT’s license. The project targets two problems that are familiar to those who ship long-horizon agents, context bloats and failures in recall.
The short-term symbol memory is combined with the long-term layered memory. This plugin integrates OpenClaw and the Hermes Agent using a Gateway Adapter. It uses local SQLite and the sqlite-vec extensions as its default backend, which means that no API external is needed.
What makes agent memory difficult?
The majority of current memory stacks shred the data and store it in a vector flat. In this case, recall becomes a similarity-based search on disconnected fragments with no macro level guidance. This architecture is built on two main pillars, memory layering (or symbolic memory) and memory layering.
Four-tier semantic pyramid
TencentDB Agent Memory creates a four level pyramid for personalization over time instead of using a log. Layers are: L0 conversation, L1 atom, L2 scenario, and L3 personality. The layers correspond to raw dialog, atomic fact blocks, scene block, and an user profile.
Personas represent the daily preferences of users and are queried as a first step. Only when more detail is required, the system will drill down into Atoms or raw conversations. Lower layers preserve evidence; upper layers preserve structure.
Storage can be heterogeneous. For full-text retrieval, facts, logs, and trace are stored in databases. The files are human-readable and contain personas, canvases, and scenes. Memory artifacts are stored in layers. ~/.openclaw/memory-tdai/.
Mermaid as a symbol of short-term memory
Tokens are consumed by long-running tasks through tool logs that include code and errors, as well as search results. TencentDB Agent memory addresses this by context offloading in combination with symbolic memories.
Under the Full Tool Logs are exported as external files refs/*.md. Mermaid syntactic is used in the lightweight task canvas to encode transitions between states. In its context window, the agent determines what to do with the symbol graph.
It greps the text when it is in need of raw data. node_id The corresponding file is then retrieved. Tencent’s dev team calls this a “deterministic” drill-down, from the top-layer symbol down to the mid-layer index and then to raw text at bottom.
Benchmark numbers
The results are not measured on isolated sessions but over continuous sessions with a long-horizon. The SWE Bench, for instance, simulates context accumulation pressure by running 50 consecutive tasks during a single session.
Integration of OpenClaw with WideSearch improves the pass rate on WideSearch from 33% up to 50%. This is an improvement relative of 51,522%. Token use drops from 221.31M tokens to 85.64M tokens, which is a 61.38% decrease.
SWE Bench: Success increases from 58.4% up to 64.2%, while tokens drop from 34741.1M down to 23755.4M. This is a reduction of 33.09%. On AA – LCR, success rates increase from 44.0% t 47.5%. Tokens fall from 112.0M – 77.3M. That’s a 30.98% reduction.
PersonaMem’s accuracy increases from 48 to 76% for long-term memories. Tencent provided the numbers.
Recall and retrieval
The retrieval strategy defaults to hybrid. Reciprocal Rank Fussion (RRF), combined with BM25 Keyword Search, is the system’s default retrieval strategy. Some developers can use pure Also, The following are some examples of how to use Embedding The mode can be set in a configuration box. The BM25 tokenizer is compatible with both Chinese (jieba), and English.
The default setting triggers an L1 extraction after every 5 turns. Every 50 memories, a user persona will be generated. Recall automatically returns 5 items, with a default timeout of five seconds. Timeouts skip injection instead of blocking the conversation.
Installation and developer surface
OpenClaw is shipped as a single package in npm: @tencentdb-agent-memory/memory-tencentdb. Node.js 22.16.0 or later is needed for this project. It is enabled by a single config flag. It then takes care of conversation recording, memory extraction and scene aggregation.
A Docker image for Hermes bundles together the agent, plugin and TDAI Memory Gateway. Tencent Cloud DeepSeek V3.2 as the default is used. OpenAI endpoints compatible with OpenAI can work through the MODEL_PROVIDER=custom flag.
Agents are introduced to two tools during the session. tdai_memory_search You can also find out more about the following: tdai_conversation_search. The return reference is the same for both. node_id You can also find out more about the following: result_ref Fields for traceback Tencent Cloud Vector Database is an alternative backend to SQLite.
Marktechpost’s Visual Explainer
Curated By MARKTECHPOST · AI Research, Engineered for Builders
What you need to know
- TencentDB Agent Memory, Tencent’s (MIT-certified) open-source AI memory system is built using a layered pipeline of long-term and symbolic memory. There are no API dependencies.
- Long-term memory is structured as a 4-tier semantic pyramid (L0 Conversation → L1 Atom → L2 Scenario → L3 Persona), with drill-down via
node_idYou can also find out more about the following:result_refInstead of flat vector, recall. - The short-term memory is able to handle verbose logs of tool usage.
refs/*.mdIt only keeps a Mermaid compact task canvas as context. - Reported gains when integrated with OpenClaw: WideSearch pass rate 33% → 50% with a 61.38% token reduction, SWE-bench 58.4% → 64.2%, AA-LCR 44.0% → 47.5%, and PersonaMem accuracy 48% → 76%.
- This plugin ships as a single OpenClaw npm and Docker image, with local SQLite+sqlite-vec, hybrid BM25+RRF retrieval (by default), and an optional Tencent Cloud Vector Database backend.
Check out the Repo. Also, feel free to follow us on Twitter Join our Facebook group! 150k+ ML SubReddit Subscribe Now our Newsletter. Wait! Are you using Telegram? now you can join us on telegram as well.
You can partner with us to promote your GitHub Repository OR Hugging Page OR New Product Launch OR Webinar, etc.? Connect with us

