TencentDB Agent Memory: Agent Memory Is Not a Warehouse, It's a Pyramid
Run an Agent on a long task and after ~50 steps it starts "forgetting"—repeating tool calls, stuffing its context window with verbose logs. The problem isn't capacity; it's retrieval without structure. The agent remembers everything but can't find anything.
> One-line takeaway: This post analyzes TencentDB Agent Memory's hierarchical memory engineering and why organization beats storage volume.
The Dead End of Flat Storage
The conventional approach: chop all history, tool outputs, and intermediate states into a vector database and retrieve semantically. This is like piling all files on the floor and digging through them—every fragment equally weighted, no macro structure, exploding token consumption, and diluted agent attention.
TencentDB Agent Memory (GitHub, trending +1091⭐/day) rejects this path. Its core claim: memory is not hoarding everything, it's making people never repeat themselves.
Two Pillars: Layering + Symbolic Memory
Short-Term Memory: Three Layers
- Bottom: raw tool output archive (
refs/*.md), fully preserved but never in context - Middle: step-level summaries (
jsonl) - Top: a lightweight Mermaid canvas compressing task state into one symbolic graph
- L0 Conversations: raw dialogue
- L1 Atomic: atomic facts extracted from conversations
- L2 Scenarios: scenario blocks assembling atomic facts
- L3 Persona: stable user preferences abstracted from scenarios
- MemTools (a USB-C interface for agent memory): declarative data contracts, structured organization
- Regression Tax: 59% of skill-library gains erased by regressions, partly due to flat retrieval
- Zero-Mem: zero-token memory operations, same subtraction spirit as "don't hoard"
- Traditional vector store = files piled on the floor
- Layered storage = cabinets + catalogs + tags
- Short-term Mermaid canvas = a map
- Long-term semantic pyramid = a library's classification system (Dewey Decimal)
Only the top-level Mermaid structure sits in context; details are drilled into via node_id—like reading a map before zooming to street view.
Long-Term Memory: Semantic Pyramid
Each layer compresses and abstracts the one below—L3 is not a summary of L0 but a stable structure refined layer by layer.
Symbolization
A single tool call can emit thousands of tokens with only tens of useful ones. The project compresses verbose tool logs into compact Mermaid symbols, slashing token usage while clarifying structure.
The Numbers
Benchmarks after OpenClaw integration:
| Benchmark | Task type | Pass rate | Relative gain | Token usage | Relative drop | |---|---|---|---|---|---| | WideSearch | short-term | 33% → 50% | +51.52% | 221M → 86M | -61.38% | | SWE-bench | short-term | 58.4% → 64.2% | +9.93% | 3474M → 2375M | -33.09% | | AA-LCR | short-term | 44.0% → 47.5% | +7.95% | 112M → 77M | -30.98% | | PersonaMem | long-term | 48% → 76% | +59% | — | — |
Note the SWE-bench protocol: 50 consecutive tasks simulating long-horizon context accumulation, closer to real agent workloads than isolated turns.
Engineering Insight: Organization Beats Volume
The "layered beats flat" thesis aligns with recent research:
Shared theme: in the agent era, what matters in memory systems is not capacity but organization.
Analogy: From File Piles to Libraries
Conceptual Genealogy
TencentDB Agent Memory belongs to the "solve the problem at a different layer" family—not stronger retrieval (bigger vector DBs, longer windows) but a different level (hierarchical organization + symbolic compression), alongside octopus RNA editing, slime mold externalized memory, and Möbius RoPE topological interventions.
Conclusion
In the arms race for bigger context windows, TencentDB Agent Memory points to another possibility: a memory system's competitive edge lies in organization, not capacity. Let agents remember what matters and forget the rest, so humans are freed from repetitive work.
---
Project: https://github.com/TencentCloud/TencentDB-Agent-Memory Docs: README with full English/Chinese versions and Quick Start License: MIT
FAQ
Q1: Who is this for? Practitioners, researchers, and students interested in AI and machine learning.
Q2: Core takeaways? The flat-storage dead end; the two pillars of layering + symbolization; the three-layer short-term architecture.
Q3: Is the code open source? Yes, MIT-licensed; see the link above.