# What Is MemoryProxy in TencentDB Agent Memory? Architecture and Integration Guide

> Discover MemoryProxy in TencentDB Agent Memory. This HTTP service offers a stable gateway for AI agents to integrate with the Memory Hub, enabling zero-code shared memory.

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

---

**MemoryProxy is a lightweight HTTP service that provides a stable, protocol-consistent gateway between AI agents and the Memory Hub, enabling zero-code integration for shared memory assets.**

The TencentDB-Agent-Memory repository implements a distributed memory architecture designed to share context across AI coding agents. **MemoryProxy** serves as the critical abstraction layer that shields agents from internal Hub evolution while standardizing access to Chat Memory, Skills, Wiki, and CodeGraph resources.

## Core Architecture and Responsibilities

MemoryProxy operates as one of three coordinated services alongside **memory-core** and **memory-hub**. According to the repository documentation, these components launch together to form a complete memory infrastructure.

### Protocol Stability and Abstraction

By exposing an identical API surface to the Memory Hub, MemoryProxy acts as a **stable entry-point** that prevents breaking changes from affecting existing agent implementations. When the internal Hub architecture evolves, agents connecting through the Proxy require no code modifications because the Proxy maintains backward-compatible endpoints.

### Request Forwarding and Routing

MemoryProxy handles all agent-to-Hub communication through standardized HTTP routes. In [`proxy/router.go`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/proxy/router.go), the service defines handlers for agent-facing endpoints such as `/v3/tools/list` and `/v3/tools/call`, transparently forwarding requests to the Memory Hub and returning processed results.

### Authentication and Access Control

Before routing requests, the Proxy performs **authentication and ACL checks** to validate agent credentials. This security layer ensures that only authorized agents can access sensitive memory assets, with configuration loaded from [`proxy/config.go`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/proxy/config.go) (including auth tokens, port bindings, and Hub addresses).

## How MemoryProxy Enables Zero-Code Agent Integration

The Proxy eliminates integration friction for supported agents including DeepSeek Harness, Claude Code, Codex, and CodeBuddy. Agents simply point their base URL to the Proxy endpoint instead of implementing custom plugins or hooks.

### Listing Available Tools

To retrieve the catalog of accessible memory tools through the Proxy:

```bash
curl http://localhost:8125/v3/tools/list

```

### Calling Memory Tools

The following Node.js example demonstrates calling a Wiki read operation via the Proxy, which forwards the request to the Hub:

```javascript
fetch('http://localhost:8125/v3/tools/call', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    tool: 'wiki.read',
    args: { pageId: '12345' }
  })
})
.then(res => res.json())
.then(console.log);

```

These calls target the Proxy at port `8125`, which then manages the communication protocol with the underlying Memory Hub.

## Implementation Details in the Source Code

The MemoryProxy implementation resides in the `proxy/` directory, with three critical files defining its behavior:

- **[`proxy/main.go`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/proxy/main.go)** – Initializes the HTTP server, wires the Hub client, and starts the listening service.
- **[`proxy/router.go`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/proxy/router.go)** – Defines the HTTP route mappings for `/v3/tools/*` endpoints and implements request handling logic.
- **[`proxy/config.go`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/proxy/config.go)** – Loads runtime configuration including network ports, authentication tokens, and the upstream Memory Hub address.

Together, these files implement the mediation layer that allows agents to interact with shared memory assets without direct Hub dependency.

## Summary

- **MemoryProxy** provides a protocol-stable HTTP gateway between agents and the Memory Hub in the TencentDB-Agent-Memory architecture.
- The service enables **zero-code integration** for agents like Claude Code and DeepSeek Harness by exposing consistent `/v3/tools/*` endpoints.
- Core responsibilities include request forwarding, authentication, and ACL enforcement before routing to the Hub.
- Key implementation files are [`proxy/main.go`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/proxy/main.go), [`proxy/router.go`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/proxy/router.go), and [`proxy/config.go`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/proxy/config.go).
- Agents connect via standard HTTP on port `8125`, abstracting all internal Hub complexity.

## Frequently Asked Questions

### What is the difference between MemoryProxy and Memory Hub?

MemoryProxy is a lightweight gateway service that exposes a stable HTTP API to agents, while Memory Hub contains the core business logic and storage implementations for memory assets. The Proxy routes authenticated requests to the Hub, allowing the Hub internals to evolve without breaking existing agent integrations.

### How do I configure the MemoryProxy service?

Configuration is managed through [`proxy/config.go`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/proxy/config.go), which loads environment variables or config files specifying the listening port (default `8125`), authentication tokens, and the upstream Memory Hub address. These settings establish the security boundaries and network topology for agent connections.

### Which AI agents are compatible with MemoryProxy?

The Proxy supports zero-code integration with multiple agent frameworks including **DeepSeek Harness**, **Claude Code**, **Codex**, and **CodeBuddy**. Any agent capable of making standard HTTP requests to REST endpoints can interface with the Proxy without custom plugins.

### What API endpoints does MemoryProxy expose?

MemoryProxy mirrors the Memory Hub API surface, primarily exposing `/v3/tools/list` for retrieving available memory tools and `/v3/tools/call` for executing operations like reading Wiki pages or querying Chat Memory. These endpoints accept standard JSON payloads and return structured responses.