Prerequisites
- Docker and Docker Compose
- An OpenAI API key (or compatible LLM provider)
Quick start
- PostgreSQL 16 on port 5432
- Redis 7 on port 6379
- Mengram API on port 8420
Verify it’s running
Both
/health and /v1/health work.Create your first account
By default, Mengram requires email verification via Resend. For self-hosting without an email provider, setDISABLE_EMAIL_VERIFICATION=true:
Configuration
Environment variables indocker-compose.yml:
Required
Core
Self-hosting
GitHub OAuth (optional)
GitHub login is optional — email signup works without it.
To enable GitHub login:
- Create a GitHub OAuth App at github.com/settings/developers
- Set the callback URL to
http://your-host:8420/auth/github/callback - Add both env vars to your
docker-compose.yml
Multilingual support (Cohere)
Mengram cloud uses Cohereembed-multilingual-v3.0 for native quality across 23 languages — Russian, Chinese, Spanish, Japanese, Korean, Arabic, and more. To use the same on a self-hosted instance:
embedding_v2 column (1024 dim) so you can switch providers without losing existing data — Mengram routes search to the right column based on query vector size.
Use with Ollama (fully local)
Run Mengram with a local LLM — no external API calls:Use with LM Studio
Use with OpenRouter
Connect your tools
MCP server (Claude Desktop, Cursor, Windsurf)
VS Code extension
- Install the Mengram extension from the marketplace
- Open Settings and set:
mengram.apiKey→ your API keymengram.baseUrl→http://localhost:8420
Claude Code hooks
Python SDK
JavaScript SDK
Data persistence
PostgreSQL data is stored in a Docker volume (pgdata). Your memories persist across container restarts.
To backup:
Production deployment
For production, consider:- Use a managed PostgreSQL (e.g., Supabase, Neon, RDS)
- Use a managed Redis (e.g., Upstash, ElastiCache)
- Set strong database passwords
- Put behind a reverse proxy with TLS (nginx, Caddy)
- Set
GUNICORN_WORKERSfor concurrency - Set
BASE_URLto your public domain