Tencent has open-sourced a project that garnered 4,600+ stars in just two months.
Its focus is laser-sharp: equipping AI agents with long-term and short-term memory.
What kind of results does this deliver?
The benchmark data speaks for itself. For long-term memory, the overall accuracy rate jumped from 47.85% to 76.10%, an increase of nearly 60%.
User fact recall soared from under 30% to 79%.
With the support of short-term memory, long-running tasks saved up to 61% in token usage.
This project is called TencentDB Agent Memory, developed by the Tencent Cloud Database team. It was officially open-sourced on May 14th.
Here's a look at its integration with OpenClaw and Hermes.
01 What Makes AI Memory So Tricky
When you open a new session with an AI agent today, it generally starts with a blank slate. It knows nothing.
You have to spoon-feed it the relevant context and information before it can do its job effectively.
The ultimate goal of memory is to boost our efficiency.
TencentDB Agent Memory takes a different path from mainstream approaches. Its strategy revolves around symbolic short-term memory + hierarchical long-term memory.
https://github.com/TencentCloud/TencentDB-Agent-Memory
There are three common solutions today, each with glaring weaknesses.
The first is shoving everything into the context window. It's brute-force simple, but windows have hard limits. Stuff too many tokens in, and the window—and your reasoning—blows up.
The second is using a vector database for memory. This is a step up from cramming the context, but the problem is it stores information without refining it. When faced with many conversational fragments, the recall rate plummets and precision suffers.
The third is having the LLM generate a summary. But compression is a lossy process, and it risks wiping out critical details.
02 The Core Architecture of Tencent's Open-Source Project
The project's central design is a four-layer progressive memory architecture.
Layers L0 through L3, from the ground up, each have a distinct role to play.
L0: Raw Dialogue. Keeps a complete, word-for-word record. It acts as a safety net; you can always trace back to the original conversation.
L1: Atomic Facts. Automatically extracts independent fact nodes from conversations. For example, "I love hot pot" or "I use NestJS on the backend." These are tagged and stored.
L2: Scene Clusters. Related atomic facts are grouped by context. For instance, all facts discussed about a user's system—table structures, permissions, APIs—are synthesized into a single scene block. It's formatted in Markdown, making it directly readable by a human.
L3: User Profile. Generates a stable user profile based on the three lower layers. This solidifies tech preferences, coding style, and frequently used toolchains.
This ensures that a long context doesn't degrade the AI's reasoning, nor is any critical information lost.
Moreover, the system guarantees a complete, auditable trail from the top layer back to the original evidence. If L3 states that "the user prefers TypeScript," that conclusion can be traced to a specific scene block in L2. Every conclusion in that block, in turn, links back to the atomic facts in L1, which ultimately point to the exact sentence you spoke in the L0 raw dialogue. The entire chain of evidence remains unbroken.
03 Short-Term Memory Compression: The Mermaid Diagram Magic
The four-layer architecture tackles long-term memory, but short-term context is another massive expense. When an AI debugs a single bug, it might call tools a dozen times, flooding the context window with logs. The solution is symbolic memory: offloading the full, verbose logs to an external file and condensing the situation into a compact task state diagram using Mermaid syntax. When details are needed, they can be retrieved by a node ID.
With minimal tokens, a Mermaid diagram transforms a flat, linear summary list into a task topology graph rich with states, dependencies, and addressable indexes. The AI understands the task's big picture by inferring structure from the graph's topology, rather than relying on memorized tags. The information density is higher, the structure isn't lost, and details can be recovered layer by layer.
In real-world tests, token consumption dropped by over 50%, while the task completion rate actually rose by 23%. It saves money and does a better job.
For memory retrieval, the system uses a hybrid approach. Semantic search (using Embeddings) excels at fuzzy matching, while keyword search (using BM25) is great for exact hits. Both paths independently recall a set of candidate results, which are then merged and ranked using Reciprocal Rank Fusion (RRF). This ensures semantically relevant items aren't missed, and precise matches aren't lost.
04 The Benchmark Numbers
Enough with the design. Let's look at the performance data.
Tencent evaluated the system using the PersonaMem benchmark, comparing the native OpenClaw agent against one integrated with Agent Memory. Here are the results:
| Metric | Native OpenClaw | With Agent Memory |
|---|---|---|
| Overall Accuracy | 47.85% | 76.10% (+59%) |
| User Fact Recall | 29.63% | 79.07% (+167%) |
| Preference Tracking | 66.67% | 83.45% (+25%) |
| Personalized Recommendation | 46.67% | 76.36% (+64%) |
The most dramatic leap was in user fact recall, which jumped from under 30% to 79%. This means that previously, if you told the AI ten things, it would remember roughly three. Now, it remembers about eight.
Beyond PersonaMem, the project was also tested on several programming-related benchmarks:
On WideSearch, the success rate increased from 33% to 50%, while token usage was slashed by 61%. On SWE-bench, the pass rate improved from 58.4% to 64.2%, saving 33% in tokens. To give some context, WideSearch evaluates search, integration, and verification capabilities in information-seeking tasks, while SWE-bench is a benchmark for assessing AI models' ability to solve real-world software engineering problems.
Adding memory didn't just help the AI remember more; it made it significantly more efficient at its tasks. The tokens saved could be spent on doing the actual work.
05 How to Use It
The project is currently released as a plugin for OpenClaw, and installation is straightforward. It takes a single command:
openclaw plugins install @tencentdb-agent-memory/memory-tencentdb
After installation, it uses a local SQLite database with the sqlite-vec extension as the default storage backend. It's zero-configuration and works right out of the box. You don't need to set up a separate database or connect to any external services; all your data stays local.
If you want to plug in an external embedding service to boost semantic search performance, you can specify it in a configuration file. For users of the Hermes Agent framework, the project also provides a comprehensive Docker image. It packages Hermes, the Agent Memory plugin, and a Gateway into a single container. Just pull and run it.
The supported models are also flexible. The new 1.0.0-beta.1 release provides a quick-start method for users who want to build their own custom adaptation layers for Agent Memory.
06 The Tencent Cloud Database AI Capability Landscape
TencentDB Agent Memory isn't a standalone project that Tencent Cloud dreamed up out of the blue. It was part of their May 29th "Databases + AI" launch event. The theme was "AI-Native: Reconstructing the New Database Paradigm." The core idea is this: as AI agents become a new unit of productivity, the database's role must evolve from merely storing data to being the data foundation that supports an agent's perception, memory, decision-making, and collaboration.
Along this "AI-Native Database" trajectory, Tencent Cloud announced several new products all at once:
DatabaseClaw: Tencent Cloud's first database agent. Unlike a typical AI DBA assistant, it doesn't just answer questions. It's designed to step into a live production environment and take on operational responsibilities, running 24/7. It can handle the most time-consuming tasks a DBA faces daily: automated inspections, anomaly diagnosis, and slow query root cause analysis. It's also built with a four-layer security defense—permission isolation, AI behavioral guardrails, architectural safety, and full-chain auditing—giving DBAs the confidence to grant it permissions on production databases.
TDSQL Boundless: A next-generation distributed database. On a single, unified distributed architecture, it supports relational transactional processing, vector semantic search, and full-text search, among other data types. These diverse data models and access patterns can be used within a single connection, or even a single transaction, eliminating the need to maintain separate databases for different data types.
TDSQL-C: A fully upgraded cloud-native database. TDSQL-C's rebuilt third-generation storage architecture, called AI Native Storage, is built on three pillars: stability, disaster recovery, and cost-savings. It allows for application-transparent storage component releases and failed disk replacements. The ultimate result is extreme cost efficiency (with a Total Cost of Ownership over 200% lower than comparable products), zero I/O jitter with lossless rolling upgrades, and zero data loss with a 3-Availability Zone, financial-grade synchronous replication and an RPO of 0. Leveraging this third-gen storage, TDSQL-C has been systematically upgraded into a dual-engine, AI-era cloud-native database, using PostgreSQL and MySQL compatible cloud-native compute nodes. It can be seamlessly connected to the Tencent Cloud CloudBase BaaS platform and developer tools like Cursor and FastGPT through standard protocols like the Model Context Protocol (MCP) and REST.
When you look at these products together, what Tencent Cloud Database is doing becomes clear: re-architecting the entire data infrastructure stack for the age of AI agents, using AI-native thinking. From the underlying database engine, to the mid-layer memory and ops capabilities, and up to the top-level developer experience—every layer is being reimagined. And Agent Memory is the piece most directly connected to developers. It directly solves a problem everyone encounters: how to make AI actually remember you.
https://github.com/TencentCloud/TencentDB-Agent-Memory
07 Follow for More Open Source Discoveries
This account has a history of publishing many fascinating open-source projects. If you'd rather not scroll through old articles, just follow the "逛逛 GitHub" (Explore GitHub) account and chat with it directly.