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.
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-tencentdbHermes users can use the provided Docker image.
Source code: https://github.com/Tencent/TencentDB-Agent-Memory
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Architect's Tech Stack
Java backend, microservices, distributed systems, containerized programming, and more.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
