Skip to main content

Self-Hosted

Install and run Memtrace on your own infrastructure.

Prerequisites

  • Go 1.21+
  • A running Arc instance (port 8000)

Build from Source

git clone https://github.com/basekick-labs/arc-memory.git
cd arc-memory
make build

The binary will be in ./memtrace.

Configuration

Create a configuration file:

cp memtrace.toml memtrace.local.toml

Edit memtrace.local.toml with your Arc URL and credentials. See the Configuration reference for all available options.

Minimal configuration:

[arc]
url = "http://localhost:8000"
api_key = "your_arc_api_key"
database = "memory"
measurement = "events"

[auth]
enabled = true
db_path = "./data/memtrace.db"

Run

./memtrace

Or specify a custom config file:

./memtrace -config /path/to/memtrace.toml

On first run, Memtrace prints your admin API key. Save it — it's shown only once.

FIRST RUN: Save your admin API key (shown only once)
API Key: mtk_...

Systemd Service

Create /etc/systemd/system/memtrace.service:

[Unit]
Description=Memtrace Memory Layer for AI Agents
After=network.target

[Service]
Type=simple
User=memtrace
Group=memtrace
WorkingDirectory=/opt/memtrace
ExecStart=/usr/local/bin/memtrace -config /etc/memtrace/memtrace.toml
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=multi-user.target

Enable and start:

sudo systemctl enable memtrace
sudo systemctl start memtrace
sudo systemctl status memtrace

System Requirements

Minimum

  • 1 CPU core
  • 512 MB RAM
  • 1 GB disk space
  • 2+ CPU cores
  • 2 GB RAM
  • 10 GB disk space (for SQLite metadata/auth database)

Memtrace is stateless for memory data (stored in Arc), but maintains SQLite databases for auth, agents, and sessions.

Ports

  • 9100: HTTP API (default)

Configure via server.port in the config file or MEMTRACE_SERVER_PORT environment variable.

Verify Installation

Check health:

curl http://localhost:9100/health

Response:

{"status": "ok", "service": "memtrace", "uptime": "2h30m15s"}

Check Arc connectivity:

curl http://localhost:9100/ready

Response:

{"status": "ready", "arc": "connected"}

Next Steps