Skip to content

Environment Variables Reference

Complete reference for all Sibyl environment variables.

Configuration Loading

Sibyl uses Pydantic Settings to load configuration:

  1. Environment variables (highest priority)
  2. .env file in apps/api/
  3. Default values

All variables use the SIBYL_ prefix. Some common variables (API keys) also support unprefixed versions as fallbacks.

Server Configuration

VariableDefaultDescription
SIBYL_ENVIRONMENTdevelopmentRuntime environment: development/staging/production
SIBYL_SERVER_NAMEsibylMCP server name
SIBYL_SERVER_HOSTlocalhostServer bind host
SIBYL_SERVER_PORT3334Server bind port
SIBYL_LOG_LEVELINFOLogging level: DEBUG/INFO/WARNING/ERROR

URL Configuration

VariableDefaultDescription
SIBYL_PUBLIC_URLhttp://localhost:3337Public base URL for OAuth callbacks, redirects
SIBYL_SERVER_URL(derived from public_url)API base URL override
SIBYL_FRONTEND_URL(derived from public_url)Frontend base URL override

When using Kong or similar ingress, SIBYL_PUBLIC_URL is typically set to the external domain (e.g., https://sibyl.example.com), and both API and frontend are served from the same origin.

Authentication

VariableDefaultDescription
SIBYL_JWT_SECRET(empty)Required. JWT signing secret
SIBYL_JWT_ALGORITHMHS256JWT signing algorithm
SIBYL_ACCESS_TOKEN_EXPIRE_MINUTES60Access token TTL in minutes
SIBYL_REFRESH_TOKEN_EXPIRE_DAYS30Refresh token TTL in days
SIBYL_DISABLE_AUTHfalseDisable auth enforcement (dev only)
SIBYL_MCP_AUTH_MODEautoMCP auth: auto/on/off
SIBYL_SETTINGS_KEY(auto)Fernet key for encrypting DB-stored secrets

Fallback Variables

These unprefixed variables are checked if SIBYL_* versions are empty:

  • JWT_SECRET -> SIBYL_JWT_SECRET

Security Warning

bash
# NEVER set disable_auth in production!
# This validation is enforced:
if environment == "production" and disable_auth:
    raise ValueError("disable_auth=True is forbidden in production")

GitHub OAuth

VariableDefaultDescription
SIBYL_GITHUB_CLIENT_ID(empty)GitHub OAuth application ID
SIBYL_GITHUB_CLIENT_SECRET(empty)GitHub OAuth application secret

Fallbacks:

  • GITHUB_CLIENT_ID -> SIBYL_GITHUB_CLIENT_ID
  • GITHUB_CLIENT_SECRET -> SIBYL_GITHUB_CLIENT_SECRET
VariableDefaultDescription
SIBYL_COOKIE_DOMAIN(none)Cookie domain override
SIBYL_COOKIE_SECURE(auto)Force Secure cookies (auto-detects from URL)

Password Hashing

VariableDefaultDescription
SIBYL_PASSWORD_PEPPER(empty)Optional pepper for password hashing
SIBYL_PASSWORD_ITERATIONS310000PBKDF2-HMAC-SHA256 iterations

Rate Limiting

VariableDefaultDescription
SIBYL_RATE_LIMIT_ENABLEDtrueEnable rate limiting
SIBYL_RATE_LIMIT_DEFAULT100/minuteDefault rate limit
SIBYL_RATE_LIMIT_STORAGEmemory://Storage backend (memory:// or redis://)

PostgreSQL

VariableDefaultDescription
SIBYL_POSTGRES_HOSTlocalhostPostgreSQL host
SIBYL_POSTGRES_PORT5433PostgreSQL port (5433 for local dev)
SIBYL_POSTGRES_USERsibylPostgreSQL username
SIBYL_POSTGRES_PASSWORDsibyl_devPostgreSQL password
SIBYL_POSTGRES_DBsibylPostgreSQL database name
SIBYL_POSTGRES_POOL_SIZE10Connection pool size
SIBYL_POSTGRES_MAX_OVERFLOW20Max overflow connections

Note: Port 5433 is the default for local development to avoid conflicts with a local PostgreSQL installation. In Kubernetes, the standard port 5432 is used.

FalkorDB

VariableDefaultDescription
SIBYL_FALKORDB_HOSTlocalhostFalkorDB host
SIBYL_FALKORDB_PORT6380FalkorDB port (6380 for local dev)
SIBYL_FALKORDB_PASSWORDconventionsFalkorDB password
SIBYL_REDIS_JOBS_DB1Redis DB for job queue (0 = graph data)

Note: Port 6380 is the default for local development to avoid conflicts with a local Redis installation.

LLM Configuration

VariableDefaultDescription
SIBYL_LLM_PROVIDERanthropicLLM provider: openai or anthropic
SIBYL_LLM_MODELclaude-haiku-4-5LLM model for entity extraction
SIBYL_EMBEDDING_MODELtext-embedding-3-smallOpenAI embedding model
SIBYL_EMBEDDING_DIMENSIONS1536Embedding vector dimensions
SIBYL_GRAPH_EMBEDDING_DIMENSIONS1024Graph (Graphiti) embedding dimensions

API Keys

VariableDefaultDescription
SIBYL_OPENAI_API_KEY(empty)OpenAI API key (required for embeddings)
SIBYL_ANTHROPIC_API_KEY(empty)Anthropic API key

Lookup Priority

API keys are resolved in this order:

  1. Database - Keys stored via web UI (Settings → AI Services)
  2. Environment variables - SIBYL_OPENAI_API_KEY, SIBYL_ANTHROPIC_API_KEY
  3. Unprefixed fallbacks - OPENAI_API_KEY, ANTHROPIC_API_KEY

This allows zero-config deployments where API keys are entered through the onboarding wizard and stored encrypted in the database (using SIBYL_SETTINGS_KEY).

Unprefixed Fallbacks

  • OPENAI_API_KEY -> SIBYL_OPENAI_API_KEY
  • ANTHROPIC_API_KEY -> SIBYL_ANTHROPIC_API_KEY

Graphiti Configuration

VariableDefaultDescription
SIBYL_GRAPHITI_SEMAPHORE_LIMIT10Concurrent LLM operations limit
SEMAPHORE_LIMIT(none)Alternative for Graphiti semaphore
GRAPHITI_TELEMETRY_ENABLEDfalseGraphiti telemetry (disabled by default)

Email (Resend)

VariableDefaultDescription
SIBYL_RESEND_API_KEY(empty)Resend API key for transactional email
SIBYL_EMAIL_FROMSibyl <noreply@sibyl.dev>Default from address

Content Ingestion

VariableDefaultDescription
SIBYL_CHUNK_MAX_TOKENS1000Maximum tokens per chunk
SIBYL_CHUNK_OVERLAP_TOKENS100Token overlap between chunks

Worker Configuration

VariableDefaultDescription
SIBYL_RUN_WORKERfalseEmbed arq worker in API process

Example .env Files

Local Development

bash
# apps/api/.env
SIBYL_ENVIRONMENT=development
SIBYL_JWT_SECRET=dev-secret-change-in-production

# Databases (Docker Compose ports)
SIBYL_POSTGRES_HOST=localhost
SIBYL_POSTGRES_PORT=5433
SIBYL_FALKORDB_HOST=localhost
SIBYL_FALKORDB_PORT=6380

# LLM
SIBYL_OPENAI_API_KEY=sk-...
SIBYL_ANTHROPIC_API_KEY=sk-ant-...

# Logging
SIBYL_LOG_LEVEL=DEBUG

Production

bash
SIBYL_ENVIRONMENT=production
SIBYL_JWT_SECRET=<generate with: openssl rand -hex 32>

# Public URL (Kong/ingress domain)
SIBYL_PUBLIC_URL=https://sibyl.example.com

# Databases
SIBYL_POSTGRES_HOST=prod-postgres.internal
SIBYL_POSTGRES_PORT=5432
SIBYL_POSTGRES_PASSWORD=<secure-password>
SIBYL_FALKORDB_HOST=prod-falkordb.internal
SIBYL_FALKORDB_PORT=6379
SIBYL_FALKORDB_PASSWORD=<secure-password>

# LLM
SIBYL_OPENAI_API_KEY=sk-...
SIBYL_ANTHROPIC_API_KEY=sk-ant-...
SIBYL_LLM_PROVIDER=anthropic
SIBYL_LLM_MODEL=claude-sonnet-4

# Rate limiting with Redis
SIBYL_RATE_LIMIT_STORAGE=redis://prod-redis.internal:6379

# Email
SIBYL_RESEND_API_KEY=re_...
SIBYL_EMAIL_FROM=Sibyl <sibyl@example.com>

Kubernetes ConfigMap

Non-secret environment variables in ConfigMap:

yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: sibyl-config
  namespace: sibyl
data:
  SIBYL_ENVIRONMENT: "production"
  SIBYL_SERVER_HOST: "0.0.0.0"
  SIBYL_SERVER_PORT: "3334"
  SIBYL_PUBLIC_URL: "https://sibyl.example.com"
  SIBYL_LLM_PROVIDER: "anthropic"
  SIBYL_LLM_MODEL: "claude-haiku-4-5"
  SIBYL_EMBEDDING_MODEL: "text-embedding-3-small"
  SIBYL_EMBEDDING_DIMENSIONS: "1536"

Kubernetes Secret

Sensitive values in Secret:

yaml
apiVersion: v1
kind: Secret
metadata:
  name: sibyl-secrets
  namespace: sibyl
type: Opaque
stringData:
  SIBYL_JWT_SECRET: "<jwt-secret>"
  SIBYL_SETTINGS_KEY: "<fernet-key>" # Generate with: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
  SIBYL_OPENAI_API_KEY: "sk-..." # Optional if using DB-stored keys
  SIBYL_ANTHROPIC_API_KEY: "sk-ant-..." # Optional if using DB-stored keys
  SIBYL_POSTGRES_PASSWORD: "<db-password>"
  SIBYL_FALKORDB_PASSWORD: "<falkordb-password>"

Running Multiple Instances

You can run multiple Sibyl instances on the same machine (e.g., dev + test environments) by configuring different ports and container names.

Port Configuration

VariableDefaultDescription
SIBYL_SERVER_PORT3334API/MCP server port
SIBYL_WEB_PORT3337Web frontend port
SIBYL_FALKORDB_PORT6380FalkorDB port
SIBYL_FALKORDB_BROWSER_PORT3335FalkorDB Browser UI
SIBYL_POSTGRES_PORT5433PostgreSQL port
SIBYL_BACKEND_URL(auto)Backend URL for web app

Quick Setup: Test Instance

  1. Create .env.test with offset ports (copy from .env.test.example):
bash
COMPOSE_PROJECT_NAME=sibyl-test
SIBYL_SERVER_PORT=3344
SIBYL_WEB_PORT=3347
SIBYL_FALKORDB_PORT=6390
SIBYL_POSTGRES_PORT=5443
SIBYL_POSTGRES_DB=sibyl_test
  1. Start databases with isolated containers and volumes:
bash
docker compose -p sibyl-test --env-file .env.test up -d
  1. Start API pointing to test databases:
bash
env $(cat .env.test | xargs) sibyld serve
  1. Start web frontend:
bash
SIBYL_WEB_PORT=3347 SIBYL_BACKEND_URL=http://localhost:3344 pnpm -C apps/web dev

How It Works

  • COMPOSE_PROJECT_NAME isolates Docker containers and volumes (e.g., sibyl-test-falkordb)
  • Each port variable controls the corresponding service
  • SIBYL_BACKEND_URL tells the web frontend where to proxy API requests

Tips

  • Use docker compose -p sibyl-test ps to see test instance containers
  • Volumes are namespaced by project: sibyl-test_falkordb_data vs sibyl_falkordb_data
  • CLI contexts let you switch between instances: sibyl context use test

Computed Properties

The Settings class provides computed connection URLs:

python
settings.falkordb_url  # redis://:password@host:port
settings.postgres_url  # postgresql+asyncpg://user:pass@host:port/db
settings.postgres_url_sync  # postgresql://user:pass@host:port/db (for Alembic)

Released under the MIT License.