Mneme

Installation

Deploy Mneme with Docker or Fly.io, and configure all environment variables.

Docker Deployment

Mneme ships with a multi-stage Dockerfile optimized for production.

Build the image

docker build -t mneme .

Run with Docker Compose

# docker-compose.yml
services:
  mneme:
    build: .
    ports:
      - "3000:3000"
    environment:
      NODE_ENV: production
      PORT: 3000
      DATABASE_URL: postgresql://mneme:password@postgres:5432/mneme
      GITHUB_APP_ID: ${GITHUB_APP_ID}
      GITHUB_PRIVATE_KEY: ${GITHUB_PRIVATE_KEY}
      GITHUB_WEBHOOK_SECRET: ${GITHUB_WEBHOOK_SECRET}
      ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
      OPENAI_API_KEY: ${OPENAI_API_KEY}
      API_TOKEN: ${API_TOKEN}
    depends_on:
      - postgres

  postgres:
    image: pgvector/pgvector:pg16
    environment:
      POSTGRES_USER: mneme
      POSTGRES_PASSWORD: password
      POSTGRES_DB: mneme
    volumes:
      - pgdata:/var/lib/postgresql/data

volumes:
  pgdata:

Run migrations

docker compose exec mneme pnpm db:migrate

Fly.io Deployment

Mneme is configured for deployment on Fly.io with auto-deploy on push to main.

Initial setup

fly apps create mneme
fly postgres create --name mneme-db

Attach database

fly postgres attach mneme-db

Set secrets

fly secrets set \
  GITHUB_APP_ID=your-app-id \
  GITHUB_PRIVATE_KEY="$(cat private-key.pem)" \
  GITHUB_WEBHOOK_SECRET=your-webhook-secret \
  ANTHROPIC_API_KEY=sk-ant-... \
  OPENAI_API_KEY=sk-... \
  API_TOKEN=your-api-token

Deploy

fly deploy

Run migrations

fly ssh console -C "node -e \"import('./dist/db/migrate.js')\""

Environment Variables

All environment variables are validated at startup with Zod. Invalid values will cause the process to exit.

VariableRequiredDefaultDescription
NODE_ENVNodevelopmentdevelopment, production, or test
PORTNo3000HTTP server port
LOG_LEVELNoinfofatal, error, warn, info, debug, or trace
DATABASE_URLYesPostgreSQL connection string
GITHUB_APP_IDYesGitHub App ID
GITHUB_PRIVATE_KEYYes*GitHub App private key (PEM format)
GITHUB_PRIVATE_KEY_PATHYes*Path to private key file (alternative to inline)
GITHUB_WEBHOOK_SECRETYesGitHub webhook HMAC secret
NANGO_URLNoNango OAuth connector URL (required for Slack, Linear, Jira, Stripe)
NANGO_SECRET_KEYNoNango secret key (required for Slack, Linear, Jira, Stripe)
ANTHROPIC_API_KEYYesAnthropic API key for LLM processing
OPENAI_API_KEYYesOpenAI API key for embeddings
E2B_API_KEYNoE2B API key for code interpreter sandbox
API_TOKENYesBearer token for /api/* route authentication
NANGO_URLNoNango OAuth connector URL
NANGO_SECRET_KEYNoNango secret key

*Either GITHUB_PRIVATE_KEY or GITHUB_PRIVATE_KEY_PATH must be set. If both are provided, the inline key takes precedence.

Database Migrations

Mneme uses Drizzle ORM for database management. Migrations are in src/db/migrations/.

# Generate a new migration after schema changes
pnpm db:generate

# Apply pending migrations
pnpm db:migrate

# Open Drizzle Studio (GUI)
pnpm db:studio

The database requires the pgvector extension for embedding storage. The migration will create it automatically if the database user has the necessary privileges.

On this page