TencentDB Agent Memory Architecture: The 4 Core Services Explained
TencentDB Agent Memory architecture comprises four tightly-coupled microservices—Memory Core, Memory Knowledge, Memory Proxy, and Memory Panel—that together provide a persistent, searchable knowledge base for LLM-driven agents.
TencentDB Agent Memory is an open-source memory layer designed for large language model (LLM) applications, hosted at TencentCloud/TencentDB-Agent-Memory. The TencentDB Agent Memory architecture adopts a microservices design that separates data ingestion, hierarchical storage, LLM proxying, and user management into discrete, horizontally scalable components.
The Four Core Services of TencentDB Agent Memory
The architecture is organized around four specialized services, each exposing a REST API on a dedicated port. Together, they form the Memory Hub that agents query, update, and share across teams.
| Service | Primary Role | Default Port | Key Source Reference |
|---|---|---|---|
| Memory Core | Pipeline execution and session state management | 8420 | MemoryCore/src/utils/stateful-pipeline-manager.ts |
| Memory Knowledge | Wiki and CodeGraph indexing with full-text/graph retrieval | 8421 | MemoryKnowledge/src/store/wiki-service.ts |
| Memory Proxy | LLM reverse-proxy with automatic memory injection | 8096 | MemoryProxy/v3-api-memoryproxy-doc.md |
| Memory Panel | Web UI for asset management and ACL control | 8125 | MemoryPanel/web/src/main.tsx |
Memory Core: Stateful Pipeline Processing
Memory Core executes the transformation pipeline that converts raw conversation data (L0) into layered memory assets (L1-L3) while maintaining durable session state. Implemented in TypeScript, the service exposes the v3 operational API under the /v3/* path.
According to the source code, the pipeline logic resides in MemoryCore/src/utils/stateful-pipeline-manager.ts, while gateway routing is configured in MemoryCore/tdai-gateway.yaml. This service listens on port 8420 and acts as the system of record for chat histories and structured skills.
Memory Knowledge: Document and Code Indexing
Memory Knowledge handles ingestion and indexing of Wiki pages and CodeGraph data, providing both full-text search and graph-based retrieval capabilities. The Wiki service implementation is located in MemoryKnowledge/src/store/wiki-service.ts, with API contracts documented in MemoryKnowledge/v3-api-memoryknowledge-doc.md.
Running on port 8421, this service enables semantic search across documentation repositories and source code relationships, feeding relevant context into agent prompts.
Memory Proxy: The LLM Reverse-Proxy Gateway
Memory Proxy serves as the intelligent gateway between agents and underlying LLM providers. It intercepts standard OpenAI-compatible calls—such as /v1/messages and /v1/chat/completions—and automatically injects retrieved memory assets into the request context.
Beyond proxying, the service exposes administrative operations for instance lifecycle management, rate-limit configuration, and session cache refresh, as specified in MemoryProxy/v3-api-memoryproxy-doc.md. It binds to port 8096.
Memory Panel: The Web Control Interface
Also referred to as Memory Hub, Memory Panel provides the human-facing control plane for the architecture. Teams use this React-based interface—entry point at MemoryPanel/web/src/main.tsx—to create agents, import Wiki and CodeGraph assets, manage Chat Memory and Skills, and configure access control bindings.
The Panel communicates with the three backend services via their REST APIs and serves on port 8125 by default. Its own OpenAPI specification is maintained in MemoryPanel/panel-api-doc.md.
How the Services Interact in the Memory Hub
The TencentDB Agent Memory architecture follows a specific data flow to enrich LLM calls with context:
- Request Ingress: Agents send LLM requests to Memory Proxy, which forwards the call to the underlying model while触发ing memory enrichment.
- Retrieval: Memory Proxy queries Memory Knowledge (for Wiki/CodeGraph context) and Memory Core (for Chat Memory and Skills) to retrieve relevant assets.
- Caching: Retrieved assets are cached in Memory Core and Memory Knowledge for fast reuse across subsequent requests.
- Management: Memory Panel provides administrators with interfaces to create teams, import data, review assets, and configure bindings and ACLs.
Deploying and Operating the Architecture
To initialize the stack, clone the repository and execute the bundled orchestration script:
git clone https://github.com/TencentCloud/TencentDB-Agent-Memory.git
cd TencentDB-Agent-Memory/deploy/global-images
cp .env.example .env # fill in LLM credentials
./start-all.sh # launches MemoryCore, MemoryKnowledge, and MemoryProxy
Once running, invoke the Proxy endpoint to generate a completion while automatically injecting memory assets:
curl -X POST http://localhost:8096/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-4o",
"messages": [{"role":"user","content":"Explain the recent architecture change"}],
"agent_id": "codebuddy",
"space_id": "my-team-01"
}'
Administrators can refresh a session’s injection cache via the ops API:
curl -X POST http://localhost:8096/v3/session/refresh-cache \
-H "Content-Type: application/json" \
-d '{"session_key":"sess_123","agent_source":"codebuddy","space_id":"my-team-01"}'
To query the Wiki index directly through the Knowledge service:
curl http://localhost:8421/v3/knowledge/wiki/search?q=authentication
Summary
- TencentDB Agent Memory architecture consists of four specialized microservices: Memory Core, Memory Knowledge, Memory Proxy, and Memory Panel.
- Memory Core (port 8420) manages the L0-L3 pipeline transformation and session state via
stateful-pipeline-manager.ts. - Memory Knowledge (port 8421) indexes Wiki and CodeGraph data for semantic retrieval.
- Memory Proxy (port 8096) acts as the LLM gateway, automatically injecting cached memory assets into completions.
- Memory Panel (port 8125) provides the web UI for asset management and team configuration.
- Services communicate via REST APIs, with Proxy orchestrating retrieval from Core and Knowledge before calling underlying LLMs.
Frequently Asked Questions
What is the default port for Memory Proxy in TencentDB Agent Memory?
Memory Proxy listens on port 8096 by default. This service functions as the LLM reverse-proxy, intercepting requests to /v1/chat/completions and enriching them with context from the other services before forwarding to the underlying model provider.
How does Memory Core process raw conversation data?
According to the source code in MemoryCore/src/utils/stateful-pipeline-manager.ts, Memory Core executes a stateful pipeline that transforms raw conversation data (L0) into layered memory assets (L1-L3). This includes entity extraction, summarization, and skill derivation, with all intermediate states persisted for session continuity.
What is the difference between Memory Panel and Memory Hub?
They are the same component. Memory Panel is the technical service name, while Memory Hub refers to its architectural role as the centralized control plane. The Panel runs on port 8125 and provides the React-based web interface found in MemoryPanel/web/src/main.tsx for managing agents, assets, and access controls.
Which service handles document indexing for Wiki pages?
Memory Knowledge (port 8421) is responsible for ingesting and indexing Wiki pages and CodeGraph data. Its implementation in MemoryKnowledge/src/store/wiki-service.ts provides both full-text and graph-based search capabilities, exposing endpoints like /v3/knowledge/wiki/search for document retrieval.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →