Ever watched your AI agent forget what it was doing halfway through a task? Yeah, me too. I’ve pumped thousands of tokens into context windows only to have my agent treat each new turn like a fresh start. The problem isn’t the LLM — it’s that most agent memory systems are flat vector stores with no structure.
The short version: TencentDB Agent Memory (8,061★ on GitHub) is an open-source memory layer that gives AI agents actual long-term recall. It uses a 4-tier pipeline — raw conversations, atomic facts, scene blocks, user personas — plus a Mermaid-based short-term compression that cuts token usage by over 60%. Plus, it runs fully local with zero external API dependencies.
So I tested this on my Ryzen 9 workstation last night. Here’s what I found.
What Makes It Different
But most agent memory tools dump everything into a flat vector database. Still, search works. Yet recall is a black box — you get scores back with no way to trace why something was returned. TencentDB’s approach? Radically different.
Now they structure memory in layers:
| Layer | What It Stores | Format | Drill-Down Path |
|---|---|---|---|
| L3 Persona | User preferences, voice, long-term goals | Plain Markdown (persona.md) |
Traces to L2 Scenarios |
| L2 Scenario | Scene blocks, project context | Markdown blocks | Links to L1 Atoms |
| L1 Atom | Atomic facts, specific details | Structured records | Links to L0 raw text |
| L0 Conversation | Raw dialogue, full logs | Database (SQLite) | Full-text retrieval |
So when your agent remembers “oh, this user prefers verbose error messages with stack traces,” it’s not a lucky semantic match — it’s pulling from a structured Persona profile that was built over time.
The second trick is short-term compression using Mermaid graphs. Instead of dumping 100K tokens of tool output into context, TencentDB offloads the full text to local files and injects a compact Mermaid canvas. The agent reasons over the symbol graph and drills down to raw text only when needed. Their benchmarks show this cuts token usage by 61.38% on WideSearch, and the pass rate bump? 51.52%.
Getting Started
But the quick start is genuinely painless. If you use OpenClaw:
openclaw plugins install @tencentdb-agent-memory/memory-tencentdb
openclaw gateway restart
Then enable it in ~/.openclaw/openclaw.json with "memory-tencentdb": {"enabled": true}. That’s it — it starts capturing, extracting, and recalling automatically.
For Hermes (which I use daily), there’s a Docker image or a manual plugin installation path. I went the manual route:
mkdir -p ~/.memory-tencentdb
cd ~/.memory-tencentdb
npm install @tencentdb-agent-memory/memory-tencentdb@latest
Now link it into Hermes’s plugin directory and add the provider config. Took me about 15 minutes from zero to curl localhost:8420/health returning {"status":"ok"}. If you’re building repeatable agent workflows, I’ve also been testing Loopy — an agent loop library that pairs well with a solid memory layer like this one.
If you want this memory layer running 24/7 without burning through your workstation’s power bill, spin it up on a Vultr VPS instead — their $6/mo cloud instances handle the SQLite + sqlite-vec stack comfortably, and you get remote access from anywhere.
But what surprised me most was the white-box debugging. All the memory artifacts live under ~/.openclaw/memory-tdai/ as plain files. No black box. So I could open persona.md and see exactly what the system had learned about my preferences. That transparency is rare in this space.
What to Watch Out For
Still, it’s not perfect. The OpenClaw plugin requires a patch script to hook after-tool-call messages for the compression to work properly. That’s a manual step that could break on OpenClaw upgrades. Also, the Mermaid-based compression is optional and disabled by default — you have to know to turn it on.
Though it runs fully local out of the box (SQLite + sqlite-vec), the production docs heavily push Tencent Cloud’s vector database. Still, the local setup is straightforward. But the vendor lock-in whisper is there if you scale up.
If you’d rather avoid cloud vendor dependency, you can self-host the full TencentDB Agent Memory stack on a DigitalOcean Droplet for $6/mo — the same SQLite-based pipeline runs identically on a cloud VM, and you get a free $200 credit to start.
Bottom Line
So here’s my take: TencentDB Agent Memory is one of the best designed open-source agent memory systems I’ve tested in months. Still, it’s early days — the plugin needs patching and Mermaid compression isn’t on by default. But the architecture is solid. If you’re running OpenClaw or Hermes and your agents feel forgetful, spend 15 minutes trying it. Zero API credits needed. Other tools I’ve covered today, like FableCut’s MCP-based video editor, show how the agent ecosystem is maturing fast.
Disclosure: Some links below are affiliate links. If you sign up through them, I may earn a commission at no extra cost to you.
- Vultr — starts at $6/mo
- DigitalOcean — $200 credit for new users