# What Is the Default Port for MemoryProxy?

> Discover the default port for MemoryProxy. Learn how TencentDB Agent MemoryProxy uses port 8096 for its operations and get the configuration details you need.

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

---

**MemoryProxy listens on port 8096 by default** when running without explicit port configuration.

The TencentDB-Agent-Memory repository provides MemoryProxy as a core service for LLM request forwarding and caching. Understanding the default port configuration is essential for network planning, container orchestration, and API integration. This article examines the source code to identify where port 8096 is defined and how to customize it for your deployment environment.

## Default Port Configuration in Source Files

The default port is hardcoded across multiple configuration and documentation files within the repository.

### Configuration File Definition

In [`MemoryProxy/config.example.yaml`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/config.example.yaml), the server block explicitly sets the default listening port. The configuration defines port 8096 as the standard endpoint for incoming LLM requests.

```yaml

# Example snippet from config.example.yaml

server:
  host: "0.0.0.0"
  port: 8096   # ← default listening port

  forwardTimeoutMs: 600_000

```

### Container Image Exposure

The `MemoryProxy/Dockerfile` exposes port 8096 to ensure containerized deployments maintain consistency with the configuration defaults. This exposure allows Docker and Kubernetes environments to route traffic correctly without additional build arguments.

### API Documentation Reference

According to [`MemoryProxy/v3-api-memoryproxy-doc.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/v3-api-memoryproxy-doc.md), the service documentation lists "端口 `8096`" (Port 8096) as the standard connection point for proxy operations. The [`deploy/global-images/start-proxy.sh`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/deploy/global-images/start-proxy.sh) startup script also defaults to this port when no override is provided.

## Overriding the Default Port

While 8096 is the built-in default, the service supports runtime customization through environment variables. Setting `PROXY_PORT` overrides the hardcoded value before the service initializes.

### Docker Deployment Examples

Run the container using the default port mapping:

```bash

# Start the proxy using the default port (8096)

docker run -p 8096:8096 agentmemory/memory-proxy

```

Override the port using the environment variable:

```bash

# Override the port via environment variable

PROXY_PORT=18096 docker run -p 18096:8096 agentmemory/memory-proxy

```

The startup scripts check for the `PROXY_PORT` environment variable before falling back to port 8096.

## Verifying the Service Port

After deployment, confirm the proxy is responding on the configured port using the health check endpoint.

```bash

# Quick health check on the default port

curl http://127.0.0.1:8096/health

```

A successful response confirms that MemoryProxy is accepting connections on the expected port.

## Summary

- MemoryProxy defaults to **port 8096** for all LLM request proxy operations according to the TencentDB-Agent-Memory source code.
- The default is defined in [`MemoryProxy/config.example.yaml`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/config.example.yaml) under the `server.port` configuration key.
- The `MemoryProxy/Dockerfile` exposes port 8096 for containerized deployments.
- Override the default by setting the **PROXY_PORT** environment variable before service startup.
- The [`MemoryProxy/README.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/README.md) and API documentation reference this port as the standard endpoint.

## Frequently Asked Questions

### What is the default port for MemoryProxy?

MemoryProxy uses **port 8096** as its default listening port for LLM request proxy operations. This value is specified in [`MemoryProxy/config.example.yaml`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/config.example.yaml) and exposed in the `MemoryProxy/Dockerfile` for container networking.

### How do I change the MemoryProxy port from the default?

Set the `PROXY_PORT` environment variable when starting the service. The startup script in [`deploy/global-images/start-proxy.sh`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/deploy/global-images/start-proxy.sh) checks for this variable and uses its value instead of the hardcoded 8096 default. For Docker deployments, pass the variable with `-e PROXY_PORT=18096`.

### Is port 8096 exposed in the official Docker image?

Yes. The `MemoryProxy/Dockerfile` explicitly contains the instruction `EXPOSE 8096`, which documents the default port for container orchestration tools. When running containers, map this port using the `-p` flag, such as `-p 8096:8096` for default mappings or `-p 18096:8096` when overriding with environment variables.

### Where is the default port documented in the source code?

The default port appears in three key locations: the YAML configuration in [`MemoryProxy/config.example.yaml`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/config.example.yaml), the API documentation in [`MemoryProxy/v3-api-memoryproxy-doc.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryProxy/v3-api-memoryproxy-doc.md) (which lists "端口 8096"), and the container specification in `MemoryProxy/Dockerfile`.