Self-Hosting
Run Engrammic on your own infrastructure
Quick Start
The fastest way to get Engrammic running locally:
curl -fsSL https://get.engrammic.ai | sh
engrammic selfhostThe wizard will:
- Check Docker is running
- Validate your license key
- Configure ports and storage
- Set up LLM integration (optional)
- Start the services
- Configure your code editor
Requirements
- Docker 20.10+ with Compose v2
- 5GB RAM minimum (8GB recommended)
- 20GB disk space
- License key from engrammic.ai/self-hosted
Two model types you may need to configure
The self-hosted image uses two separate models with different roles:
- Embedding model (required). Used by
remember,learn, andrecall. Without it, those tools fail outright. Configure viaEMBEDDING_MODELand the matching provider credentials. - Generation LLM (optional). Used only by SAGE synthesis (deduplication, belief formation). Without it, the service runs in passive mode: storage and recall work, synthesis is disabled.
See Running Models Locally if you want to run either model on your own hardware with no cloud API keys. See Configuration for the full variable reference.
Fully-local turnkey images (standalone and standalone-lite, with models bundled) are also available. Documentation for those is coming separately.
CLI Reference
Installation Commands
| Command | Description |
|---|---|
engrammic selfhost | Interactive setup wizard |
engrammic install | Configure MCP for detected editors |
engrammic uninstall | Remove Engrammic from editor configs |
Management Commands
| Command | Description |
|---|---|
engrammic status | Show current installation state |
engrammic upgrade | Pull latest images and restart |
engrammic doctor | Run diagnostic health checks |
engrammic scale | Show container resource usage |
engrammic logs | View service logs |
engrammic license | View or update license key |
Log Viewing
# Interactive service selection
engrammic logs
# Specific service
engrammic logs --service app
# Follow logs
engrammic logs --service app --follow
# Show more lines
engrammic logs --service dagster --lines 500Available services: app, reaction-worker, dagster, dagster-daemon, memgraph, qdrant, redis, postgres
Configuration
After running engrammic selfhost, your configuration is stored in ~/.engrammic/:
~/.engrammic/
docker-compose.yml # Service definitions
.env # Configuration
README.md # Quick referenceEnvironment Variables
Edit ~/.engrammic/.env to configure:
# License (required)
ENGRAMMIC_LICENSE_KEY=ENGR_...
# Database
POSTGRES_PASSWORD=your-secure-password
# Embedding model (required, otherwise remember/learn/recall fail)
EMBEDDING_MODEL=openai/text-embedding-3-small
OPENAI_API_KEY=sk-...
# Telemetry (opt out with false)
TELEMETRY__ENABLED=trueThe embedding model is the required piece, and you set it here with EMBEDDING_MODEL plus its provider key. The generation LLM is optional and is configured differently (see below). See Configuration for the full variable reference and Running Models Locally to run either without cloud keys.
Choosing the generation LLM
The SAGE generation LLM provider and model live in config/models.yaml, not in .env. The default tier uses Google Vertex (Gemini). To use a different provider:
- Override
models.yamlthrough the host config directory (see Config Files). - Set the active tier's
reasoning,fast, andquery_expanderentries to your provider and model. - Supply that provider's credentials in
.env:
| Provider in models.yaml | Credentials in .env |
|---|---|
openai | OPENAI_API_KEY=sk-... |
anthropic | ANTHROPIC_API_KEY=sk-ant-... |
gemini | GEMINI_API_KEY=... |
vertex (default) | VERTEX_PROJECT=..., VERTEX_LOCATION=... (uses the mounted gcloud credentials) |
ollama | OLLAMA_BASE_URL=http://host.docker.internal:11434 |
Without usable LLM credentials, Engrammic runs in passive mode: storage and recall work, but SAGE synthesis (automatic deduplication, insight generation) is disabled.
Custom Ports
During engrammic selfhost, you can configure custom ports:
- MCP server: Default 8000 (your editor connects here)
- Dagster UI: Default 3000 (SAGE pipeline dashboard)
After setup, edit docker-compose.yml to change internal service ports.
Upgrading
Pull the latest images and restart:
engrammic upgradeThis will:
- Pull new images
- Restart services
- Clean up old images
Version deprecation warnings appear in logs when running outdated versions.
Backup and Restore
Manual Backup
cd ~/.engrammic
# Stop services
docker compose down
# Backup volumes
docker run --rm -v engrammic_postgres-data:/data -v $(pwd):/backup alpine \
tar czf /backup/postgres-backup.tar.gz -C /data .
docker run --rm -v engrammic_qdrant-data:/data -v $(pwd):/backup alpine \
tar czf /backup/qdrant-backup.tar.gz -C /data .
docker run --rm -v engrammic_memgraph-data:/data -v $(pwd):/backup alpine \
tar czf /backup/memgraph-backup.tar.gz -C /data .
# Restart
docker compose up -dRestore
cd ~/.engrammic
docker compose down
# Restore volumes (example for postgres)
docker run --rm -v engrammic_postgres-data:/data -v $(pwd):/backup alpine \
sh -c "rm -rf /data/* && tar xzf /backup/postgres-backup.tar.gz -C /data"
docker compose up -dTroubleshooting
Health Check
curl http://localhost:8000/healthExpected response:
{
"status": "healthy",
"services": {
"memgraph": "connected",
"redis": "connected",
"qdrant": "connected",
"postgres": "connected"
}
}Diagnostics
engrammic doctorChecks:
- Docker daemon status
- Container health
- Service connectivity
- License validity
Common Issues
Services not starting:
docker compose logs appPort already in use:
Run engrammic selfhost again and choose a different port.
License expired:
engrammic licenseOut of memory:
engrammic scaleManual Setup
If you prefer manual configuration over the CLI wizard:
Create directory
mkdir -p ~/.engrammic && cd ~/.engrammicDownload compose file
curl -fsSL https://raw.githubusercontent.com/engrammic-ai/mcp/main/docker-compose.yml -o docker-compose.ymlCreate .env
cat > .env << 'EOF'
ENGRAMMIC_LICENSE_KEY=ENGR_your_key_here
POSTGRES_PASSWORD=your-secure-password
# Embedding model (required)
EMBEDDING_MODEL=openai/text-embedding-3-small
OPENAI_API_KEY=sk-...
TELEMETRY__ENABLED=true
# Optional: LLM for SAGE synthesis (provider/model set in models.yaml; supply its key)
# OPENAI_API_KEY=sk-...
EOFStart services
docker compose up -dConfigure your editor
Add to your MCP config (e.g., ~/.claude.json):
{
"mcpServers": {
"engrammic": {
"type": "http",
"url": "http://localhost:8000/mcp"
}
}
}Architecture
The self-hosted stack includes:
| Service | Purpose | Default Port |
|---|---|---|
app | MCP server + REST API | 8000 |
reaction-worker | Async task processing | - |
dagster | SAGE pipeline UI | 3000 |
dagster-daemon | SAGE scheduler | - |
memgraph | Graph database | 7687 |
qdrant | Vector database | 6333 |
redis | Cache + queues | 6379 |
postgres | Metadata store | 5432 |
Total memory: ~5GB (8GB recommended for production workloads)
Get Access
Self-hosting requires a license key. Request one at engrammic.ai/self-hosted or email founders@engrammic.ai.
Helpful Links
- engrammic.ai/self-hosted - license keys and release notes
- Configuration reference - full environment variable reference
- Running Models Locally - Ollama and TEI setup, no cloud keys required
- LiteLLM - embedding and LLM routing used internally
- Ollama - run LLMs and embedding models locally
- Hugging Face Text Embeddings Inference - high-throughput embedding sidecar
- Qdrant documentation - vector database
- Memgraph documentation - graph database
- Dagster documentation - SAGE pipeline orchestration