Engrammic
Reference

Configuration

Environment variables for self-hosted Engrammic deployments

This page covers self-hosted deployments only. For the full setup walkthrough, see the self-hosting guide.

The service is configured through environment variables. Create a .env file alongside your docker-compose.yml and reference it with env_file. The compose file that ships with the installer pre-sets infra hostnames and a few defaults; only override what you need to change.

Required

VariableDefaultPurpose
ENGRAMMIC_LICENSE_KEY(none)Your license key. Format: ENGR_...
POSTGRES_PASSWORDengrammicPostgres password. Change this for any production deployment.
EMBEDDING_MODELvertex_ai/text-embedding-005LiteLLM embedding model string. Routes by prefix. Example: openai/text-embedding-3-small.
EMBEDDING_DIMENSIONS768Integer. Must match the model exactly. nomic and vertex-005 use 768; MiniLM uses 384. Changing this after data exists requires recreating Qdrant collections and re-embedding all stored data.

Embedding Providers

Set the credentials for whichever provider you chose in EMBEDDING_MODEL. You only need one set.

ProviderVariables
OpenAIOPENAI_API_KEY
Azure OpenAIAZURE_API_KEY, AZURE_API_BASE
AWS BedrockAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME
Google Vertex AIVERTEX_PROJECT, VERTEX_LOCATION (requires gcloud credentials mount, already present in the selfhosted compose)
Ollama (local)OLLAMA_API_BASE (example: http://host.docker.internal:11434)

For a full list of supported embedding models, see the LiteLLM embedding docs. For running local models, see the local models guide.

Generation LLM

The generation LLM powers SAGE synthesis (deduplication, insight generation, contradiction detection). Without a usable LLM, SAGE runs in passive mode: storage and recall still work, synthesis is disabled.

Unlike embeddings, the LLM provider and model are not set by a single environment variable. They come from models.yaml, whose default tier uses Google Vertex (Gemini). To change the provider, override models.yaml (see Config Files); the environment only supplies credentials for whichever provider that file selects.

VariableDefaultPurpose
ANTHROPIC_API_KEY(none)Credentials when models.yaml selects the anthropic provider.
OPENAI_API_KEY(none)Credentials when models.yaml selects the openai provider. Also used for OpenAI embeddings if chosen.
GEMINI_API_KEY(none)Credentials when models.yaml selects the gemini provider.
VERTEX_PROJECT / VERTEX_LOCATION(none)Project and region for the vertex provider (the default). Uses the mounted gcloud credentials, no API key.
OLLAMA_BASE_URLhttp://localhost:11434Endpoint when models.yaml selects the ollama provider. Note: separate from OLLAMA_API_BASE, which is for embeddings only.

To switch the LLM (for example to OpenAI or a local Ollama model), edit the active tier's reasoning, fast, and query_expander entries in models.yaml and set the matching credential above. See Config Files for how to override models.yaml, and Running Models Locally for the Ollama walkthrough.

Infrastructure Connections

The selfhosted compose pre-sets these to match the service names. Override only if you are connecting to external instances.

Memgraph

VariableDefaultPurpose
MEMGRAPH_HOSTmemgraphHostname
MEMGRAPH_PORT7687Bolt port
MEMGRAPH_USER(empty)Username
MEMGRAPH_PASSWORD(empty)Password
MEMGRAPH_POOL_SIZE50Connection pool size
MEMGRAPH_POOL_TIMEOUT30.0Pool checkout timeout in seconds

Qdrant

VariableDefaultPurpose
QDRANT_HOSTqdrantHostname
QDRANT_PORT6333HTTP port
QDRANT_GRPC_PORT6334gRPC port
QDRANT_API_KEY(none)API key for secured Qdrant instances

Redis

VariableDefaultPurpose
REDIS_HOSTredisHostname
REDIS_PORT6379Port
REDIS_PASSWORD(none)Password
REDIS_DB0Database index
REDIS_MAX_CONNECTIONS50Connection pool size

Postgres

VariableDefaultPurpose
POSTGRES_HOSTpostgresHostname
POSTGRES_PORT5432Port
POSTGRES_USERengrammicUsername
POSTGRES_DATABASEengrammicDatabase name
POSTGRES_PASSWORDengrammicPassword (also listed under Required)

Server and Application

VariableDefaultPurpose
ENVIRONMENTdevelopmentThe selfhosted compose sets this to self-hosted.
HOST127.0.0.1Bind address
PORT8000Listen port
WORKERS4Uvicorn worker count
REQUEST_TIMEOUT30Request timeout in seconds
LOG_LEVELINFOLog verbosity. One of: DEBUG, INFO, WARNING, ERROR.
DEBUGfalseEnables debug mode. Do not enable in production.
RUN_MIGRATIONStrueMigrations run automatically on startup. Set to false to disable.

Telemetry

VariableDefaultPurpose
TELEMETRY__ENABLEDtrueAnonymous aggregate usage statistics. Set to false to opt out.

Note the double-underscore in TELEMETRY__ENABLED. Nested settings throughout the service use __ as a section delimiter (for example, SECTION__FIELD maps to section.field in config). The examples in Advanced Tuning below follow the same pattern.

Advanced Tuning

Most self-hosters never need to touch these. The service ships with sensible defaults for all internal settings, and the three examples below are the most commonly adjusted.

VariableDefaultPurpose
CUSTODIAN__ENABLEDfalseBackground contradiction and supersession detection. Increases write load.
RERANKING__ENABLEDtrueCross-encoder reranking of recall results. Disable to reduce latency at the cost of recall quality.
WEAK_LINKS__ENABLEDtrueSpeculative related-to edges created during ingestion. Disable to reduce graph size.

The service exposes many more tuning flags mapped to internal settings. They all default to sensible values. Changing them is rarely needed and not covered here; reach out to founders@engrammic.ai if you have a specific tuning requirement.

Not Configurable by Self-Hosters

The following belong to the managed cloud service and are not applicable to self-hosted deployments:

  • WorkOS auth (WORKOS_*): Authentication for the hosted multi-tenant service.
  • Stripe billing: Subscription and payment processing.
  • Rate-limit tiers: Per-plan request limits enforced by the managed gateway.
  • Telemetry beacon secrets: Credentials for the hosted telemetry backend.

Never commit secrets to version control. Keep your .env file out of git (add it to .gitignore), or use a secrets manager to inject values at runtime.

Container Image

The production image is:

europe-north1-docker.pkg.dev/engrammic/releases/engrammic-api:latest

Contact founders@engrammic.ai to get registry access.

On this page