TencentDB Agent Memory structures long-term memory as a semantic pyramid — L0 raw conversations → L1 atomic facts → L2 scene summaries → L3 user persona — where the system defaults to coarse summaries but drills down to detailed facts only when needed. Short-term task context is encoded as lightweight Mermaid diagrams with full traceability back to raw tool logs, ensuring every symbol in the agent's working context maps to retrievable source data via mid-layer indices.
TencentDB Agent Memory implements a four-layer long-term memory pipeline — L0 (raw conversation) → L1 (atomic facts) → L2 (scene summaries) → L3 (user persona) — replacing flat vector storage with a semantic pyramid. The Persona layer carries day-to-day preferences; the system drills down to Atoms only when details matter.[1][2] Each layer's processing is handled locally, with zero external API dependencies: L0 records conversations to local JSONL automatically, L1 extracts structured facts via LLM with deduplication, L2 aggregates scene blocks via LLM scene extraction, and L3 synthesises a user persona via LLM.[2]
Short-term context is also structured in three sub-levels: the bottom layer archives raw tool outputs in refs/*.md files; the middle layer extracts step-level JSONL summaries; the top layer condenses state into a lightweight Mermaid canvas — the only layer injected into the agent's context.[1] Task state in the top layer is encoded in high-density Mermaid graph syntax rather than verbose prose or flat JSON, with full tool logs offloaded to external refs/*.md files and only a lightweight Mermaid task map plus node_id pointers remaining in context.[1]
A drill-down traceability guarantee spans all layers — top-layer symbol (Persona / canvas) → mid-layer index (Scenario / JSONL) → bottom-layer raw text (L0 conversation / refs) — ensuring no irreversible lossy compression.[1] Heterogeneous storage backs the two poles: bottom-layer facts, logs, and traces are persisted in databases for robust full-text retrieval, while top-layer personas, scenes, and canvases are stored as human-readable Markdown files for high information density and white-box inspection.[1] Out of the box the system defaults to a local SQLite + sqlite-vec backend, requiring no external database to get started — see SQLite backend for configuration details.[1]
With a single enabled: true flag, TencentDB Agent Memory automatically handles conversation capture, memory extraction, scene aggregation, persona generation, and recall before each new turn — no additional wiring is required.[1]
Sources