TencentDB Agent Memory: Local Long-Term Memory for AI Agents Without Vector DBs

By Prahlad Menon 2 min read

Tencent just open-sourced TencentDB Agent Memory, a fully local long-term memory system for AI agents that runs on plain SQLite. No cloud vector databases. No external API dependencies. No repeating yourself every session.

The benchmarks are impressive:

  • 61% fewer tokens used on complex tasks
  • PersonaMem accuracy jumped from 48% → 76%
  • 51% improvement in task success rate on WideSearch benchmark

Why This Matters

Most memory systems for AI agents work by compressing history into opaque vector embeddings, then hoping similarity search surfaces what’s needed. The recall is unpredictable — sometimes brilliant, sometimes completely missing critical context.

TencentDB takes a fundamentally different approach: semantic layering instead of flat storage.

The 4-Tier Memory Pyramid

Instead of dumping everything into a vector store, TencentDB builds a hierarchical memory structure:

LayerNamePurpose
L0ConversationRaw dialogue history
L1AtomExtracted atomic facts
L2ScenarioScene blocks and patterns
L3PersonaUser profile and preferences

The agent works primarily with the top layers (Persona, Scenario) which are compact and contextually rich. When proof is needed, it can drill back via node_id to the exact raw log at L0.

Symbolic Memory with Mermaid

Here’s the clever part: short-term state is encoded as a Mermaid graph in context. Verbose tool logs get offloaded to disk. The agent reasons over the lightweight symbol graph, and only retrieves full details when needed.

This means an agent working through a complex multi-step task doesn’t fill its context window with raw error traces and search results. It keeps a symbolic map, with drill-down capability.

How It Compares

BenchmarkOpenClaw BaseWith TencentDB MemoryImprovement
WideSearch Success33%50%+51.52%
SWE-bench Success58.4%64.2%+9.93%
PersonaMem Accuracy48%76%+59%
WideSearch Tokens221M85M-61.38%

These aren’t isolated turn measurements — they’re continuous long-horizon sessions. SWE-bench runs 50 consecutive tasks per session to simulate real-world context accumulation.

Integration

The memory system ships as an OpenClaw plugin:

openclaw plugins install @tencentdb-agent-memory/memory-tencentdb
openclaw gateway restart

It also works with their Hermes framework and can be adapted for other agent architectures.

The Philosophy

From their README:

Memory is not about hoarding everything in the AI — it is about sparing humans from having to repeat themselves.

This resonates. The goal isn’t to remember more, but to remember better — surfacing the right context at the right time without bloating the context window.

The full traceability aspect is also notable. Every high-level abstraction maintains a deterministic path back to ground truth. You can always verify where a preference or decision came from.

Bottom Line

If you’re building AI agents that need to maintain state across sessions without cloud dependencies, this is worth exploring. The layered approach is more principled than vector-search-and-hope, and the token efficiency gains are real.

Links: