---
title: "TencentDB Agent Memory: 61% Token Reduction and 51% Better Task Success for Long-Horizon AI Agents"
url: https://aideveloper44.com/blog/tencentdb-agent-memory-layered-long-term-memory-ai-agents-token-reduction
description: "Tencent's TencentDB Agent Memory delivers fully local long-term memory for AI agents via a 4-tier progressive pipeline — cutting token usage by 61% and improving pass rates by 51% on real-world benchmarks."
lang: en
---

AI Infrastructure (https://aideveloper44.com/blog/tag/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

Image: TencentDB Agent Memory: Layered Long-Term Memory for AI Agents With 61% Token Reduction (https://media.base44.com/images/public/6a06e0a6db6965c708089f4b/646303917_generated_image.png)

## 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 (https://github.com/Tencent/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 https://github.com/Tencent/TencentDB-Agent-Memory.

Read more: https://github.com/Tencent/TencentDB-Agent-Memory

Tencent: https://aideveloper44.com/blog/tag/tencent
agent memory: https://aideveloper44.com/blog/tag/agent-memory
long-term memory: https://aideveloper44.com/blog/tag/long-term-memory
open source: https://aideveloper44.com/blog/tag/open-source
token efficiency: https://aideveloper44.com/blog/tag/token-efficiency
LLM: https://aideveloper44.com/blog/tag/llm
knowledge graph: https://aideveloper44.com/blog/tag/knowledge-graph

### Enjoyed this?

Get more posts like this delivered to your inbox.

← Previous

Google Open-Sources AX: A Distributed Agent Runtime Built for Reliability and Resumption
https://aideveloper44.com/blog/google-ax-open-source-distributed-agent-runtime-reliability-resumption

Next →

GBrain: Garry Tan's Open-Source AI Agent Brain With Self-Wiring Knowledge Graph
https://aideveloper44.com/blog/gbrain-garry-tan-open-source-ai-agent-brain-knowledge-graph

## Related Articles

Open Source

### Tencent Cloud Releases Octop, an Open-Source Multi-User AI Platform

3 min read
https://aideveloper44.com/blog/tencent-cloud-releases-octop-ai-platform

Announcements

### Anthropic Introduces Claude Opus 5.5: An AI Model Built for Long-Running Agentic Coding

3 min read
https://aideveloper44.com/blog/anthropic-introduces-claude-opus-5-5

Open Source

### Tencent AI Releases CubeSandbox v7 with Cross-Node State Persistence

4 min read
https://aideveloper44.com/blog/tencent-cubesandbox-v7-release

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "@type": [
      "WebSite",
      "NewsArticle"
    ],
    "name": "AIDeveloper44",
    "url": "https://aideveloper44.com",
    "isAccessibleForFree": true,
    "isPartOf": {
      "productID": "CAowsfXgCw:openaccess",
      "@type": [
        "Product"
      ]
    }
  },
  {
    "@context": "https://schema.org",
    "@type": "Organization",
    "name": "AIDeveloper44",
    "url": "https://aideveloper44.com",
    "logo": "https://qtrypzzcjebvfcihiynt.supabase.co/storage/v1/object/public/base44-prod/public/696b2bd107af20deac4cc200/9f77c0b91_a-digital-illustration-of-a-white-llama-_j4dyH5xoRnKf_3rtw-mvEQ_OdqL2BrSTtKHjJAuhTp_zg.png"
  },
  {
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
      {
        "@type": "ListItem",
        "position": 1,
        "name": "Home",
        "item": "https://aideveloper44.com/"
      },
      {
        "@type": "ListItem",
        "position": 2,
        "name": "Blog / Blog Index",
        "item": "https://aideveloper44.com/blog"
      },
      {
        "@type": "ListItem",
        "position": 3,
        "name": "Blog Article",
        "item": "https://aideveloper44.com/blog/tencentdb-agent-memory-layered-long-term-memory-ai-agents-token-reduction"
      }
    ]
  },
  {
    "@context": "https://schema.org",
    "@type": "Organization",
    "name": "AINews.sh",
    "alternateName": "AI News",
    "url": "https://ai-dev-pulse-ac4cc200.base44.app",
    "logo": "https://ai-dev-pulse-ac4cc200.base44.app/logo.png",
    "description": "Developer-focused AI product releases, reviews, and news. Your source for the latest AI tools, open-source models, and platform updates.",
    "foundingDate": "2026",
    "slogan": "Stay ahead with AI product intelligence",
    "sameAs": [],
    "knowsAbout": [
      "Artificial Intelligence",
      "Machine Learning",
      "Large Language Models",
      "AI Tools",
      "Open Source AI",
      "AI Frameworks",
      "Developer Tools"
    ]
  },
  {
    "@context": "https://schema.org",
    "@type": "NewsArticle",
    "headline": "TencentDB Agent Memory: Layered Long-Term Memory for AI Agents With 61% Token Reduction",
    "description": "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.",
    "image": "https://media.base44.com/images/public/6a06e0a6db6965c708089f4b/646303917_generated_image.png",
    "datePublished": "2026-05-22T09:52:00.000Z",
    "dateModified": "2026-05-22T16:57:18.356000",
    "author": {
      "@type": "Person",
      "name": "AIDeveloper44 Team"
    },
    "publisher": {
      "@type": "Organization",
      "name": "AIDeveloper44"
    },
    "mainEntityOfPage": {
      "@type": "WebPage",
      "@id": "https://aideveloper44.com/blog/tencentdb-agent-memory-layered-long-term-memory-ai-agents-token-reduction"
    },
    "isAccessibleForFree": true
  }
]
```