Primary question: Does the L0→L1→L2→L3 progressive pipeline produce useful persona and scene memory on your agent workload without external API calls?
RepoDaily adoption score
RepoDaily rates this as 91/100 (strong) for adoption: evidence, installation path, production risk, differentiation, license clarity, and AI/agent fit are scored from the article sources and adoption notes.
5 source(s) across 4 source category/categories, plus a RepoDaily-specific evidence module when available.
6 workflow step(s), 6 next-action step(s), and 4 command/install signal(s) were detected.
Trending momentum is +625 stars, with maintenance/release/issue signals counted when present.
Risk is marked medium, with 5 security note(s) and 4 explicit skip condition(s).
3 opportunity lens item(s), 4 alternative(s), and 3 type-specific section(s) support differentiation.
License source or license wording is present.
6 AI/agent-related signal(s) were detected in the article text and metadata.
Project overview
TencentDB Agent Memory is an MIT-licensed TypeScript plugin published as @tencentdb-agent-memory/memory-tencentdb at version 0.3.6. It gives AI agents a persistent memory system built on a four-layer progressive pipeline: L0 captures raw conversation, L1 extracts structured records, L2 aggregates scenes, and L3 constructs user personas. The entire pipeline runs locally using SQLite with sqlite-vec 0.1.7-alpha.2 for vector search and an optional local LLM via node-llama-cpp, with zero external API dependencies by default.
The plugin integrates primarily with OpenClaw (>= 2026.3.13) through a plugin manifest at openclaw.plugin.json and a hooks system under src/hooks/. A secondary adapter lives in hermes-plugin/ for the Hermes agent framework. Development requires no build step because Node.js 22.16+ supports native TypeScript type stripping — OpenClaw loads .ts source files directly at runtime.
According to the README, when integrated with OpenClaw the plugin cut token usage by 61.38% on the WideSearch benchmark (221.31M → 85.64M tokens), improved pass rate by 51.52% relative (33% → 50%), and raised PersonaMem accuracy from 48% to 76%. On SWE-bench, token usage dropped 33.09% (3474.1M → 2375.4M) with pass rate rising from 58.4% to 64.2%. These benchmarks ran over continuous long-horizon sessions of 50 consecutive tasks each.
Why it is trending now
- 625 period stars at trending rank 10, signaling strong developer interest in local agent memory solutions
- Claims 61.38% token reduction and 51.52% relative pass-rate improvement on WideSearch when paired with OpenClaw — concrete numbers, not vague claims
- Fully local architecture: SQLite + sqlite-vec vector search with optional node-llama-cpp, no mandatory external API calls
- Published under the TencentCloud organization with an MIT license, giving it enterprise credibility for a memory infrastructure component
- Version 0.3.6 shipped less than two months before the trend date (2026-05-27), adding recall context budgets, multi-language prompt adaptation, and gateway security features
Problem it solves
- Flat vector stores shred conversations into disconnected fragments, making recall a blind search with no macro-level guidance — the README explicitly rejects this pattern
- Agents waste tokens re-explaining SOPs, project context, tool conventions, and output formats that should persist across sessions
- Brute-force history accumulation inflates context windows; irreversible lossy summarization discards information that later proves necessary
- Sending conversation data to external embedding APIs creates privacy and data-sovereignty concerns for enterprise deployments
- Long-horizon agents running 50+ consecutive tasks accumulate context pressure that degrades both recall quality and token efficiency
How it works
- L0 Conversation layer (src/conversation/): captures raw dialogue into JSONL shards, with daily sharding boundaries now configurable via the timezone setting
- L1 Record layer (src/record/): extracts structured information from L0 data, including deduplication and extraction prompts that adapt to the user's input language automatically
- L2 Scene layer (src/scene/): aggregates records into scene summaries with snapshot-and-restore protection — if LLM extraction fails, BackupManager.restoreLatestDirectory recovers from the latest backup instead of leaving scene_blocks/ half-written
- L3 Persona layer (src/persona/): constructs user profiles from accumulated scenes, writing persona.md files with structured sections whose field names stay in English as a stable contract while free-text content follows the user's language
- Storage layer (src/store/): persists to SQLite or TCVDB with timestamps always stored as UTC instants; the migrate-sqlite-to-tcvdb CLI handles database migration between backends
- Symbolic short-term memory: condenses heavy tool logs into compact Mermaid symbols to reduce token consumption within active tasks, separate from the long-term layered pipeline
Product demo and interface preview


Architecture Read: L0→L1→L2→L3 Pipeline and Storage
The source tree maps directly to the four-tier pipeline. src/conversation/ handles L0 raw capture, src/record/ does L1 extraction, src/scene/ performs L2 aggregation, and src/persona/ builds L3 profiles. The storage layer at src/store/ abstracts SQLite and TCVDB behind a common interface, with sqlite-vec 0.1.7-alpha.2 providing vector similarity search.
The plugin entry point is index.ts, declared in openclaw.plugin.json with a pluginApi compatibility requirement of >= 2026.3.13. The package.json main field points to ./dist/index.mjs, built via tsdown. Three CLI binaries ship with the package: migrate-sqlite-to-tcvdb, export-tencent-vdb, and read-local-memory, each with its own tsconfig.json under scripts/.
Key dependencies reveal the technology choices: @ai-sdk/openai (^3.0.53) for LLM communication, @node-rs/jieba (^2.0.1) for Chinese tokenization, js-tiktoken for token counting, zod (^4.4.3) for schema validation, and undici (^8.1.0) for HTTP. The optional opik dependency (^1.0.0) provides observability integration. Peer dependencies on node-llama-cpp (^3.16.2) and openclaw (>= 2026.3.7) are both marked optional in peerDependenciesMeta.
Integration Surface: OpenClaw, Hermes, and Configuration
- OpenClaw integration: install via openclaw plugins install --link . to register the local directory as a plugin; restart the Gateway after code changes
- Hermes integration: hermes-plugin/ directory contains the adapter; the Python client supports MEMORY_TENCENTDB_GATEWAY_API_KEY for automatic Bearer header injection
- Gateway security: server.apiKey / TDAI_GATEWAY_API_KEY enables Bearer auth on all non-/health routes using crypto.timingSafeEqual to prevent timing attacks
- CORS control: server.corsOrigins / TDAI_CORS_ORIGINS accepts explicit origin lists; empty list disables CORS headers, "*" preserves legacy permissive behavior
- Recall budget: recall.maxCharsPerMemory and recall.maxTotalRecallChars (default 0 = unchanged) trim oversized entries before injection into <relevant-memories>
- Embedding compatibility: embedding.sendDimensions (default true) can be set to false for fixed-dimension models like BGE-M3 that reject the dimensions field with HTTP 400
- Reasoning model control: llm.disableThinking and offload.disableThinking support vllm, deepseek, dashscope, openai, anthropic, kimi, and gemini strategies for disabling chain-of-thought
Try-It Path: From Clone to Running Plugin
- Prerequisites: Node.js >= 22.16.0, npm or pnpm, OpenClaw >= 2026.3.13
- Clone: git clone https://github.com/Tencent/TencentDB-Agent-Memory.git
- Install dependencies: npm install (the postinstall script patches OpenClaw tool-call messages)
- Register as local plugin: openclaw plugins install --link .
- No build step needed for development — Node 22.16+ type stripping lets OpenClaw load .ts directly
- Read captured memory: node ./bin/read-local-memory.mjs to inspect stored conversations and extracted layers
- Run tests: npm test executes vitest run; npm run test:coverage adds coverage via @vitest/coverage-v8
Who should pay attention?
Good fit if
- OpenClaw-based agent deployments where cross-session memory persistence directly reduces operational token costs
- Privacy-sensitive or air-gapped environments that cannot send conversation data to external embedding or LLM APIs
- Long-horizon agent workflows (50+ consecutive tasks) where context accumulation pressure degrades performance
- Chinese-language agent applications — @node-rs/jieba tokenization and multi-language prompt adaptation are first-class features
- Teams evaluating local LLM offloading via node-llama-cpp who need structured memory alongside inference
Skip for now if
- Projects not using OpenClaw or Hermes as their agent framework — the plugin manifest and hooks are tightly coupled to these runtimes
- Environments running Node.js below 22.16 — the engines field and type-stripping requirement are hard constraints
- Use cases requiring only simple RAG retrieval without progressive layering — the four-tier pipeline adds complexity that flat-store solutions avoid
- Teams that need production-grade stability guarantees — version 0.3.6 with an Unreleased section in the changelog indicates active churn
Risks and cautions
Functional and locally deployable today, but version 0.3.6 with an active Unreleased section, alpha-grade sqlite-vec dependency, and hard coupling to OpenClaw/Hermes runtimes create integration and stability uncertainty.
- sqlite-vec 0.1.7-alpha.2 is an alpha-version dependency for the core vector search capability
- The Unreleased section in CHANGELOG.md describes timezone, disableThinking, and backup-restore changes that may alter behavior before the next stable tag
- OpenClaw >= 2026.3.13 is required for the plugin API; teams without OpenClaw cannot use the primary integration path
- The postinstall script runs scripts/openclaw-after-tool-call-messages.patch.sh, which patches the OpenClaw runtime — non-trivial for CI/CD environments
- L2 scene extraction data-loss bug (#88) was fixed in 0.3.6, indicating the scene layer had reliability issues in prior versions
- MIT license with standard warranty disclaimer — confirmed in the LICENSE file
- Gateway Bearer auth uses crypto.timingSafeEqual to prevent timing side-channel attacks on API key comparison
- CORS whitelist defaults to disabled (empty list = no CORS headers sent), with explicit opt-in required for cross-origin access
- Gateway startup prints a security posture summary and emits a WARN when bound to non-loopback addresses without an apiKey
- All timestamps stored as UTC instants in SQLite/TCVDB regardless of configured timezone, preventing timezone-related data corruption
Alternatives to compare
| Approach | When to use | Trade-off |
|---|---|---|
mem0 | You need a hosted or self-hosted memory layer that works across multiple agent frameworks, not just OpenClaw/Hermes | Open source (Apache 2.0) with hosted cloud tier |
Letta (formerly MemGPT) | You want OS-level memory management with a REST API and don't need the four-tier progressive layering model | Open source with managed cloud option |
Zep | You need temporal knowledge graphs from conversation history and prefer a GraphRAG approach over persona/scene layering | Open source (Apache 2.0) with cloud offering |
LangGraph checkpointers with SQLite/Postgres | You already use LangGraph and need simpler state persistence without a dedicated memory abstraction layer | Free, bundled with LangGraph |
What this trend reveals
Air-gapped enterprise agent deployments
Government, healthcare, and financial institutions that cannot send conversation data to OpenAI or Anthropic embedding APIs can deploy this plugin with a local LLM via node-llama-cpp and SQLite storage. The zero-external-API design and UTC-instant storage model address common compliance requirements.
Check whether your security team approves of sqlite-vec alpha in production; verify node-llama-cpp model quality on your hardware for L1–L3 extraction prompts.
Chinese-language agent applications
The @node-rs/jieba dependency and automatic multi-language prompt adaptation (issue #38) make this plugin particularly suited for Chinese-language agent workflows, where tokenization quality directly affects L1 extraction and L2 scene quality.
Run a 50-conversation session in Chinese and inspect persona.md output via read-local-memory to verify extraction quality matches your domain vocabulary.
Token cost reduction at scale
The 61.38% token reduction on WideSearch translates directly to inference cost savings. For agents running millions of tokens per day, even a fraction of this reduction justifies the integration effort.
Reproduce the WideSearch or SWE-bench benchmark with your agent's actual workload to confirm token savings hold outside the reported test conditions.
RepoDaily verdict
TencentDB Agent Memory offers a technically distinctive approach to agent memory — progressive four-tier layering with local SQLite vector search and zero external API dependencies. The benchmark numbers are compelling, the MIT license and TypeScript source lower adoption friction, and the security features (timing-safe auth, CORS control, UTC storage) show production awareness. The main caveats are the alpha sqlite-vec dependency, tight OpenClaw coupling, and the active Unreleased changelog. For OpenClaw-based teams who need persistent memory without external API calls, this is worth a focused evaluation session.