Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust
1.7 KB
Raw Blame
# docker-compose.yml for ai-memory.
#
# Run from this directory:
#   docker compose up -d
# Attach Claude Code (or any MCP HTTP client) at
#   http://localhost:49374/mcp
# State persists in the `ai-memory-data` volume. Use `ai-memory backup`
# for an online snapshot, or stop the container before copying the volume.
# See docs/backup.md for moving a backup to another host.

services:
  ai-memory:
    image: ai-memory:local
    build:
      context: ..
      dockerfile: docker/Dockerfile
    container_name: ai-memory
    restart: unless-stopped
    user: "1000:1000"
    volumes:
      - ai-memory-data:/data
    ports:
      # Bind to loopback by default; flip to 0.0.0.0:49374 when serving
      # the homelab LAN. Keep behind a reverse proxy if you do.
      - "127.0.0.1:49374:49374"
    env_file:
      - path: .env
        required: false
    environment:
      - RUST_LOG=ai_memory=info,ai_memory_store=info,ai_memory_wiki=info,ai_memory_mcp=info,tracing_appender=warn
      # LLM provider configured via docker/.env (gitignored). Options:
      # anthropic | openai | openai-oauth | anthropic-oauth | copilot |
      # gemini | openai-compat | opencode
      # See .env.production.example for the full reference.
      #
      # Extra headers on every LLM chat request, for a gateway that requires
      # a caller-identifying one. Comma-separated `Name=Value` entries; the
      # default `User-Agent: ai-memory/<version>` needs no configuration.
      # - AI_MEMORY_LLM_HEADERS=x-opencode-session=homelab-01
    healthcheck:
      test: ["CMD", "/usr/local/bin/ai-memory", "status"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 5s

volumes:
  ai-memory-data:
    name: ai-memory-data