Tencent Open-Sources TencentDB Agent Memory: A 4-Tier Local Memory Pipeline for AI Agents
Tencent has launched TencentDB Agent Memory, an open-source reminiscence system for AI brokers. The challenge ships below the MIT license. It targets an issue acquainted to anybody transport long-horizon brokers: context bloat and recall failure.
It is symbolic short-term reminiscence together with layered long-term reminiscence. It integrates with OpenClaw as a plugin and with the Hermes Agent by a Gateway adapter. The default backend is native SQLite with the sqlite-vec extension, so no exterior API is required.
Why agent reminiscence is tough
Most present reminiscence stacks shred knowledge into fragments and dump them right into a flat vector retailer. Recall then turns into a blind similarity search throughout disconnected fragments, with no macro-level steering. The structure rests on two pillars: reminiscence layering and symbolic reminiscence.
A 4-tier semantic pyramid
For long-term personalization, TencentDB Agent Memory builds a four-level pyramid as a substitute of a flat log. The layers are L0 Conversation, L1 Atom, L2 Scenario, and L3 Persona. These correspond to uncooked dialogue, atomic info, scene blocks, and a consumer profile.
The Persona layer carries day-to-day consumer preferences and is queried first. The system drills right down to Atoms or uncooked Conversations solely when finer element is required. Lower layers protect proof; higher layers protect construction.
Storage is heterogeneous. Facts, logs, and traces are continued in databases for full-text retrieval. Personas, scenes, and canvases are saved as human-readable Markdown recordsdata. Layered reminiscence artifacts reside below ~/.openclaw/memory-tdai/.
Symbolic short-term reminiscence by way of Mermaid
Long-running agent duties eat tokens by verbose software logs, search outcomes, code, and error traces. TencentDB Agent Memory addresses this by context offloading mixed with symbolic reminiscence.
Full software logs are offloaded to exterior recordsdata below refs/*.md. State transitions are encoded in Mermaid syntax inside a light-weight activity canvas. The agent causes over the image graph in its context window.
When it wants the uncooked textual content, it greps for a node_id and retrieves the corresponding file. The Tencent dev workforce describes this as a deterministic drill-down from top-layer image to mid-layer index to bottom-layer uncooked textual content.
Benchmark numbers
Results are measured over steady long-horizon periods, not remoted turns. SWE-bench, for instance, runs 50 consecutive duties per session to simulate context-accumulation strain.
On BroadSearch, integrating the plugin with OpenClaw raises cross price from 33% to 50%, a 51.52% relative enchancment. Token utilization drops from 221.31M to 85.64M, a 61.38% discount.
On SWE-bench, success climbs from 58.4% to 64.2% whereas tokens fall from 3474.1M to 2375.4M, a 33.09% discount. On AA-LCR, the success price strikes from 44.0% to 47.5%. Tokens drop from 112.0M to 77.3M, a 30.98% discount.
For long-term reminiscence, PersonaMem accuracy rises from 48% to 76%. Note: these numbers come from Tencent’s personal evaluations.
Recall and retrieval
Retrieval defaults to a hybrid technique. The system combines BM25 key phrase search with vector embeddings, fused utilizing Reciprocal Rank Fusion (RRF). Developers can swap to pure key phrase or embedding mode by a config subject. The BM25 tokenizer helps each Chinese (jieba) and English.
Default settings set off an L1 reminiscence extraction each 5 turns. A consumer persona is generated each 50 new reminiscences. Recall returns 5 objects by default with a 5-second timeout. On timeout, the system skips injection quite than blocking the dialog.
Installation and developer floor
The OpenClaw integration ships as a single npm package deal: @tencentdb-agent-memory/memory-tencentdb. The challenge requires Node.js 22.16 or increased. Enabling it takes one config flag. The plugin then handles dialog seize, reminiscence extraction, scene aggregation, persona era, and recall.
For Hermes, a Docker picture bundles the agent, the plugin, and the TDAI Memory Gateway. The default mannequin is Tencent Cloud’s DeepSeek-V3.2. Any OpenAI-compatible endpoint works by the MODEL_PROVIDER=customized flag.
Two instruments are uncovered to brokers throughout a session: tdai_memory_search and tdai_conversation_search. Both return references with node_id and result_ref fields for traceback. A Tencent Cloud Vector Database (TCVDB) backend can also be obtainable as a substitute for native SQLite.
Marktechpost’s Visual Explainer
Open Source / Tencent
TencentDB Agent Memory
A quick-start information to totally native, 4-tier long-term reminiscence for AI brokers.
01 / 10
Curated by MARKTECHPOST · AI Research, Engineered for Builders
Key Takeaways
- TencentDB Agent Memory is Tencent's open-source (MIT) reminiscence system for AI brokers, constructed on symbolic short-term reminiscence together with a layered long-term reminiscence pipeline with zero exterior API dependencies.
- Long-term reminiscence is structured as a 4-tier semantic pyramid (L0 Conversation → L1 Atom → L2 Scenario → L3 Persona), with drill-down by way of
node_idandresult_refas a substitute of flat vector recall. - Short-term reminiscence offloads verbose software logs to
refs/*.mdand retains solely a compact Mermaid activity canvas in context, slicing token utilization whereas preserving full traceability. - Reported beneficial properties when built-in with OpenClaw: BroadSearch cross price 33% → 50% with a 61.38% token discount, SWE-bench 58.4% → 64.2%, AA-LCR 44.0% → 47.5%, and PersonaMem accuracy 48% → 76%.
- Ships as a single npm plugin for OpenClaw and a Docker picture for Hermes, with native SQLite + sqlite-vec by default, hybrid BM25 + vector + RRF retrieval, and an non-obligatory Tencent Cloud Vector Database (TCVDB) backend.
Check out the Repo. Also, be at liberty to comply with us on Twitter and don’t overlook to affix our 150k+ ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.
Need to associate with us for selling your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar and so on.? Connect with us
The put up Tencent Open-Sources TencentDB Agent Memory: A 4-Tier Local Memory Pipeline for AI Agents appeared first on MarkTechPost.
