English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Agent Memory Is a Pyramid, Not a Warehouse: Layered Memory Engineering in TencentDB Agent Memory

Forum topic · ✨步子哥 · 2026-08-03

Summary

TencentDB Agent Memory, a Tencent Cloud open-source project trending on GitHub (+1,091 stars/day), argues that agent memory failures come from poor organization rather than insufficient capacity. Instead of dumping all conversation history and tool outputs into a flat vector database, it organizes memory hierarchically along two pillars: memory layering and symbolic memory. Short-term context uses a three-tier structure—archived raw tool outputs, step-level JSONL summaries, and a lightweight Mermaid canvas that compresses task state into a symbolic graph agents can drill down into via node IDs. Long-term memory is a four-layer semantic pyramid (raw dialogues, atomic facts, scene blocks, user persona), each level a compression of the one below. Benchmarks with OpenClaw integration show WideSearch pass rate rising from 33% to 50% with 61% fewer tokens, SWE-bench from 58.4% to 64.2% over 50 consecutive tasks, and PersonaMem from 48% to 76%. The takeaway: agent memory systems compete on organization, not capacity.

Agent Memory Is a Pyramid, Not a Warehouse: Layered Memory Engineering in TencentDB Agent Memory

Run an agent on a long task, and by step 50 it starts "forgetting"—it loses track of what it did, repeats the same tool calls, and its context window fills with verbose logs. You have to re-explain everything from scratch.

This is not a memory capacity problem. The context window is large enough and the vector database complete enough—it remembers everything. The problem is it remembers but cannot find.

The Dead End of Flat Storage

The traditional approach to agent memory is intuitive: chop all conversation history, tool outputs, and intermediate states into pieces, stuff them into a vector database, and do semantic retrieval on demand.

This is like piling all your files on the floor and digging through them every time you need one. Every piece of information is an equally important fragment; retrieval becomes a blind full-scale search with no macro-level structure to guide it. As tasks grow long, the context bloats, token consumption explodes, and the agent's attention is diluted across irrelevant details.

Tencent Cloud's TencentDB Agent Memory project (GitHub Trending +1,091 stars/day) rejects this path outright. Its core claim: memory is not about hoarding everything—it's about never having to repeat yourself.

Two Pillars: Layering + Symbolic Memory

TencentDB Agent Memory's architecture rests on two pillars: memory layering and symbolic memory. The goal is not to make the agent "remember more" but to make it "reason better."

Short-Term Memory: A Three-Tier Structure

Short-term context is not a flat log—it's a three-tier progressive structure:

  • Bottom tier: raw tool output archives (refs/*.md), fully preserved but kept out of the context
  • Middle tier: step-level summaries (jsonl)—what each step did and what the result was
  • Top tier: a lightweight Mermaid canvas that compresses the entire task state into a symbolic graph
  • The agent keeps only the top-tier Mermaid structure in context. When it needs details, it drills down to the middle or bottom tier via node_id. It's like reading a map: first check the map for orientation, then zoom into street view only when needed.

    Long-Term Memory: A Semantic Pyramid

    Cross-session long-term memory is likewise not a flat log but a four-layer semantic pyramid:

  • L0 Dialogue: raw conversations
  • L1 Atomic: atomic facts extracted from dialogues
  • L2 Scene: scene blocks that assemble atomic facts into situations
  • L3 Persona: user profiles—stable preferences abstracted from scenes
  • Each layer is a compression and abstraction of the one below. L3 is not a summary of L0; it is a stable structure distilled layer by layer from L0 → L1 → L2 → L3. This is isomorphic to how human memory works—short-term memory consolidates into long-term memory, and long-term memory abstracts into a sense of "who I am."

    Symbolization: Turning Logs into Symbols

    Symbolic memory solves another problem: tool logs are too long. A single tool call can produce thousands of tokens of output, of which only tens of tokens are useful. TencentDB Agent Memory compresses verbose tool logs into compact Mermaid symbols, sharply cutting token usage while making the structure clearer.

    The Numbers

    Measured results after OpenClaw integration:

    | Benchmark | Task | 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 how SWE-bench was tested: 50 consecutive tasks simulate the context accumulation pressure of long-horizon sessions, not isolated turns. This is closer to how agents actually work.

    Engineering Insight: Organization Matters More Than Volume

    TencentDB Agent Memory's core claim—"hierarchical beats flat"—converges with a series of recent studies:

  • MemTools (a USB-C interface for agent memory): declarative data contracts make different memory systems interchangeable, emphasizing structured organization
  • Regression Tax (skill libraries can make agents worse): 59% of gains were offset by regressions, with flat skill-library retrieval as one root cause
  • Zero-Mem (zero-token memory operations): a subtraction approach to agent memory, isomorphic with TencentDB's "don't hoard" philosophy
  • These works point to a shared theme: in the agent era, the key to a memory system is not capacity—it's how memory is organized.

    An Analogy: From File Piles to Libraries

  • Traditional vector storage = all files piled on the floor, dug through on demand
  • Hierarchical storage = filing cabinets + a table of contents + labels: consult the index, then drill down
  • Short-term Mermaid canvas = a map: check the map before you walk
  • Long-term semantic pyramid = a library's classification system (Dewey Decimal): locate from coarse to fine, layer by layer
The principle of hierarchical organization is not new—human libraries have practiced it for two thousand years. What's new is bringing it into the LLM era, so agents retrieve their own memories like librarians instead of squirrels digging through a nut pile.

Conceptual Lineage: Solving Problems at a Different Level

TencentDB Agent Memory belongs to the "solve the problem at a different level" family—not by doing memory retrieval harder (bigger vector stores, longer contexts), but by changing levels (hierarchical organization + symbolic compression). It shares this family resemblance with octopus RNA editing, slime mold externalized memory, and Möbius RoPE topological interventions.

Conclusion

Amid the arms race for "bigger context, longer windows," TencentDB Agent Memory points to another possibility: the competitiveness of a memory system lies in organization, not capacity. Let agents remember what should be remembered and forget what should be forgotten—and people are freed from repetitive work to focus on judgment, creativity, and what truly matters.

---

Project: https://github.com/TencentCloud/TencentDB-Agent-Memory Docs: The README includes full English and Chinese versions plus a Quick Start License: MIT

Tags

#ai-agents#agent-memory#llm#tencentdb#vector-database#memory-management#mermaid#benchmark-results

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/178503922