Tencent Cloud's database team has open-sourced TencentDB Agent Memory, a local-first memory engine for AI agents. It defaults to SQLite with sqlite-vec as the local backend, can be installed as an OpenClaw plugin, and supports Hermes Gateway integration.
The core idea isn't to dump chat history into a vector database. Instead, it splits memory into two structures. Long-term memory is organized in layers: L0 for raw conversation, L1 for atomic facts, L2 for scene chunks, and L3 for user profiles. Short-term task memory externalizes lengthy tool logs into refs files, writes step summaries to jsonl, and uses Mermaid diagrams to preserve task structure and node indices.
In workflows with 30+ steps, the agent only reads lightweight Mermaid structure diagrams most of the time, diving back into raw logs by node_id when needed. Benchmarks show that after integrating OpenClaw, token consumption on the WideSearch task dropped from 221.31M to 85.64M (a 61.38% reduction), with a relative pass rate improvement of 51.52%. On the PersonaMem long-term memory benchmark, accuracy rose from 48% to 76%. The value of this design is that it doesn't compress history into a single summary; it preserves a complete trace from high-level profiles and task canvases all the way back to the original text.
