Skip to main content

Install with Docker Compose

Install mnemos on your own server with Docker Compose. This example uses PostgreSQL, Ollama, an MCP server and an HTTP API. If you only connect an AI assistant over MCP, you can omit the api service.

Requirements​

  • Docker with the Compose plugin;
  • 4 GB of RAM: the embedding model takes about 2 GB;
  • a TLS reverse proxy if the server is reachable from outside. The containers listen on 127.0.0.1 only.

1. Create docker-compose.yml​

name: mnemos

services:
postgres:
image: pgvector/pgvector:pg17
environment:
POSTGRES_USER: mnemos
POSTGRES_PASSWORD: ${MNEMOS_DATABASE_PASSWORD}
POSTGRES_DB: mnemos
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mnemos"]
interval: 5s
retries: 20

# Local model for search by meaning.
ollama:
image: ollama/ollama:latest
volumes:
- ollama:/root/.ollama
entrypoint: ["/bin/sh", "-c"]
command: >
"ollama serve &
until ollama list >/dev/null 2>&1; do sleep 1; done;
ollama pull bge-m3;
wait"
healthcheck:
test: ["CMD-SHELL", "ollama list | grep -q bge-m3"]
interval: 10s
retries: 60
start_period: 30s
restart: unless-stopped

mnemos:
image: cr.yandex/crpo20ag926fr5ijfri7/mnemos-mcp:latest
env_file: .env
depends_on:
postgres:
condition: service_healthy
ollama:
condition: service_healthy
ports:
- "127.0.0.1:8090:8090"
restart: unless-stopped

# API for apps and scripts.
api:
image: cr.yandex/crpo20ag926fr5ijfri7/mnemos-api:latest
env_file: .env
depends_on:
mnemos:
condition: service_started
ports:
- "127.0.0.1:8091:8090"
restart: unless-stopped

volumes:
pgdata:
ollama:

2. Create .env​

Save it next to docker-compose.yml. Enter your database password and authentication addresses.

# Database
MNEMOS_DATABASE_HOST=postgres
MNEMOS_DATABASE_USER=mnemos
MNEMOS_DATABASE_PASSWORD=change-me
MNEMOS_DATABASE_NAME=mnemos
MNEMOS_DATABASE_SSLMODE=disable

# Embeddings
MNEMOS_EMBEDDINGS_BASE_URL=http://ollama:11434/v1
MNEMOS_EMBEDDINGS_MODEL=bge-m3
MNEMOS_EMBEDDINGS_DIMENSIONS=1024

# Authentication
MNEMOS_AUTH_ISSUER_URL=https://auth.example.com
MNEMOS_AUTH_PUBLIC_URL=https://mnemos.example.com

3. Start mnemos​

docker compose up -d

On the first start, wait for the model to download — about 2 GB.

Check the server status:

curl -s http://127.0.0.1:8090/healthz
docker compose logs --tail 20 mnemos

Embeddings: locally or through a provider​

Locally (the default)​

The example uses Ollama with the bge-m3 model, which needs about 2 GB of memory. Text for search is processed on your server.

MNEMOS_EMBEDDINGS_BASE_URL=http://ollama:11434/v1
MNEMOS_EMBEDDINGS_MODEL=bge-m3
MNEMOS_EMBEDDINGS_DIMENSIONS=1024

Through a provider​

For an external service with a /v1/embeddings API, set its address, key and model. Example for OpenAI:

MNEMOS_EMBEDDINGS_BASE_URL=https://api.openai.com/v1
MNEMOS_EMBEDDINGS_API_KEY=sk-...
MNEMOS_EMBEDDINGS_MODEL=text-embedding-3-large
MNEMOS_EMBEDDINGS_DIMENSIONS=1024
MNEMOS_EMBEDDINGS_REQUEST_DIMENSIONS=true

Use 1024 dimensions. Keep MNEMOS_EMBEDDINGS_REQUEST_DIMENSIONS=true for this example; Ollama does not need that parameter.

Authentication​

Set two addresses:

  • MNEMOS_AUTH_ISSUER_URL — your OAuth server's address.
  • MNEMOS_AUTH_PUBLIC_URL — mnemos's public address, such as https://mnemos.example.com.

The server will not start without them: there is no unauthenticated mode.

Upgrading​

docker compose pull
docker compose up -d

After startup, connect your assistant. See configuration for other settings.