Skip to main content

Configuration reference

Every variable here is described once, in packages/env, and read from there by three things: the check each app runs at boot, the type of the ragen.config.ts the installer writes, and this page. They cannot drift from each other, which is the point — an earlier hand-written version of this reference disagreed with the code about which S3 variables were required.

A required variable is required once you have chosen that provider, not in general. Everything optional has a working default in code.

Providers

One variable picks an implementation, and that choice decides what else you have to set.

Storage

Chosen with STORAGE_PROVIDER, which defaults to local.

STORAGE_PROVIDER=local

Files on the container filesystem. STORAGE_LOCAL_PATH defaults to ./data/storage, so nothing is mandatory — but every process that touches files needs the same volume.

VariableConfig field
STORAGE_LOCAL_PATHpathoptional

STORAGE_PROVIDER=s3

Any S3-compatible store. S3_ENDPOINT_URL is optional — unset selects the default AWS endpoint, and it is set to point at R2, Scaleway, MinIO or Ceph. S3_SESSION_TOKEN is for temporary credentials; S3_FORCE_PATH_STYLE for stores that need path-style addressing.

VariableConfig field
S3_BUCKET_NAMEbucketNamerequired
S3_REGIONregionrequired
S3_ACCESS_KEY_IDaccessKeyIdrequired
S3_SECRET_ACCESS_KEYsecretAccessKeyrequired
S3_ENDPOINT_URLendpointoptional
S3_SESSION_TOKENsessionTokenoptional
S3_FORCE_PATH_STYLEforcePathStyleoptional

Encryption

Chosen with ENCRYPTION_PROVIDER. Unset auto-detects from whichever credentials are present, in the order Scaleway, KMS, local (getKeyProvider()). A deployed environment with no provider at all refuses to start, unless ALLOW_UNENCRYPTED=1 says so deliberately.

ENCRYPTION_PROVIDER=scaleway

Scaleway Key Manager (ADR-02).

VariableConfig field
SCW_KEY_MANAGER_KEY_IDkeyIdrequired
SCW_API_KEYapiKeyrequired
SCW_KEY_MANAGER_REGIONregionoptional

ENCRYPTION_PROVIDER=kms

AWS KMS.

VariableConfig field
AWS_KMS_KEY_IDkeyIdrequired
AWS_DEFAULT_REGIONregionoptional
AWS_ENDPOINT_URLendpointoptional

ENCRYPTION_PROVIDER=local

A key in the environment. Present is not the same as usable: the value is parsed by @ragenai/crypto, not here.

VariableConfig field
ENCRYPTION_MASTER_KEYmasterKeyrequired

Reranker

Chosen with RERANK_PROVIDER, which defaults to scaleway.

RERANK_PROVIDER=scaleway

Scaleway /v1/rerank (qwen3-embedding-8b). The default. SCW_API_KEY is the same account key the Scaleway encryption provider uses — one key, two features.

VariableConfig field
SCW_API_BASEapiBaserequired
SCW_API_KEYapiKeyrequired
RERANK_MODELmodeloptional

RERANK_PROVIDER=cohere

Cohere Rerank v3.5 through the LiteLLM proxy, so cost and traces are tracked like any other model call. Requires nothing of its own: it routes through LITELLM_PROXY_URL, which the gateway already requires. Opt-in — cohere-rerank-v3-5 is no longer registered in infra/litellm/config.yaml.

VariableConfig field
RERANK_MODELmodeloptional

Mail

Chosen with MAIL_PROVIDER. Unset detects from credentials: RESEND_API_KEY selects Resend, SMTP_HOST selects SMTP. With neither, outside production the message is logged instead of sent, and in production getMailProvider() throws rather than let an operator silently lose every invitation.

MAIL_PROVIDER=resend

Resend.

VariableConfig field
RESEND_API_KEYapiKeyrequired
RESEND_DEFAULT_SEGMENT_IDdefaultSegmentIdoptional

MAIL_PROVIDER=smtp

Any SMTP relay. Only the host is required: SMTP_PORT defaults to 587, and authentication is set only when SMTP_USER is given, because unauthenticated relays are real.

VariableConfig field
SMTP_HOSThostrequired
SMTP_PORTportoptional
SMTP_USERuseroptional
SMTP_PASSpasswordoptional
SMTP_SECUREsecureoptional

MAIL_PROVIDER=console

Log the message instead of sending it. What a laptop wants, and an explicit way to say in production that no email will be delivered — which the mailer otherwise refuses to assume.

Needs nothing else.

Settings

No choice to make — these are the same variables whatever else is configured.

Database

Postgres. directUrl bypasses a connection pooler for migrations; without it the pooled URL is used for both.

VariableConfig field
DATABASE_URLurlrequired
DATABASE_DIRECT_URLdirectUrloptional

Model gateway

Every model call goes through LiteLLM (ADR-04), so an unset URL is not a degraded mode — it is no LLM at all. The key is optional locally and required on a deployment.

VariableConfig field
LITELLM_PROXY_URLurlrequired
LITELLM_MASTER_KEYmasterKeyoptional

Vector store

Qdrant, the only supported vector store (ADR-31). The URL falls back to http://localhost:6333 in code, which is why it is optional here and required outright in a deployed apps/worker — a silent fallback there once wrote every vector into a container-local Qdrant and reported success.

VariableConfig field
QDRANT_URLurloptional
QDRANT_API_KEYapiKeyoptional

Models

Defaults for each job. All optional: each has a fallback in code, and apps/worker requires embeddings and vectorSize outright because its ingest cannot guess either. Changing embeddings or vectorSize after documents exist invalidates the collection.

VariableConfig field
DEFAULT_MODELchatoptional
DEFAULT_MODEL_PROVIDERchatProvideroptional
REPHRASE_MODELrephraseoptional
REPHRASE_TEMPERATURErephraseTemperatureoptional
SUMMARY_MODELsummaryoptional
EMBEDDINGS_MODELembeddingsoptional
VECTOR_SIZEvectorSizeoptional

Observability

OpenTelemetry (ADR-22). A no-op in apps/web without an endpoint; apps/worker also traces on a Langfuse key alone.

VariableConfig field
OTEL_EXPORTER_OTLP_ENDPOINTendpointoptional
OTEL_SERVICE_NAMEserviceNameoptional

Token vault

Connector OAuth tokens and API keys (ADR-32). Each URL and its secret are all-or-nothing: a URL without its secret produces 401s rather than a legible error.

VariableConfig field
RAGEN_TOKEN_VAULT_URLconnectorUrloptional
RAGEN_TOKEN_VAULT_SERVICE_SECRETconnectorSecretoptional
RAGEN_VAULT_URLurloptional
RAGEN_VAULT_SERVICE_SECRETsecretoptional

The token vault is all-or-nothing: RAGEN_TOKEN_VAULT_URL and RAGEN_TOKEN_VAULT_SERVICE_SECRET must both be set or both omitted.

The vault is all-or-nothing: RAGEN_VAULT_URL and RAGEN_VAULT_SERVICE_SECRET must both be set or both omitted.