# TencentDB Agent Memory Core Components: The 4-Service Architecture

> Discover the four core components of TencentDB Agent Memory: MemoryCore, MemoryPanel, MemoryKnowledge, and MemoryProxy. Learn how this architecture enables AI agents to share contextual memory.

- Repository: [Tencent Cloud/TencentDB-Agent-Memory](https://github.com/TencentCloud/TencentDB-Agent-Memory)
- Tags: architecture
- Published: 2026-09-01

---

**TencentDB Agent Memory is built on four distinct services—MemoryCore, MemoryPanel, MemoryKnowledge, and MemoryProxy—that separate storage, ingestion, administration, and LLM routing concerns to enable teams of AI agents to share reusable contextual memory.**

The TencentCloud/TencentDB-Agent-Memory repository implements these core components as independent micro-services, allowing scalable deployment of a layered memory system (L0-L3) for coding agents. Understanding how these four services interact is critical for architects integrating the platform with existing agent workflows such as Claude Code or CodeBuddy.

## MemoryCore – The Memory Engine and Gateway

**MemoryCore** serves as the central persistence and API layer for the entire system. It implements the **layered memory model (L0-L3)** and stores four primary asset types: **Chat Memory**, **Skills**, **Wiki** pages, and **CodeGraph** symbols.

This component exposes all functionality through a RESTful `/v3/*` HTTP API and manages background pipelines for data extraction and indexing. According to the source implementation in [`MemoryCore/src/gateway/chat-memory-handlers.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryCore/src/gateway/chat-memory-handlers.ts), the gateway handles CRUD operations for conversational context and asset retrieval.

The component also enforces data ownership and versioning policies. Background workers process incoming memory streams to build searchable indices, ensuring that agent queries against the memory store remain performant even as the knowledge base scales.

```typescript
// Conceptual usage of the MemoryCore v3 API
// Based on MemoryCore/v3-api-memorycore-doc.md
async function storeChatMemory(userId: string, memory: MemoryLayer) {
  const response = await fetch('http://memorycore:8080/v3/chat-memory', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      user_id: userId,
      layer: 'L1', // Working memory layer
      data: memory
    })
  });
  return response.json();
}

```

## MemoryPanel – Administrative Control Interface

**MemoryPanel** provides the web-based control plane for TencentDB Agent Memory. This service offers a user interface where teams create users and agents, manage ACLs (access control lists), and trigger bulk imports of documentation.

All panel actions proxy through to MemoryCore. The routing logic in [`MemoryPanel/src/panel/http/routes/chat-memory.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryPanel/src/panel/http/routes/chat-memory.ts) defines the administrative endpoints for querying and modifying Chat Memory assets. The service exposes its own API surface, documented in [`MemoryPanel/panel-api-doc.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryPanel/panel-api-doc.md), which wraps the underlying MemoryCore operations with additional permission checks.

Administrators use this interface to configure which Skills and Wiki collections are available to specific agent identities, effectively curating the context window that agents will retrieve during conversations.

```typescript
// Example route handler structure from MemoryPanel
// Located in MemoryPanel/src/panel/http/routes/chat-memory.ts
router.post('/admin/chat-memory/query', async (req, res) => {
  const { userId, filters } = req.body;
  // Forward to MemoryCore with admin credentials
  const memories = await memoryCoreClient.query(userId, filters);
  res.json({ memories });
});

```

## MemoryKnowledge – Document and Code Ingestion

**MemoryKnowledge** operates as a dedicated micro-service for **knowledge ingestion**, converting raw documents and source code into structured **Wiki** pages and **CodeGraph** symbols. This component builds link graphs between related concepts and pushes the processed data back to MemoryCore.

Running as an independent service with its own `/v3/*` endpoints, MemoryKnowledge handles the computationally intensive task of parsing repositories and documentation sets. The implementation in [`MemoryKnowledge/src/store/wiki-service.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryKnowledge/src/store/wiki-service.ts) manages the transformation pipeline from raw text to vectorized, link-enhanced knowledge assets.

This separation allows ingestion to scale independently from real-time memory queries. Once processed, Wiki entries and CodeGraph nodes become available to agents through MemoryCore's retrieval APIs.

```typescript
// Conceptual ingestion flow based on 
// MemoryKnowledge/src/store/wiki-service.ts
class WikiService {
  async ingestDocument(docPath: string, projectId: string) {
    const parsed = await this.parser.extract(docPath);
    const graph = await this.linkBuilder.build(parsed.links);
    // Sync to MemoryCore via internal API
    await this.syncToMemoryCore({
      type: 'wiki',
      project_id: projectId,
      content: parsed.content,
      graph_links: graph
    });
  }
}

```

## MemoryProxy – Transparent LLM Interceptor

**MemoryProxy** sits transparently between coding agents (such as Claude Code or CodeBuddy) and their LLM providers. Unlike the other components, **MemoryProxy does not store memory locally**; instead, it intercepts outbound LLM requests, enriches them with relevant context retrieved from MemoryCore, and forwards the enhanced prompt.

The proxy logic in [`MemoryProxy/src/workbuddyHandler.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/src/workbuddyHandler.ts) demonstrates how the system injects **identity information**, **Skills**, and **Chat Memory** into requests without modifying the agent's core logic. This design allows existing agents to benefit from shared memory without code changes.

Because all memory reads and writes route through MemoryCore, MemoryProxy remains stateless and horizontally scalable. The [`MemoryProxy/README.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/README.md) outlines configuration options for connecting the proxy to different agent frameworks and LLM backends.

```typescript
// Simplified proxy handler logic based on
// MemoryProxy/src/workbuddyHandler.ts
export class WorkBuddyHandler {
  private memoryCoreClient: MemoryCoreClient;
  
  async handleRequest(request: LLMRequest, context: AgentContext) {
    // Fetch relevant memory from MemoryCore
    const relevantMemory = await this.memoryCoreClient.retrieve(
      context.userId,
      context.currentQuery,
      { limit: 5 }
    );
    
    // Inject into system prompt
    const enrichedPrompt = this.buildPrompt(request, relevantMemory);
    
    // Forward to actual LLM provider
    return this.llmProvider.complete(enrichedPrompt);
  }
}

```

## Client SDKs and Integration Libraries

TencentDB Agent Memory provides **language-specific SDKs** that wrap the HTTP APIs of the core components. The TypeScript SDK, with entry points such as [`sdk/memory-core/typescript/src/v3/skill-types.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/sdk/memory-core/typescript/src/v3/skill-types.ts), offers type-safe interfaces for Skill definitions and memory operations.

These libraries abstract the `/v3/*` endpoints, allowing developers to interact with MemoryCore, MemoryKnowledge, and MemoryProxy programmatically without manually constructing HTTP requests.

```typescript
// Example using the TypeScript SDK
// Based on sdk/memory-core/typescript/src/v3/skill-types.ts
import { SkillClient, SkillDefinition } from '@tencentdb/memory-core';

const skillClient = new SkillClient({ endpoint: 'http://memorycore:8080' });

const skill: SkillDefinition = {
  name: 'database_optimization',
  description: 'Analyzes SQL queries for performance improvements',
  parameters: {
    query: 'string',
    database_type: 'mysql|postgresql'
  }
};

await skillClient.register(skill);

```

## Summary

The TencentDB Agent Memory core components form a modular architecture that decouples persistence, ingestion, administration, and LLM integration:

- **MemoryCore** manages the L0-L3 memory layers and exposes the primary `/v3/*` storage API via [`MemoryCore/src/gateway/chat-memory-handlers.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryCore/src/gateway/chat-memory-handlers.ts).
- **MemoryPanel** provides the administrative interface and ACL management through routes defined in [`MemoryPanel/src/panel/http/routes/chat-memory.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryPanel/src/panel/http/routes/chat-memory.ts).
- **MemoryKnowledge** handles document parsing and CodeGraph generation independently, syncing results to MemoryCore via [`MemoryKnowledge/src/store/wiki-service.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryKnowledge/src/store/wiki-service.ts).
- **MemoryProxy** transparently enriches LLM requests with memory context without storing state locally, implemented in [`MemoryProxy/src/workbuddyHandler.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/src/workbuddyHandler.ts).

Together with the TypeScript and Python SDKs, these services enable agents to share contextual memory while maintaining clear separation of concerns.

## Frequently Asked Questions

### What is the layered memory model (L0-L3) in MemoryCore?

MemoryCore implements a four-tier hierarchy where **L0** represents raw conversation history, **L1** contains extracted working memory, **L2** holds curated long-term facts, and **L3** stores permanent organizational knowledge. This tiering allows agents to retrieve context at appropriate granularities, with higher layers providing more compact, relevant information for LLM prompts. The implementation details are visible in [`MemoryCore/src/gateway/chat-memory-handlers.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryCore/src/gateway/chat-memory-handlers.ts) and the API documentation at [`MemoryCore/v3-api-memorycore-doc.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryCore/v3-api-memorycore-doc.md).

### How does MemoryProxy differ from MemoryCore?

**MemoryProxy** is a stateless interceptor that forwards LLM requests to providers after enriching them with data retrieved from MemoryCore, whereas **MemoryCore** is the authoritative storage layer for all Chat Memory, Skills, Wiki, and CodeGraph assets. According to [`MemoryProxy/src/workbuddyHandler.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/src/workbuddyHandler.ts), the proxy never persists memory itself; all read and write operations route through MemoryCore's `/v3/*` endpoints, ensuring a single source of truth across the architecture.

### Can TencentDB Agent Memory integrate with custom agents outside of Claude Code?

Yes. While the repository provides specific handlers for Claude Code and CodeBuddy in [`MemoryProxy/src/workbuddyHandler.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/src/workbuddyHandler.ts), the **MemoryProxy** component is designed to sit transparently in front of any HTTP-compatible LLM client. Developers can configure the proxy to intercept requests from custom agents, using the SDKs in `sdk/memory-core/typescript/src/v3/` or the raw `/v3/*` REST APIs to retrieve and format memory context for their specific agent architectures.

### What file formats does MemoryKnowledge process for Wiki and CodeGraph generation?

MemoryKnowledge processes standard documentation formats (Markdown, reStructuredText, HTML) and source code files to generate **Wiki** pages and **CodeGraph** symbols. The service implementation in [`MemoryKnowledge/src/store/wiki-service.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryKnowledge/src/store/wiki-service.ts) parses these inputs to build link graphs and hierarchical symbol trees, which are then synchronized to MemoryCore for retrieval by agents during code generation or analysis tasks.