Skip to main content

Configuration Reference

All configuration is via environment variables.

Required

VariableDescription
DATABASE_URLPostgreSQL connection string. Format: postgres://user:pass@host:port/db?sslmode=disable
JWT_SECRETSecret for signing JWT tokens. Generate with openssl rand -hex 32
MASTER_KEYEncryption key for stored secrets (OAuth tokens, API keys). Generate with openssl rand -hex 32

Server

VariableDefaultDescription
PORT8080HTTP server port
RUN_MODEallall (combined), api (API only), or worker (worker only)
BASE_URLhttp://localhost:$PORTPublic base URL the server advertises (used to build the MCP server URL when MCP_SERVER_URL is not set)
UI_BASE_URLhttp://localhost:3000Admin UI URL (used for OAuth redirects)
CORS_ORIGINShttp://localhost:3000Comma-separated allowed origins. * allows any origin (dev only)
AUTO_MIGRATEtrueRun pending schema migrations on startup. Set false if migrations are managed by sidecars (see the docker-compose example)
SERCHA_DEV--When set, allows sslmode=disable on the DATABASE_URL and skips a few prod-only safety checks

Search backends

VariableDefaultDescription
OPENSEARCH_URL--OpenSearch URL for BM25 search. Example: http://opensearch:9200
PGVECTOR_URL--PostgreSQL URL for vector search. Can be the same as DATABASE_URL
PGVECTOR_DIMENSIONS1536Vector dimensions. Must match your embedding model

AI providers (optional)

Set the API key for any provider you want to enable. All providers are optional — OPENAI_API_KEY is the most common.

VariableDescription
OPENAI_API_KEYOpenAI API key (embeddings + LLM)
OPENAI_BASE_URLCustom OpenAI-compatible endpoint (default https://api.openai.com/v1)
ANTHROPIC_API_KEYAnthropic API key (LLM)
ANTHROPIC_BASE_URLOverride Anthropic endpoint (default https://api.anthropic.com)
COHERE_API_KEYCohere API key (embeddings + LLM)
COHERE_BASE_URLOverride Cohere endpoint
VOYAGE_API_KEYVoyage AI API key (embeddings)
VOYAGE_BASE_URLOverride Voyage endpoint
OLLAMA_BASE_URLLocal Ollama server URL (e.g. http://localhost:11434)

These can also be configured at runtime via the AI Settings API.

Embedding & LLM rate-limiter tuning

Two separate buckets — embeddings and chat completions are rate-limited independently by the upstream provider, so they need their own client-side budgets. Defaults are sized for OpenAI tier 1; bump for higher tiers.

VariableDefaultDescription
EMBEDDER_TPM1000000Embedding bucket — tokens-per-minute
EMBEDDER_RPM3000Embedding bucket — requests-per-minute
LLM_TPM200000LLM bucket — tokens-per-minute
LLM_RPM500LLM bucket — requests-per-minute

OAuth providers (optional)

Set these to enable OAuth connectors. See Connectors for per-provider setup guides.

VariableDescription
GITHUB_CLIENT_IDGitHub OAuth App client ID
GITHUB_CLIENT_SECRETGitHub OAuth App client secret
NOTION_CLIENT_IDNotion integration client ID
NOTION_CLIENT_SECRETNotion integration client secret
MICROSOFT_CLIENT_IDMicrosoft Entra app client ID (OneDrive)
MICROSOFT_CLIENT_SECRETMicrosoft Entra app client secret

These can also be configured at runtime via the Providers API.

MCP server

VariableDefaultDescription
MCP_ENABLEDtrueEnable the MCP HTTP endpoint
MCP_SERVER_URL$BASE_URL/mcpPublic URL the MCP endpoint advertises (used in OAuth metadata responses)

Worker

VariableDefaultDescription
WORKER_CONCURRENCY2Number of concurrent task processors
WORKER_DEQUEUE_TIMEOUT5Seconds to wait when queue is empty
MAX_WORKERS10Hard ceiling on worker fan-out across the cluster
SCHEDULER_ENABLEDtrueEnable the task scheduler
SCHEDULER_LOCK_REQUIREDtrueRequire distributed lock (for multi-worker deployments)
SYNC_MIN_INTERVAL5Minimum minutes between scheduled syncs of a source
SYNC_MAX_INTERVAL1440Maximum minutes between scheduled syncs of a source
VariableDefaultDescription
MAX_RESULTS_PER_PAGE100Cap on limit accepted by the search API

Database tuning

VariableDefaultDescription
DB_MAX_OPEN_CONNS25Maximum open connections
DB_MAX_IDLE_CONNS5Maximum idle connections
DB_CONN_MAX_LIFETIME_SEC300Connection max lifetime in seconds
DB_CONN_MAX_IDLE_SEC60Connection max idle time in seconds

Redis (optional)

VariableDescription
REDIS_URLRedis connection string. Format: redis://host:port or redis://:password@host:port

When set, Redis is used for session storage, task queue, and distributed locks instead of PostgreSQL.

Local filesystem connector

VariableDescription
LOCALFS_ALLOWED_ROOTSComma-separated paths the localfs connector can access. Example: /data

Tests (CI only)

VariableDescription
TEST_DATABASE_URLPostgreSQL DSN used by the integration test suite. Ignored at runtime