TencentDB Agent Memory is a persistent, multi-layer memory service for AI agents — its guiding idea is to let an agent's experience sediment into reusable assets so the next session can "load from save." The system is organized as a four-layer pipeline — L0 (raw conversation) → L1 (atomic facts) → L2 (scene summaries) → L3 (user persona) — replacing flat vector storage with a semantic pyramid where the Persona layer carries day-to-day preferences and the system drills down to Atoms only when details matter. It began as an embedded plugin for the OpenClaw coding-agent host and was later extracted into a standalone Gateway service; the codebase now supports OpenClaw, Hermes, and generic HTTP hosts through a host-neutral TdaiCore layer with HostAdapter and LLMRunner abstractions. The package is distributed as an ES module under the MIT license, with the core engine in TypeScript and a Python memory_tencentdb adapter for Hermes.
The Setup & distribution section — with its child pages Package & distribution, Installation & deployment, and Upgrading — covers how to install, configure, and migrate between the 0.x plugin line and the 1.x standalone service line. The Memory architecture section explains the memory model itself: Architecture & memory layers walks through the L0→L1→L2→L3 pyramid, Context Offload covers the independent short-term compression subsystem, and Seed & CLI documents the offline pipeline runner. The TdaiCore & host abstraction section documents the host-neutral core and its per-layer implementations — L0 capture, L1 extraction & dedup, L2 scene extraction, L3 persona generation, Pipeline scheduling, and Recall & context injection. The Storage abstraction section defines the IMemoryStore contract and its concrete backends in SQLite backend, TCVDB backend, and Embedding services. The Integrations & hosts section covers host-specific wiring in OpenClaw integration and Hermes & Gateway hosts, while Features & tools groups user-facing capabilities — Configuration, Search tools, and LLM thinking suppression. The Benchmarks & results and Bug fixes sections capture measured performance on long-horizon agent tasks and the architecturally-significant fixes that shaped the current codebase.
If you want to understand how the memory model works before touching anything, read Architecture & memory layers first, then Recall & context injection to see how memories are actually surfaced to the LLM. If you are installing the plugin into an OpenClaw or Hermes host, start with Installation & deployment, then read OpenClaw integration or Hermes & Gateway hosts depending on your host, and consult Configuration for the tunable fields. If you are adding a feature or a new storage backend, begin with TdaiCore & host abstraction to understand the boundary interfaces, then Storage abstraction for the IMemoryStore contract and factory. If you are debugging a failed extraction, missing recall, or an upgrade regression, jump to Pipeline scheduling, the relevant layer page (L1 extraction & dedup, L2 scene extraction, or L3 persona generation), and cross-reference Bug fixes and Upgrading for known breakages.