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

MemoryProxy is a lightweight HTTP service that sits between AI agents and the Memory Hub, providing a stable protocol layer that enables zero-code integration for tools like DeepSeek Harness, Claude Code, and Codex.

In the TencentCloud/TencentDB-Agent-Memory repository, MemoryProxy serves as the critical abstraction layer that decouples agent implementations from the underlying memory infrastructure. By exposing a consistent HTTP interface, it allows any compatible agent to leverage shared memory assets—including Chat Memory, Skills, Wiki, and CodeGraph—without requiring custom plugins or code modifications.

What Is MemoryProxy in TencentDB Agent Memory?

MemoryProxy functions as a protocol-stabilizing gateway within the TencentDB Agent Memory architecture. According to the repository structure, the system ships with three core services that launch together: memory-core, memory-hub, and proxy (located in the proxy/ directory).

The primary function of MemoryProxy is to maintain a stable, unchanged protocol while the Memory Hub evolves internally. This architectural decision ensures that agents continue to function even when the underlying hub implementation changes, providing long-term compatibility and reducing maintenance overhead for agent developers.

Core Responsibilities of MemoryProxy

MemoryProxy handles several critical functions that mediate between agents and the memory infrastructure:

  • Request forwarding: Intercepts HTTP calls from agents (such as /v3/tools/list and /v3/tools/call) and routes them to the appropriate Memory Hub endpoints.
  • Authentication and ACL checks: Validates security tokens and enforces access control policies before allowing requests to reach the hub.
  • Protocol abstraction: Acts as a stable entry-point that masks internal changes in the Memory Hub, ensuring existing agents never break due to backend updates.

How MemoryProxy Enables Zero-Code Agent Integration

One of the most significant advantages of MemoryProxy is its support for zero-code integration. Agents can begin using shared memory assets simply by pointing their base URL to the Proxy endpoint rather than implementing custom SDKs or hooks.

The repository documentation explicitly lists support for major AI coding agents including DeepSeek Harness, Claude Code, Codex, and CodeBuddy. This compatibility layer means teams can integrate enterprise memory management into their existing AI workflows without modifying agent source code or rebuilding binaries.

MemoryProxy Architecture and Source Code

The MemoryProxy implementation resides in the proxy/ directory and consists of three primary Go source files that handle the HTTP service lifecycle:

Main Server Implementation (proxy/main.go)

The proxy/main.go file serves as the entry point for the Proxy service. It initializes the HTTP server, establishes the client connection to the Memory Hub, and wires together the routing logic. This file contains the service bootstrap code that starts the lightweight HTTP listener on the configured port (default 8125).

Route Handling (proxy/router.go)

Located at proxy/router.go, this file defines the HTTP routing table and request handling logic. It specifically manages the /v3/tools/* endpoint pattern, parsing incoming agent requests and preparing them for transmission to the Memory Hub. The router handles both GET requests for tool listing and POST requests for tool execution.

Configuration Management (proxy/config.go)

The proxy/config.go file manages runtime configuration loading, including critical parameters such as:

  • Listening ports for the HTTP server
  • Authentication tokens for agent verification
  • Memory Hub connection addresses and timeouts

This separation of concerns allows operators to adjust Proxy behavior without modifying the core routing or server logic.

Practical Integration Examples

You can interact with MemoryProxy using standard HTTP clients. The Proxy listens on localhost:8125 by default and exposes the same REST API as the underlying Memory Hub.

Listing Available Tools via cURL

To retrieve the list of available memory tools through the Proxy:

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

Calling Memory Tools from Node.js

The following example demonstrates how an agent might read a Wiki page through the Proxy:

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);

In both examples, the Proxy transparently forwards the requests to the Memory Hub, executes the authentication checks, and returns the processed results to the calling agent.

Summary

  • MemoryProxy acts as a protocol-stabilizing HTTP gateway between AI agents and the TencentDB Agent Memory Hub.
  • It enables zero-code integration for supported agents including DeepSeek Harness, Claude Code, Codex, and CodeBuddy.
  • The service abstracts the underlying Hub implementation, allowing internal evolution without breaking existing agent integrations.
  • Core implementation files include proxy/main.go (server startup), proxy/router.go (endpoint definitions), and proxy/config.go (configuration management).
  • Agents interact with standard REST endpoints (/v3/tools/list, /v3/tools/call) on port 8125, with the Proxy handling authentication and request forwarding.

Frequently Asked Questions

What is the difference between MemoryProxy and Memory Hub?

MemoryHub manages the actual storage and retrieval of memory assets (Chat Memory, Skills, Wiki, CodeGraph), while MemoryProxy provides the HTTP interface that agents interact with. The Proxy handles authentication, routing, and protocol stability, whereas the Hub focuses on data persistence and business logic. According to the repository architecture, these run as separate services that communicate internally.

Which AI agents are compatible with MemoryProxy?

The repository officially supports DeepSeek Harness, Claude Code, Codex, and CodeBuddy. Because MemoryProxy exposes a standard HTTP REST API compatible with the Memory Hub interface, any agent capable of making HTTP requests to a configurable base URL can integrate with the system without custom plugins.

How does MemoryProxy handle authentication?

MemoryProxy performs authentication and ACL checks before forwarding requests to the Memory Hub. The proxy/config.go file loads authentication tokens and security policies during startup, and the proxy/router.go logic enforces these policies on incoming requests to /v3/tools/* endpoints. This ensures that only authorized agents can access shared memory resources.

Can I run MemoryProxy independently of the other services?

While MemoryProxy can technically start independently, it requires a running Memory Hub instance to function properly. The proxy/main.go file wires the Proxy to a Hub client at startup using configuration from proxy/config.go. For full functionality, the repository recommends running all three core services—memory-core, memory-hub, and proxy—together as a unified stack.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →