Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors
Rust
# Production docker-compose template for ai-memory on a homelab host.
#
# Copy to docker/docker-compose.prod.yml, adjust if you want, then
# scp it to your homelab as docker-compose.yml in the deploy dir.
# The .example variant is committed; the live copy is gitignored.
#
# Differences from docker/docker-compose.yml (the local-dev compose):
# - References an image from a registry instead of building inline.
# - Binds to 0.0.0.0 so the LAN can reach the MCP endpoint.
# - Reads secrets from .env.production rather than inlining them.
# - Volume mounts a host path (under /var/opt/docker/...) for persistent data.
# Use `ai-memory backup` online, or stop the container before copying it.
name: ai-memory
services:
ai-memory:
image: akitaonrails/ai-memory:latest
container_name: ai-memory
restart: unless-stopped
user: "1000:1000"
# openSUSE MicroOS / Fedora / RHEL etc. enforce SELinux on bind
# mounts by default; without this the container can't read its
# own /data dir. Safe on hosts that don't enforce SELinux (it's
# a no-op there).
security_opt:
- label:disable
ports:
# LAN-accessible. Behind your home firewall, this is fine. If
# you want loopback-only (server-local clients only), change to
# "127.0.0.1:49374:49374".
- "0.0.0.0:49374:49374"
volumes:
# Data lives on the host. Use `ai-memory backup` online; stop the
# container before copying this directory with rsync or restic.
- /var/opt/docker/utils/ai-memory/data:/data
env_file:
- .env.production
environment:
# Tracing filter; promote modules to debug here without rebuilding.
- RUST_LOG=ai_memory=info,ai_memory_store=info,ai_memory_wiki=info,ai_memory_mcp=info,tracing_appender=warn
healthcheck:
test: ["CMD", "/usr/local/bin/ai-memory", "status"]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s