TencentCloud/TencentDB-Agent-Memory

TencentDB Agent Memory is a team-level memory hub for AI Agents — turning conversations, docs, and code into four reusable memory assets (Chat Memory, Skill, LLM-Wiki, Code-Graph) that are governed, shared, and equipped across agents and frameworks.

What it solves

TencentDB Agent Memory addresses the problem of "context overload" and memory loss in AI agents. It prevents agents from having to repeat the same instructions, SOPs, and project backgrounds across sessions and reduces the token cost associated with dumping massive, verbose tool logs into the LLM's context window.

How it works

The project implements a layered memory architecture that moves away from flat vector storage in favor of a hierarchical approach:

  • Memory Layering: It organizes information into a semantic pyramid. For long-term memory, it progresses from raw conversations (L0) to atomic facts (L1), scenario blocks (L2), and finally user personas (L3). For short-term tasks, it uses a three-layer system: raw tool outputs, step-level summaries, and a lightweight Mermaid canvas.
  • Symbolic Memory: To handle verbose intermediate logs, the system offloads full text to external files and represents the task state as a high-density Mermaid symbol graph. The agent reasons over this graph and only retrieves the full raw text via a node_id when specific details are needed.
  • Heterogeneous Storage: It uses databases for bottom-layer evidence (facts, logs) and human-readable Markdown files for top-layer structures (personas, scenes), ensuring full traceability from high-level abstractions back to ground-truth data.

Who it’s for

This is for developers building long-horizon AI agents (such as those using OpenClaw or Hermes) who need their agents to retain complex workflows, user preferences, and task context without exhausting token limits or losing accuracy.

Highlights

  • Significant Token Reduction: Cuts token usage by up to 61.38% in certain benchmarks.
  • Improved Performance: Increases pass rates and persona accuracy (e.g., raising PersonaMem accuracy from 48% to 76%).
  • Lossless Recovery: Maintains a deterministic drill-down path from symbols back to raw evidence.
  • Plugin Integration: Ready-to-use plugins for OpenClaw and Hermes agents.