AI Infrastructure

TencentDB Agent Memory: Layered Long-Term Memory for AI Agents With 61% Token Reduction

Tencent has open-sourced TencentDB Agent Memory, a fully local long-term memory system for AI agents built on a 4-tier progressive pipeline combining symbolic short-term memory and layered long-term personalization. In benchmarks, it cuts token usage by up to 61.38% and improves task success rates by 51.52%, with zero external API dependencies.

A
AIDeveloper44 Team
May 22, 2026·5 min read
TencentDB Agent Memory: Layered Long-Term Memory for AI Agents With 61% Token Reduction

The Memory Problem in Long-Horizon Agents

Every developer building AI agents hits the same wall: context windows fill up, the agent loses track of prior work, and users have to repeat themselves constantly. Flat vector stores — the standard approach — don't solve this. They shred conversations into fragments and rely on blind similarity search to recover them, with no macro-level structure to guide recall.

TencentDB Agent Memory from Tencent takes a different approach: reject flat storage, embrace layering and symbolization.

The Architecture: Two Pillars

1. Memory Layering

TencentDB Agent Memory builds a semantic pyramid across three memory types:

  • Short-term context layering: Bottom layer archives raw tool outputs; middle layer extracts step-level summaries (JSONL); top layer condenses state into a lightweight Mermaid canvas. The agent attends only to the top-layer structure in context.
  • Long-term personalization layering: L0 (raw conversation) → L1 (atomic facts) → L2 (scenario blocks) → L3 (user persona). Day-to-day preferences live at the persona layer; details are drilled down to atoms only when needed.
  • Skill generation layering: Execution traces → common solution patterns → reusable skills and SOPs.

2. Symbolic Memory (Mermaid Canvas)

Instead of keeping verbose tool logs in context, TencentDB Agent Memory offloads full logs to external files and encodes task state as a compact Mermaid symbol graph. Each node carries a node_id; when the agent needs details, it greps for the ID and retrieves the full raw text — maximum semantics with minimum tokens.

Benchmark Results

Tested over continuous long-horizon sessions (not isolated turns), with OpenClaw as the base agent:

  • WideSearch: Success rate 33% → 50% (+51.52%); tokens 221M → 85M (−61.38%)
  • SWE-bench (50 consecutive tasks): 58.4% → 64.2% (+9.93%); tokens −33.09%
  • PersonaMem (long-term): Accuracy 48% → 76% (+59%)

Fully Local, Zero External API Dependencies

A key design constraint: TencentDB Agent Memory runs entirely locally with no external API calls required for the memory layer itself. This makes it suitable for privacy-sensitive enterprise deployments where data cannot leave the organization's infrastructure.

Get started at github.com/Tencent/TencentDB-Agent-Memory.

Enjoyed this?

Get more posts like this delivered to your inbox.

🚀 Join the AI dev community — follow us everywhere

© 2026 MARKTECHPOST AI MEDIA INC. All rights reserved.Terms & ConditionsPrivacy Policy
Beta Mode