Groundeddocs

Configuration reference

Every environment variable Grounded reads, grouped, with its default.

Grounded reads its settings from environment variables, optionally layered over a flat YAML file named by GROUNDED_CONFIG_FILE (environment variables win). Secrets can also be read from files: set KEY_FILE to a path instead of KEY, for example SMTP_PASSWORD_FILE=/run/secrets/smtp-password. This works for every secret below.

On Kubernetes, non-secret settings go in the grounded-config ConfigMap and secrets in grounded-runtime (see Install on Kubernetes). The environment variables in this list are meant to stay stable through 0.x; if one has to change, the release notes say how to adapt.

Defaults shown are the binary's own. The Kubernetes base sets a few differently; they're noted.

Server

VariableDefaultMeaning
APP_URL(required)The public origin people reach Grounded at. Must be https:// unless it's a loopback address. The OIDC redirect URI is <APP_URL>/auth/callback.
HTTP_ADDR:8080The API and web app listener.
WORKER_HTTP_ADDR:9090The worker's listener (health and metrics only).
METRICS_ADDR(empty)Serve the API's /metrics (and health checks) on this internal listener instead of HTTP_ADDR, so a public ingress never exposes it. The base sets :9091.
LOG_FORMATjsonjson or text.
LOG_LEVELinfodebug, info, warn or error.
MIGRATE_ON_STARTfalseRun migrations when the server starts. The Kubernetes base keeps it off and runs them in an init container.
SHUTDOWN_DELAY5sHow long a stopping pod keeps answering while failing readiness, so load balancers notice. The base sets 10s.
SHUTDOWN_TIMEOUT60sTime in-flight requests (including streamed chats) and jobs get to finish. The base sets 90s; keep the pod's grace period above both.
TRUSTED_PROXIES(empty)CIDRs of the ingress controller, allowed to set X-Forwarded-For. Needed for correct client IPs, per-address rate limits and logs.
SESSION_TTL12hBrowser session lifetime (5 minutes to 30 days).
REQUESTS_PER_MINUTE600A general request limit per signed-in user.
LOGIN_ATTEMPTS_PER_MINUTE20Sign-in attempts per client address.
WORKER_CONCURRENCY10Background jobs run at once per worker process (the default queue).
GROUNDED_CONFIG_FILE(empty)A YAML file of settings, read first.

Data stores

VariableDefaultMeaning
DATABASE_URL(required, secret)PostgreSQL connection URL. pool_max_conns in it sets the pool size.
VALKEY_URL(required, secret)Valkey or Redis URL, redis:// or rediss://.
VALKEY_PREFIXgrounded:Prefix for every key, if the Valkey instance is shared.
BLOB_BACKENDfss3 for any real install (the base sets it); fs stores files on local disk, for development.
BLOB_DIRdata/blobsDirectory for the fs backend.
S3_ENDPOINT(empty)S3-compatible endpoint. For AWS, the regional endpoint.
S3_BUCKET(empty)Bucket name.
S3_REGIONus-east-1Region.
S3_ACCESS_KEY, S3_SECRET_KEY(secret)Credentials. On Kubernetes they come from the grounded-s3 secret.
S3_PREFIX(empty)Key prefix inside the bucket.
S3_FORCE_PATH_STYLEtruePath-style addressing, which most S3-compatible services need.
S3_CA_FILE(empty)A CA bundle for an endpoint with a private certificate.

Secrets and keys

VariableMeaning
ENCRYPTION_KEYEncrypts secrets stored in the database (gateway, SMTP and moderation credentials). 32 random bytes, base64: openssl rand -base64 32. Back it up.
ENCRYPTION_KEY_PREVIOUSThe old key during a rotation, still accepted for reads.
API_KEY_PEPPERKeys the HMAC of stored API keys and widget keys. Generate it like ENCRYPTION_KEY. Changing it without keeping the old value invalidates all keys.
API_KEY_PEPPER_PREVIOUSThe old pepper during a rotation; keys on it are re-hashed when next used.

Grounded refuses to start off loopback with the example values from .env.example. See Rotating keys.

Sign-in

VariableDefaultMeaning
OIDC_ISSUER(empty)Your identity provider's issuer URL. Required off loopback.
OIDC_CLIENT_ID(empty)The client ID.
OIDC_CLIENT_SECRET(secret)The client secret.
OIDC_SCOPESopenid,profile,emailScopes to request.
OIDC_EMAIL_CLAIMemailThe claim that holds the email address.
OIDC_GROUPS_CLAIMgroupsThe ID token claim that lists groups, for SSO group mapping.
OIDC_REQUIRE_VERIFIED_EMAILtrueRefuse sign-ins whose email isn't verified.
OIDC_ALLOWED_EMAIL_DOMAINS(empty)Comma-separated domains allowed to sign in. Empty allows anyone the provider signs in (reported as information).
BOOTSTRAP_ADMIN_SUBJECT(empty)The OIDC subject of the first platform admin.
DEV_AUTHfalseDevelopment sign-in with fixed personas. Refused unless APP_URL is loopback.
DEV_AUTH_GROUPS(empty)Development only: groups for the personas, persona=group,group;persona=group.

See OIDC and SSO.

Instance identity

VariableDefaultMeaning
INSTANCE_NAMEGroundedThe product name in the app and page titles.
ORG_NAME(empty)Your organisation's name, used in the app and the agents' preamble.
UI_THEMEneutralThe only theme. Brand with the settings in this table.
UI_LOGO_URL(empty)An https URL or same-origin path for your logo.
SUPPORT_URL(empty)The "Help" link: an http(s) URL or a mailto: address.
TEAM_REQUEST_URL(empty)Where people request a team, for example a service-desk form.

Ingestion and retrieval

VariableDefaultMeaning
MAX_UPLOAD_BYTES100 MBThe largest upload.
INGEST_CONCURRENCY4Document jobs per worker process.
INGEST_MAX_INFLIGHT32Documents queued or processing across the platform.
INGEST_MAX_INFLIGHT_PER_TEAM8The default for the team limit "concurrent ingestion jobs".
EMBED_BATCH_SIZE64Inputs per embedding request, shared across documents.
EMBED_BATCH_TOKENS32768Counted tokens per embedding request (0 = no limit).
EMBED_BATCH_WAIT100msHow long a partial embedding request waits for more documents.
PDF_WORKERS2PDF parser instances per process (each uses tens of MB).
VECTOR_EXACT_THRESHOLD100000Knowledge bases with up to this many vectors are searched exactly.
VECTOR_EF_SEARCH400The approximate index's candidate list above the threshold.
RETRIEVAL_VECTOR_WEIGHT1Platform default hybrid fusion weight for vector search (0–1).
RETRIEVAL_KEYWORD_WEIGHT0.1Platform default weight for keyword search (0–1).
PROFILE_MIGRATION_GRACE_DAYS7Days a knowledge base keeps its old vectors after a profile migration (0–90).
EVALUATION_CONCURRENCY2Questions an evaluation run checks at once (1–8).
BOILERPLATE_WEBtrueRemove repeated blocks from web sources by default.
BOILERPLATE_UPLOADfalseThe same for upload sources.
BOILERPLATE_MIN_DOCS5A block is repeated when it's in at least this many documents…
BOILERPLATE_RATIO0.2…and this share of the source's documents (0.05–1).

Parsing and OCR

VariableDefaultMeaning
TIKA_URL(empty)Apache Tika, used as a fallback parser and as an OCR backend with its -full image.
TIKA_TIMEOUT2mOne Tika request.
TIKA_PREFER_KINDS(empty)Kinds sent to Tika before the built-in parser, for example pdf.
OCR_TESSERACT_URL(empty)The grounded-ocr sidecar; makes Tesseract selectable.
OCR_TIMEOUT2mOne page's OCR request.
OCR_MAX_PAGES_PER_DOCUMENT200Pages read per document; the rest are skipped with a warning.
OCR_CONCURRENCY2Pages read at once per worker process.

OCR stays off until a platform admin turns it on. See Parsing and OCR.

Web crawling

VariableDefaultMeaning
CRAWL_ALLOWLIST_SEED(empty)Host patterns (*.example.org,example.com) added to the crawl allowlist once, on the first start. Deleting them later doesn't bring them back.
CRAWL_MAX_PAGES10000The ceiling for a source's maximum pages.
CRAWL_ORIGIN_INTERVAL1sSpacing between requests to one site, across all workers (100 ms to 1 minute).
CRAWL_USER_AGENTgrounded/1.0 (+$APP_URL/bot)The crawler's user agent. Grounded doesn't serve a /bot page, so set one with a real contact URL.
CRAWL_TIMEOUT30sPer request, including the body.
CRAWL_MAX_BODY_BYTES20 MiBLarger pages are skipped.
CRAWL_CONCURRENCY4Crawl jobs per worker process.

Private, loopback and link-local addresses, and ports other than 80 and 443, are always refused.

Email

Email is off while SMTP_HOST is empty; in-app notifications always work.

VariableDefaultMeaning
SMTP_HOST(empty)The relay.
SMTP_PORT587587 for STARTTLS, 465 for TLS.
SMTP_TLSstarttlsstarttls, tls or none (a local relay only).
SMTP_USERNAME, SMTP_PASSWORD(empty; password secret)Credentials, if the relay needs them.
SMTP_FROM(empty)The sender, for example "Grounded <grounded@example.org>".

Public agents

VariableDefaultMeaning
ANON_SESSION_TTL24hAnonymous sessions end this long after their last use.
CAPTCHA_PROVIDERnonenone or turnstile.
TURNSTILE_SITE_KEY, TURNSTILE_SECRET_KEY(empty; secret key secret)Cloudflare Turnstile keys.
MODERATION_TIMEOUT10sBounds each moderation check attempt (1 s to 2 minutes). Chat classifiers get at least 30 s.

Public access itself is switched on in the admin portal.

Retention defaults

Empty or keep keeps the data. A platform admin can override each one under Retention. Conversation retention is set per classification level instead. Confirm periods with your records management first.

VariableRangeKind
RETENTION_DELETED_CONVERSATIONS_DAYS0–36500Grace period after a user deletes a conversation.
RETENTION_ACCESS_LOG_DAYS1–36500The access log.
RETENTION_ANALYTICS_EVENTS_DAYS1–36500Per-answer metadata events.
RETENTION_USAGE_EVENTS_DAYS7–36500The usage ledger (rolled up per day first).
RETENTION_AUDIT_LOG_DAYS30–36500The audit log (legal hold entries are always kept).
RETENTION_DELETED_FILES_DAYS0–36500Stored files of deleted documents and sources.
RETENTION_EXPIRED_INVITES_DAYS1–36500Invites after they expire or are revoked.
RETENTION_EVALUATION_RUNS_DAYS1–36500 or keepEvaluation runs and results. Default 180.
RETENTION_BATCH_SIZEdefault 500Rows per transaction.
RETENTION_MAX_BATCHESdefault 100Batches per kind per run (runs are every 10 minutes).

The demo

grounded demo has its own DEMO_* variables, one per flag. See Try it locally.

On this page