Configuration

RelataDB is configured through environment variables, with an optional relata.toml config file for persisted settings (search order: --config <path> flag, RELATA_CONFIG env var, ./relata.toml, then ~/.relata/config.toml). A bare relata serve starts in dev mode with safe defaults. Production requires three things: a profile, a bearer token, and (optionally) an object-store endpoint.

Strict parsing. Every RELATA_* value is validated at startup. A malformed value (e.g. RELATA_PORT=abc or RELATA_WAL_SYNC=true) causes a FATAL startup error — Relata refuses to boot rather than silently using a wrong default. Removed/renamed vars (e.g. RELATA_ORG_MODE) also FATAL.

Operator tools:

  • relata config --print-template — emit a commented .env template of every RELATA_* var.
  • relata config --validate — check your config before boot.
  • relata config --migrate — auto-rewrite old var names to the current surface (run when upgrading from 1.x).
  • relata doctor — 12 pre-flight checks (config, ports, KMS, disk).

Pick a profile first

RELATA_PROFILE is the master switch. Set it before anything else.

# Local dev — no auth required, unbounded RAM, eager restart
RELATA_PROFILE=free relata serve
 
# Single-node production — 1 GB row-store RAM wall, disk-first walls on, requires bearer token
RELATA_PROFILE=server RELATA_BEARER_TOKEN=<your-strong-token> relata serve
 
# Multi-node (alpha) — same as server plus coordination
RELATA_PROFILE=cluster RELATA_BEARER_TOKEN=<your-strong-token> relata serve

lite was a legacy alias for free and is now rejected outright — startup fails if RELATA_PROFILE=lite is set; use free. The server and cluster profiles refuse to start without RELATA_BEARER_TOKEN set.

ProfileRAM wallLazy restartDisk-first walls
freeunboundedoffoff
server1024 MBonon
cluster1024 MBonon

Domain profile

RELATA_DOMAIN_PROFILE loads the matching ontology overlay and default detector packs.

RELATA_DOMAIN_PROFILE=finint relata serve
ValueUse caseDefault detectors
enterprise (default)General businessnetwork,contact,crypto
leaLaw enforcementnetwork + identity
finintFinancial intelligencenetwork + contact + crypto
securitySecurity operationsnetwork + device + crypto
customBring-your-own ontologywhatever you wire

Environment variable reference

Profile and deployment

VariableDefaultDescription
RELATA_PROFILEfreeDeployment shape: free | server | cluster. lite is removed — rejected at startup.
RELATA_DOMAIN_PROFILEenterpriseOntology overlay: enterprise | lea | finint | security | custom.
RELATA_PORT9090HTTP/gRPC listen port.

Auth

VariableDefaultDescription
RELATA_BEARER_TOKENUnset = dev mode, no auth, pgwire disabled. Required on server/cluster.
RELATA_ADMIN_TOKENSecondary token for /admin/* operations.
RELATA_AUTH_MODEoidc | oidc-verify | saml | mtls for federated auth.
RELATA_PLAINTEXT_OKtrue to allow plain HTTP on server/cluster (not recommended).

Storage

VariableDefaultDescription
RELATA_DATA_DIR./data/relataRoot for WAL state and local object store.
RELATA_LOCAL_DATA_DIRExplicit local object-store path (dedicated volume).
AWS_ENDPOINT_URLS3-compatible endpoint. When set, overrides local disk. Also set AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, RELATA_S3_BUCKET.
RELATA_IN_MEMORYtrue = in-memory only, data lost on restart.
RELATA_WAL_SYNCintervalProcess-global WAL fsync mode: always (fsync on every flush, RPO≈0) | interval (default — batched fsync every ~10 ms, RPO≈10 ms) | off (page-cache only). Any other value (including true/1) is a FATAL startup error.

RAM and cache limits

VariableDefault (server/cluster)Description
RELATA_STORE_MAX_RAM_MB1024Row-store RAM budget before spill to disk. Unbounded on free.
RELATA_DISKANN_MAX_RESIDENT0 (unbounded)Soft cap on RAM-resident vectors.
RELATA_MV_MAX_ROWS1000000Max rows in an incremental materialized-view cache. 0 = unbounded.
RELATA_VECTOR_COLD_RESIDENT_MAX100000Max staging vectors in an IVF cold bucket before spill.
RELATA_TOMBSTONE_CACHE_MAX_ROWS1024Per-type tombstone cache size. Lower saves RAM; raises on-disk re-reads.
RELATA_DECODED_SEGMENT_CACHE_MAX64Max decoded disk-segment entries in RAM.

Cold-start and restart

VariableDefaultDescription
RELATA_LAZY_RESTARTfalse (true on server/cluster)true loads manifest catalog only — O(manifest) not O(rows).
RELATA_HYDRATE_RECENT_SEGMENTS0With lazy restart, pre-warm the newest N segments into RAM. 0 = fully lazy.
RELATA_FLUSH_SEGMENT_MAX_ROWS250000Max rows per flushed Parquet segment. Larger deltas split into ceil(delta/N) segments.

Search and embedding

VariableDefaultDescription
RELATA_SEARCH_PRESETbalancedBM25/FTS fuzzy expansion: strict | balanced | lenient.
RELATA_EMBED_BATCH_SIZE32Texts per embed() call per drain cycle. Higher = fewer round-trips, more first-result latency.
RELATA_EMBED_CONCURRENCY4Concurrent drain-worker tasks.
RELATA_EMBED_QUEUE_MAX100000Hard cap on embedding backlog.
RELATA_EMBED_TIMEOUT_MS30000Timeout for embedder sidecar HTTP calls.
RELATA_EMBED_CIRCUIT_COOLDOWN_MS60000After 5 consecutive errors, circuit opens; /health/ready returns 503.
RELATA_DETECT_BATCH_SIZE256Chunk size for batched identity detection.

SmartIngest detector packs

# Default
RELATA_DETECT_PACKS=network,contact,crypto
 
# Add financial and payment
RELATA_DETECT_PACKS=network,contact,crypto,financial,payment
 
# All packs
RELATA_DETECT_PACKS=all
 
# Disable detection
RELATA_DETECT_PACKS=none

Available opt-in additions: financial, payment, social, transport, device, ics.

Observability

VariableDefaultDescription
RELATA_LOG_FORMATprettypretty for terminals, json for log shippers.
RELATA_LOG_LEVELinfotrace | debug | info | warn | error.
RELATA_OTLP_ENDPOINTOTLP/HTTP trace exporter, e.g. http://otel-collector:4318/v1/traces. Unset = OTel fully disabled.
RELATA_OTLP_SAMPLE_RATIO0.01TraceID-ratio sampler. 1.0 = sample everything.
RELATA_METRICS_PUBLICtrue serves /metrics without a bearer token (for Prometheus scrapers behind mTLS/NetworkPolicy).

Rate limits

VariableDefaultDescription
RELATA_RATE_LIMIT_RPSprofile-dependentPer-principal requests/sec cap.
RELATA_RATE_LIMIT_AUTH_FAIL_RPSprofile-dependentAuth-failure rate cap. 0 is treated as 1. Use 99999 to disable.

To disable rate limits for load tests or air-gapped demos:

RELATA_RATE_LIMIT_RPS=99999 RELATA_RATE_LIMIT_AUTH_FAIL_RPS=99999 relata serve

Purpose enforcement

VariableDefaultDescription
RELATA_PURPOSE_MODEopenstrict = only registered purposes accepted; open = any non-empty string.
RELATA_PURPOSESComma-separated registered purpose IDs, e.g. analytics,audit,compliance.

Minimal production docker-compose

Copy this, replace the token and bucket values, and run docker compose up -d.

services:
  relata:
    image: ghcr.io/relatadb/relata:latest
    restart: unless-stopped
    ports:
      - "9090:9090"
    environment:
      RELATA_PROFILE: server
      RELATA_BEARER_TOKEN: "change-me-use-openssl-rand-hex-32"
      RELATA_PORT: "9090"
      RELATA_DOMAIN_PROFILE: enterprise
      RELATA_PURPOSE_MODE: strict
      RELATA_PURPOSES: analytics,audit,compliance
      RELATA_STORE_MAX_RAM_MB: "2048"
      RELATA_LAZY_RESTART: "true"
      RELATA_HYDRATE_RECENT_SEGMENTS: "5"
      RELATA_LOG_FORMAT: json
      RELATA_LOG_LEVEL: info
      RELATA_OTLP_ENDPOINT: "http://otel-collector:4318/v1/traces"
      RELATA_METRICS_PUBLIC: "true"
      AWS_ENDPOINT_URL: "http://minio:9000"
      AWS_ACCESS_KEY_ID: minio
      AWS_SECRET_ACCESS_KEY: minio123
      RELATA_S3_BUCKET: relata-data
    volumes:
      - relata-data:/var/lib/relata
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:9090/health"]
      interval: 10s
      timeout: 5s
      retries: 3
    depends_on:
      minio:
        condition: service_healthy
 
  minio:
    image: minio/minio:latest
    command: server /data --console-address ":9001"
    environment:
      MINIO_ROOT_USER: minio
      MINIO_ROOT_PASSWORD: minio123
    ports:
      - "9000:9000"
      - "9001:9001"
    volumes:
      - minio-data:/data
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
      interval: 10s
      timeout: 5s
      retries: 3
 
volumes:
  relata-data:
  minio-data:

Verify the node is healthy after startup:

curl http://localhost:9090/health
curl http://localhost:9090/health/ready
curl http://localhost:9090/version

Singleton enforcement

relata serve acquires an exclusive flock on data_dir/relata.lock. If two pods share the same PVC, the second one fails with a clear error rather than silently splitting writes. This is especially important in Kubernetes rolling updates — use RollingUpdate strategy with maxUnavailable: 1 or switch to a StatefulSet.

See also