How TencentDB Agent Memory Cuts Token Usage by 61% and Boosts Task Success

TencentDB Agent Memory, an open‑source hierarchical memory system for long‑running AI agents, offloads tool calls, structures short‑term and four‑layer long‑term memories, and reduces token consumption by 61% while raising task success rate 51% and persona accuracy from 48% to 76%, all running locally with SQLite and no API keys.

Architect's Tech Stack
Architect's Tech Stack
Architect's Tech Stack
How TencentDB Agent Memory Cuts Token Usage by 61% and Boosts Task Success

Problem

Long‑running AI agents lose earlier steps because token limits force the context to grow, scattering the model’s attention and causing missed information.

Commonly, all dialogue history is appended to the prompt. This works for short tasks but, for cross‑session long tasks, token usage explodes and performance degrades.

TencentDB Agent Memory Architecture

Symbolic Short‑Term Memory

Tool‑call records are offloaded to external storage instead of being directly appended to the prompt. A Mermaid diagram captures the key state in a structured form, keeping the prompt lightweight while preserving full information for debugging.

Layered Long‑Term Memory

The long‑term store consists of four hierarchical layers:

L0: Dialogue

L1: Atomic facts

L2: Scenarios

L3: User profile

Each layer refines information rather than collapsing everything into a single vector bucket, so preferences (e.g., “I like TypeScript”) remain separate from transient requests (e.g., “check the weather”).

Measured Benefits

When integrated with OpenClaw, token consumption dropped by 61%.

Task success rate increased by 51%.

PersonaMem personalization accuracy rose from 48% to 76%.

The solution runs entirely locally, uses SQLite for storage, has zero external dependencies, and requires no API key, keeping data on‑premise.

Getting Started

openclaw plugins install @tencentdb-agent-memory/memory-tencentdb

Hermes users can use the provided Docker image.

Source code: https://github.com/Tencent/TencentDB-Agent-Memory

TencentDB Agent Memory L0 to L3 semantic pyramid
TencentDB Agent Memory L0 to L3 semantic pyramid
Performance comparison chart
Performance comparison chart
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AI agentsSQLiteOpenClawhierarchical memoryToken ReductionTencentDB Agent Memory
Architect's Tech Stack
Written by

Architect's Tech Stack

Java backend, microservices, distributed systems, containerized programming, and more.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.