Select Page

What Is TencentDB Agent Memory?

Imagine your AI assistant could actually remember things. Not just during one conversation, but across days, weeks, and months. That's what TencentDB Agent Memory does — it's a memory system for AI agents.

Think of it like this: when you talk to an AI assistant, it normally forgets everything the moment the conversation ends. TencentDB gives that assistant a long-term memory. It remembers your preferences, past projects, and important decisions — just like a human colleague would.

It Works in Four Layers

Each layer stores a different kind of memory, from raw transcripts to a personality profile.

L0
Raw Conversations
A transcript of everything you said.
L1
Key Facts Extracted
A summary of the important points.
L2
Organized Knowledge
A personal wiki about you and your work.
L3
Personality Profile
A user manual for how you like to work.

Beyond memory, it also stores Skills (reusable procedures your AI learns) and a Wiki (team knowledge base).

What You’ll Need Before Starting

You need exactly two things installed on your computer. That's it — you don't need to know programming, databases, or server administration.

🐳
Docker
A tool that runs software in isolated containers (like lightweight virtual machines). Download Docker Desktop — it's free for personal use.
📦
Docker Compose
Comes bundled with Docker Desktop. It lets you start multiple containers with one command.
💡 Tip: Check if Docker is installed
Open your terminal (Command Prompt on Windows, Terminal on Mac/Linux) and type docker --version. If you see a version number, you're good to go.

Step 1

Create Your Project Folder

Open your terminal and create a new folder for the project. This is where all your configuration files will live.

mkdir tencent-agent-memory
cd tencent-agent-memory

Step 2

Create the Environment File

The environment file (.env) tells TencentDB how to connect to an AI model. The AI model is what does the thinking — it reads your conversations and extracts the important memories.

Create a file called .env with this content:

# Your AI model settings (REQUIRED)
LLM_API_KEY=your-api-key-here
LLM_BASE_URL=https://api.openai.com/v1
LLM_MODEL=gpt-4o

# Ports (you can leave these as-is)
MEMORY_CORE_PORT=8420
PANEL_PORT=8125
KNOWLEDGE_PORT=8424
PROXY_PORT=8096

What to fill in:

  • LLM_API_KEY — Your API key from an AI provider (OpenAI, Anthropic, or any OpenAI-compatible service).
  • LLM_BASE_URL — The web address of the AI service. For OpenAI, use https://api.openai.com/v1.
  • LLM_MODEL — Which AI model to use. gpt-4o is a good starting point.
🔒 Security Note
Never share your .env file publicly — it contains your API key. This file stays on your computer only.

Step 3

Create the Docker Compose File

Create a file called docker-compose.yml with this content:

services:
memory-core:
image: agentmemory/memory-core:latest
container_name: tdai-memory-core
restart: unless-stopped
ports:
- "8420:8420"
volumes:
- memory-core-data:/data/tdai-memory
environment:
- TDAI_GATEWAY_PORT=8420
- TDAI_GATEWAY_HOST=0.0.0.0
- TDAI_DATA_DIR=/data/tdai-memory
- TDAI_LLM_API_KEY=${LLM_API_KEY}
- TDAI_LLM_BASE_URL=${LLM_BASE_URL}
- TDAI_LLM_MODEL=${LLM_MODEL}
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8420/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
networks:
- tdai-memory-stack

memory-hub:
image: agentmemory/memory-hub:latest
container_name: tdai-memory-hub
restart: unless-stopped
ports:
- "8125:8125"
- "8424:8424"
volumes:
- memory-hub-data:/data/knowledge
environment:
- PANEL_PORT=8125
- KNOWLEDGE_PORT=8424
- REMOTE_INSTANCE_ID=default
- REMOTE_INSTANCE_NAME=default
- REMOTE_INSTANCE_URL=http://memory-core:8420
- LLM_MODE=custom
- LLM_API_KEY=${LLM_API_KEY}
- LLM_BASE_URL=${LLM_BASE_URL}
- LLM_MODEL=${LLM_MODEL}
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8125/health"]
interval: 20s
timeout: 8s
retries: 15
start_period: 45s
depends_on:
memory-core:
condition: service_healthy
networks:
- tdai-memory-stack

volumes:
memory-core-data:
memory-hub-data:

networks:
tdai-memory-stack:
driver: bridge

What this does: It defines two containers — the Memory Core (the brain that stores and retrieves memories) and the Memory Hub (the web dashboard where you can see everything). They talk to each other over a private network.

Step 4

Start Everything

Now the exciting part — one command starts it all:

docker compose up -d

The -d means detached — it runs in the background. Docker will download the images (about 2-3 minutes the first time) and start both containers.

Step 5

Verify It’s Working

Check that everything is healthy:

# Check the Memory Core
curl http://localhost:8420/health

# Check the Dashboard
curl http://localhost:8125/health

Both should respond with {"status":"ok"} or similar.

Step 6

Open the Dashboard

Open your web browser and go to http://localhost:8125. You'll see the TencentDB Memory Hub — a web dashboard where you can browse memories, manage skills, and view your AI's knowledge base.

Step 7

First-Time Setup (One-Time Only)

The very first time you start TencentDB, you need to create an admin account. Run this command in your terminal:

curl -X POST http://localhost:8420/v3/internal/meta/user/init-admin -H "Content-Type: application/json" -H "Authorization: Bearer local" -H "x-tdai-service-id: default" -d '{"username":"admin"}'

The response will contain an api_key. Save this key — it's your master password for the system.

Add it to your .env file:

MEMORY_CORE_ADMIN_USER_KEY=the-key-you-just-received

Restart the dashboard:

docker compose restart memory-hub

Now refresh your browser at http://localhost:8125 — you're ready to go!

What Each Component Does

ComponentPortWhat It DoesDo I Need It?
Memory Core8420The brain — stores conversations, extracts memories, manages skills✅ Required
Memory Hub8125The dashboard — web interface to browse memories and manage settings✅ Recommended
Knowledge API8424The library — semantic search for wiki pages and documents✅ Recommended
Memory Proxy8096The bridge — connects AI coding agents to the memory system⚠️ Optional

How It Works (The Simple Version)

  1. Your AI assistant has a conversation with you.
  2. The conversation is sent to the Memory Core.
  3. The Memory Core uses an AI model (the one you configured in .env) to read the conversation and extract: key facts (what was decided, what you prefer), patterns (how you work, what you care about), and skills (procedures worth reusing).
  4. These memories are stored and made available for future conversations.
  5. You can browse everything in the web dashboard.

Stopping and Starting

  • Stop everything: docker compose down (your data is preserved)
  • Start again: docker compose up -d
  • Completely reset (delete all data): docker compose down -v ⚠️ This deletes everything!

Troubleshooting

The dashboard is empty!
This is normal after a fresh start. The dashboard only shows data after your AI assistant has had at least one conversation and memories have been extracted. Connect an AI agent and have a conversation — then check back.
Port already in use
If ports 8420 or 8125 are already used by another program, change them in your .env file: MEMORY_CORE_PORT=8421 and PANEL_PORT=8126. Then restart with docker compose up -d.
Connection refused
Make sure Docker is running. On Windows/Mac, check that Docker Desktop is open (you'll see a whale icon in your system tray).

What’s Next?

Now that TencentDB is running, you'll want to connect an AI assistant to it. Check out our companion article: How to Connect Hermes Agent to TencentDB Agent Memory — it walks you through connecting one of the most powerful open-source AI agents to your new memory system.

Quick Reference Card

# Start
docker compose up -d

# Check health
curl http://localhost:8420/health
curl http://localhost:8125/health

# View logs
docker compose logs -f

# Stop (keep data)
docker compose down

# Full reset (delete data)
docker compose down -v

# Dashboard
open http://localhost:8125

Happy Remembering! 🧠

Your AI assistant now has a long-term memory. Give it a conversation and watch it remember.