Tencent Cloud open-sourced TencentDB Agent Memory on GitHub, a fully local long-term memory system for AI agents that rejects flat vector stores in favor of a layered, symbolic architecture. The system, designed for the OpenClaw and Hermes agent frameworks, claims to cut token usage by up to 61.38% while improving task pass rates by 51.52% on the WideSearch benchmark. It runs with zero external API dependencies.
The numbers come from continuous long-horizon sessions, not isolated turns. On SWE-bench, the system ran 50 consecutive tasks per session and cut token consumption from 3.47 billion to 2.38 billion — a 33% reduction — while improving pass rate from 58.4% to 64.2%. On the AA-LCR benchmark, token use dropped 31% and pass rate rose 8%. These are not cherry-picked single-turn gains; they reflect sustained performance under the context-accumulation pressure of real-world agent workflows.
The architecture rests on two pillars: memory layering and symbolic memory. Memory layering replaces the flat vector store — what the project calls “shredding data into fragments and dumping them into a flat vector store” — with a progressive disclosure pyramid. For long-term personalization, the system builds four tiers: L0 Conversation (raw dialogue), L1 Atom (atomic facts), L2 Scenario (scene blocks), and L3 Persona (user profile). The Agent attends to the top Persona layer for day-to-day preferences and drills down to Atoms only when detail matters. For short-term context, the system archives raw tool outputs, extracts step-level summaries, and condenses state into a lightweight Mermaid canvas. The agent reasons over the symbol graph and retrieves full text via node_id only when needed.
Symbolic memory is the second pillar. Instead of verbose prose or flat JSON, the system encodes task state transitions in Mermaid syntax — a diagram language that is dense enough for LLMs to parse and readable for humans. Full tool logs are offloaded to external files; only the Mermaid task map remains in context. The project claims this is the mechanism behind the 61% token reduction on WideSearch, where verbose intermediate logs (search results, code, error traces) are the largest token consumers.
The most interesting claim is on long-term personalization memory. The PersonaMem benchmark measures how well an agent retains user preferences across sessions. Without the plugin, accuracy sits at 48%. With TencentDB Agent Memory, it jumps to 76% — a 59% relative improvement. That is not a marginal gain. It suggests that the layered architecture genuinely captures recurring patterns in user behavior rather than dumping everything into a similarity search that decays into noise.
Tencent Cloud has integrated the system with OpenClaw and Hermes. OpenClaw users install a plugin and enable it with zero configuration, defaulting to local SQLite with sqlite-vec. Hermes users can spin up a Docker image that bundles the agent and memory provider together, or attach memory to an existing install. The default model is DeepSeek-V3.2 running on Tencent Cloud’s LKE endpoint, but the system supports any OpenAI-compatible endpoint. The entire pipeline runs locally — no external API calls for memory retrieval or storage.
The timing is telling. As frontier labs pour resources into ever-larger context windows — Google’s 2-million-token Gemini, Anthropic’s 200K-token Claude — a different approach is emerging from the infrastructure layer. TencentDB Agent Memory argues that brute-force context accumulation is the wrong answer. “We reject both brute-force history accumulation and irreversible lossy summarization,” the project states. Instead, the system treats memory as a compression problem with a traceability constraint: every abstraction must have a deterministic path back to ground-truth evidence.
This matters for AI builders in a practical way. The cost of long-horizon agent tasks scales with token consumption. A 61% reduction on search-heavy tasks means agents can run 2.6x more sessions for the same inference budget. The pass-rate improvements compound that effect: fewer retries, fewer failures, less wasted context. For teams building agents that interact with databases, APIs, or codebases over extended sessions, the economics shift meaningfully.
The open-source release is the key detail. Tencent Cloud is not selling a managed service here — it is publishing the code and the architecture. That means the approach can be forked, adapted, and integrated into any agent framework that supports plugin slots. The project ships with OpenClaw and Hermes support, but the underlying principles — layered storage, symbolic compression, progressive disclosure — are framework-agnostic.
There are open questions. The benchmarks are conducted on Tencent Cloud’s own models and infrastructure. Independent replication on other model families, especially smaller open-weight models, would clarify how much of the gain comes from the memory architecture versus the specific model configuration. The Mermaid-based symbolic memory is clever, but its effectiveness depends on the LLM’s ability to parse diagram syntax reliably — a capability that varies across models. And the long-term personalization results, while impressive, are measured on a single benchmark with no public dataset.
Still, the direction is clear. The agent memory problem is not a storage problem. It is a retrieval and compression problem. TencentDB Agent Memory offers a concrete, local, open-source implementation of that insight, backed by numbers that suggest the approach works in practice. For builders tired of watching their agent’s context window fill with noise, it is worth a close look.