The most interesting thing about Tencent's Agent Memory open source project is that it uses a lightweight symbol-like traversal method to manage complex memory relationships.
There is no bulky graph database, and similar effects are achieved.
It turns out that it is mermaid to bear part of the memory routing data.
This choice is too clever.👍 Its rationality lies in the fact that what the Agent really lacks is not "saving more", but "finding the right information at the right level".
The traditional practice is either to slice the historical dialogue into the vector library and recall the results like a bunch of sticky notes; or to build a complete relationship on the database, but the cost of deployment, maintenance, and query has become heavy.
TencentDB-Agent-Memory chose a more engineered intermediate route: use the lightweight symbolic syntax of Mermaid to express task relationships, node dependencies, and memory hierarchies, and then drill down layer by layer through text retrieval and index mapping.
It compresses short-term memory into a Mermaid task canvas and returns to the underlying original record through node_id and result_ref; long-term memory adopts a hierarchical structure of L0 Conversation → L1 Atom → L2 Scenario → L3 Persona.
The design is clever.
Mermaid is essentially a structured text that “makes sense to people and makes sense to models.” It does not easily become a token black hole like JSON multi-layer nesting, nor does it require a complete set of query, modeling, and operation and maintenance systems like graph databases.
For the Agent, it is not a complete alternative to the graph database, but solves 80% of the memory-related scenarios in a lighter, white box, and more debuggable way.
I value one thing in particular: it combines “the semantics of the diagram” with “the retrievability of the text.” The graph database emphasizes traversal, the vector library emphasizes similarity, and the Mermaid memory canvas is more like the Agent's task map: look at the whole picture first, and then drill down by node.
This idea is very suitable for long tasks, tool calls, multiple rounds of debugging, and personal preferences to precipitate these real Agent scenarios.
The value of this solution is to use Mermaid to change the memory from a black box vector heap to a readable, traceable, and maintainable "Agent experience map".
