
Tencent published TencentDB Agent Memory as an MIT‑licensed, local‑first memory pipeline aimed at reducing context bloat and recall failures in long‑horizon AI agents. The project pairs a symbolic short‑term representation with a structured long‑term stack so agents can keep working context small while preserving retrievable evidence — a design intended for builders of multi‑turn, task‑oriented agents who need lower token costs and stronger task recall.
The system uses a symbolic short‑term memory encoded as Mermaid diagrams for state and transitions, with offloaded tool logs stored under refs/*.md. Long‑term memory is organized as a four‑level pyramid: L0 Conversation for raw dialogue, L1 Atom for atomic facts, L2 Scenario for scene blocks, and L3 Persona for user profiles. Storage is heterogeneous: facts and logs are kept in databases for full‑text and vector retrieval, while personas, scenarios and canvases live as human‑readable Markdown files under the OpenClaw memory directory.
Integration is delivered as an OpenClaw npm plugin published under the @tencentdb scope (agent — memory/memory — tencentdb) and requires Node.js 22.16 or later. A Hermes Docker image bundles the agent, the plugin and the TDAI Memory Gateway; that image defaults to Tencent Cloud’s DeepSeek‑V3.2 model, though third‑party OpenAI‑compatible endpoints can be used by setting MODEL_PROVIDER=custom.
Retrieval defaults to a hybrid approach: BM25 keyword search plus vector embeddings, fused with Reciprocal Rank Fusion (RRF). The BM25 tokenizer supports Chinese via jieba and English, and developers can switch to pure keyword or pure embedding modes through configuration. Operational defaults include an L1 extraction every five turns, persona generation every 50 new memories, and recall of five items with a five‑second timeout; on timeout the system skips injection rather than blocking the conversation. When more detail is needed the pipeline follows a deterministic top‑down drill from Persona → Atom → Conversation.
Tencent reports evaluation results from continuous long‑horizon sessions (SWE‑bench runs 50 consecutive tasks to simulate accumulation pressure). On WideSearch, OpenClaw plus the plugin raised pass rates from 33% to 50% (a 51.52% relative improvement) while token usage fell from 221.31M to 85.64M (a 61.38% reduction). On SWE‑bench overall success moved from 58.4% to 64.2% and tokens from 3474.1M to 2375.4M (33.09% reduction). AA‑LCR success rose from 44.0% to 47.5% with tokens down 30.98%. PersonaMem accuracy increased from 48% to 76%. Tencent attributes these figures to its own internal evaluations.
For builders the project offers a privacy‑friendly, local‑first memory pipeline that emphasizes structured storage and deterministic retrieval paths rather than flat fragment stores. The plugin automates conversation capture, memory extraction, scene aggregation, persona generation and recall, and exposes agent‑facing search tooling (including tdai_memory_search). Users are advised to test their own settings before relying on the reported gains.
Sources
Replies (0)
No replies in this topic yet.