Most agent frameworks treat memory as session-scoped state that evaporates when the process exits. TencentDB Agent Memory flips that model: it treats agent conversations, code interactions, and document reads as raw material for four distinct memory asset types that persist, get governed by teams, and get shared across frameworks.
The project (9,962 stars, trending #4 for TypeScript) ships a three-service architecture: memory-core for storage and retrieval, memory-hub for the governance UI, and a proxy service that intercepts LLM calls to capture context. It integrates with OpenClaw and Hermes via MCP (Model Context Protocol) servers, so agents built in different frameworks can read and write the same memory assets without vendor lock-in.
Four Memory Asset Types
TencentDB Agent Memory partitions memory into four categories, each with different lifecycle rules and retrieval semantics:
| Memory Type | Source Material | Promotion Trigger | Retrieval Scope |
|---|---|---|---|
| Chat Memory | Agent conversation turns | Automatic on every exchange | Session-scoped, then team-scoped after approval |
| Skill | Tool calls, function signatures, execution results | Manual promotion or pattern detection | Cross-session, team-shared library |
| LLM-Wiki | Documents, web pages, knowledge base entries | User-initiated import or agent annotation | Global knowledge graph with vector search |
| Code-Graph | Repository structure, function definitions, call graphs | Static analysis on code commits | Dependency-aware, supports semantic code search |
Chat Memory starts as ephemeral session state. When a conversation produces a useful pattern (a debugging sequence, a decision rationale), a team member can promote it to a governed asset. The promotion flow writes the conversation fragment to the memory-hub database and indexes it for vector retrieval.
Skill assets capture reusable tool invocations. If an agent successfully calls a Slack API to post a message, that call signature and parameter schema get stored. Future agents can retrieve the skill by semantic search (“how do I post to Slack”) and reuse the exact invocation pattern.
LLM-Wiki is a vector-indexed knowledge base. You feed it Markdown files, PDFs, or web scrapes. The system chunks the content, embeds it, and stores it in TencentDB’s vector search layer. Agents query it with natural language and get back ranked passages.
Code-Graph runs static analysis on your repositories. It parses function definitions, imports, and call sites, then builds a dependency graph. When an agent asks “what calls this function,” the graph walker returns the call chain without running a full-text search.
Governance Layer
The memory-hub service provides approval gates and access control. When an agent or human promotes a chat fragment to a Skill, the promotion request lands in a review queue. Team admins see the proposed asset, its source conversation, and its intended scope (private, team, org-wide). They approve or reject.
Access control uses team boundaries. A memory asset tagged team:backend is invisible to agents running in team:frontend context. The memory-core service enforces this at query time: when an agent requests similar skills, the retrieval filter includes team_id IN (user_teams).
The governance model prevents memory pollution. Without approval gates, every agent conversation would flood the shared memory pool with low-signal fragments. The review step acts as a quality filter.
MCP Server Integration
TencentDB Agent Memory exposes its memory assets via MCP servers. MCP is a protocol that lets agents discover and call external tools without hardcoding framework-specific adapters.
The project ships two MCP server implementations:
- OpenClaw Plugin: Registers memory retrieval as a tool in OpenClaw’s function-calling interface. When an OpenClaw agent needs context, it calls
memory.search({ query: "how to deploy", type: "skill" })and gets back ranked results. - Hermes Gateway: Exposes memory as a Hermes-compatible tool. Hermes agents see memory search as a native capability.
Both servers talk to the same memory-core backend. This means an OpenClaw agent can write a Skill, and a Hermes agent can retrieve it ten minutes later. The memory layer decouples agent framework choice from memory persistence.
Architecture: Three Services
The deployment model runs three containers:
services:
memory-core:
image: tencentdb-agent-memory/core
ports:
- "8123:8123"
environment:
- VECTOR_DB_URL=postgresql://memory:password@vectordb:5432/memory
- EMBEDDING_MODEL=text-embedding-3-small
- LLM_ENDPOINT=https://api.openai.com/v1
memory-hub:
image: tencentdb-agent-memory/hub
ports:
- "8125:8125"
environment:
- CORE_API_URL=http://memory-core:8123
proxy:
image: tencentdb-agent-memory/proxy
ports:
- "8124:8124"
environment:
- UPSTREAM_LLM=https://api.openai.com/v1
- CORE_API_URL=http://memory-core:8123
memory-core handles storage, embedding, and retrieval. It writes to a PostgreSQL instance with pgvector for vector search. When an agent queries for similar skills, memory-core embeds the query, runs a cosine similarity search, and returns the top-k results.
memory-hub is a React UI for governance. Team members browse pending promotions, approve or reject them, and configure team boundaries. It talks to memory-core over HTTP.
proxy sits between your agents and the LLM API. It intercepts every request, extracts the conversation context, and writes it to memory-core as Chat Memory. This happens transparently: your agent code doesn’t change. You point your LLM client at http://localhost:8124 instead of https://api.openai.com/v1, and the proxy captures everything.
The proxy also injects retrieved memory into the system prompt. If an agent’s query matches a Skill or LLM-Wiki entry, the proxy appends the memory content to the prompt before forwarding the request upstream.
State Management and Failure Modes
Memory-core uses PostgreSQL transactions for atomic writes. When you promote a chat fragment to a Skill, the write includes:
- Insert the skill metadata (name, description, team_id).
- Insert the embedding vector.
- Update the source chat record with a
promoted_to_skill_idforeign key.
If the embedding call fails (network timeout, rate limit), the transaction rolls back. The chat record stays unpromoted.
Retrieval failures are more subtle. If the vector search times out, memory-core falls back to full-text search on the skill description. If both fail, it returns an empty result set. The agent sees no memory and proceeds without context. This degrades gracefully but loses the memory advantage.
The proxy introduces a single point of failure. If it crashes, agents lose LLM access. The deployment guide recommends running the proxy behind a load balancer with health checks. If the proxy is down, the health check fails, and traffic routes to a backup instance.
Memory-core does not replicate state across instances. If you run two memory-core containers, they both write to the same PostgreSQL database, but they don’t coordinate in-memory caches. This can cause stale reads if one instance updates a skill and another instance serves a query before its cache invalidates. The fix is to disable caching or use Redis as a shared cache layer.
Code-Graph Implementation
Code-Graph runs a static analyzer on your repository. The analyzer is a separate service (not shown in the basic deployment) that watches a Git remote for new commits.
When a commit lands, the analyzer:
- Clones the repository.
- Parses source files with tree-sitter (supports TypeScript, Python, Go, Rust).
- Extracts function definitions, imports, and call sites.
- Builds a directed graph where nodes are functions and edges are calls.
- Writes the graph to memory-core as a Code-Graph asset.
Agents query the graph with natural language: “what functions call processPayment?” Memory-core translates the query into a graph traversal, walks the edges, and returns the call chain.
The analyzer does not run on every file change. It triggers on push events to the main branch. For large repositories, the initial analysis can take minutes. Incremental updates are faster because the analyzer diffs the commit and only re-parses changed files.
When to Use This
TencentDB Agent Memory makes sense when:
- You run multiple agents across different frameworks (OpenClaw, Hermes, custom) and want them to share context.
- Your agents produce reusable patterns (tool calls, decision trees) that you want to capture and govern.
- You need team-level access control on memory assets.
- You want to decouple memory persistence from agent session lifecycle.
Skip it if:
- You run a single agent in a single framework. The overhead of three services and a governance UI is not worth it.
- Your agents are stateless by design. If every invocation is independent, memory adds no value.
- You need real-time memory replication across regions. The current architecture does not support multi-region writes.
Technical Verdict
TencentDB Agent Memory solves the memory governance problem for multi-agent teams. The four-memory-type taxonomy (Chat, Skill, LLM-Wiki, Code-Graph) gives you clear boundaries for what to persist and how to retrieve it. The MCP server integration is the key unlock: it lets you write agents in any framework and still share memory.
The governance layer (approval gates, team boundaries) prevents memory pollution but adds operational overhead. You need someone to review promotions. For small teams, this is manageable. For large orgs, you will want automated approval rules (promote if confidence > 0.9, auto-approve for certain teams).
The proxy-based capture model is clever but fragile. If the proxy crashes, agents lose LLM access. Run it behind a load balancer. The lack of built-in replication for memory-core means you need to handle PostgreSQL high availability yourself.
Use this if you are building a multi-agent system with shared context needs and you can afford the operational complexity of three services. Skip it if you are prototyping a single agent or if your agents are stateless.