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:migrateFly.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-dbAttach database
fly postgres attach mneme-dbSet 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-tokenDeploy
fly deployRun 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.
| Variable | Required | Default | Description |
|---|---|---|---|
NODE_ENV | No | development | development, production, or test |
PORT | No | 3000 | HTTP server port |
LOG_LEVEL | No | info | fatal, error, warn, info, debug, or trace |
DATABASE_URL | Yes | — | PostgreSQL connection string |
GITHUB_APP_ID | Yes | — | GitHub App ID |
GITHUB_PRIVATE_KEY | Yes* | — | GitHub App private key (PEM format) |
GITHUB_PRIVATE_KEY_PATH | Yes* | — | Path to private key file (alternative to inline) |
GITHUB_WEBHOOK_SECRET | Yes | — | GitHub webhook HMAC secret |
NANGO_URL | No | — | Nango OAuth connector URL (required for Slack, Linear, Jira, Stripe) |
NANGO_SECRET_KEY | No | — | Nango secret key (required for Slack, Linear, Jira, Stripe) |
ANTHROPIC_API_KEY | Yes | — | Anthropic API key for LLM processing |
OPENAI_API_KEY | Yes | — | OpenAI API key for embeddings |
E2B_API_KEY | No | — | E2B API key for code interpreter sandbox |
API_TOKEN | Yes | — | Bearer token for /api/* route authentication |
NANGO_URL | No | — | Nango OAuth connector URL |
NANGO_SECRET_KEY | No | — | Nango 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:studioThe database requires the pgvector extension for embedding storage. The migration will create it automatically if the database user has the necessary privileges.