Compiled by scanning every os.environ.get / os.getenv call in sagents/, app/, common/, and mcp_servers/. Treat the source as the source of truth for default values; “—” means there is no static default (required, or derived dynamically).
0. Deployment Example Policy
deploy/dev|test|prod/.env.example uses a minimal-required policy: it keeps only Compose/application values that are normally changed per environment, secrets, accounts, and external URLs. Kubernetes-only settings live in deploy/k8s/env/*.env.example instead of the shared environment templates. Stable defaults live in code, Compose, or the K8s deploy script.
Variables intentionally kept in the examples:
Type
Variables
Environment and entrypoint
SAGE_ENV, SAGE_ROOT
Secrets and accounts
SAGE_JWT_KEY, SAGE_REFRESH_TOKEN_SECRET, SAGE_SESSION_SECRET, MySQL/S3/Grafana passwords, LLM/Embedding/video-analysis API keys, email AK/SK
Advanced overrides are not listed in .env.example unless a deployment needs to change them. Common examples include Compose project/port overrides, SAGE_WEB_BASE_PATH, SAGE_TRACE_JAEGER_URL, SAGE_LOKI_PUSH_URL, SAGE_MCP_*, OPENSANDBOX_IMAGE, OPENSANDBOX_TIMEOUT, SAGE_OPENSANDBOX_APPEND_MAX_BYTES, default LLM/Embedding model parameters, video-analysis model parameters, and fixed email defaults.
Select how SimpleAgent decides that a turn is complete. no_tool_call disables turn_status and treats an LLM response without tool calls as complete; turn_status exposes the turn_status protocol tool and lets the model report task_done / need_user_input / blocked / continue_work; llm_judge disables turn_status and uses the legacy rule-first + LLM task_complete_judge check.
SAGE_RUNTIME_CONTEXT_IN_USER
true
Move volatile runtime context (system_context, workspace files, active ToDo) out of system messages and freeze it into the latest user message inference metadata. Set false only for legacy behaviour where volatile context stays in system.
SAGE_REPEAT_PATTERN_MAX_HITS
3
Consecutive repeat-pattern detections before SimpleAgent hard-pauses the execution loop
When the available tool count is at or below this value, skip the LLM tool-suggestion call and pass all available tools through
SAGE_EMIT_TOOL_CALL_ON_COMPLETE
true
Re-emit tool_call chunks once the LLM stream completes
SAGE_ECHO_SHELL_OUTPUT
false
Echo background-shell stdout/stderr into the main stream
SAGE_TOOL_PROGRESS_ENABLED
true
Enable the tool live-progress channel (NDJSON type=tool_progress events for the UI only; never sent to MessageManager or the LLM)
SAGE_TOOL_PROGRESS_FLUSH_INTERVAL_MS
50
Coalesce window (ms). Multiple emit_tool_progress calls within the window for the same (tool_call, stream) are merged into one event. Set to 0 to disable coalescing and emit immediately
SAGE_TOOL_PROGRESS_FLUSH_BYTES
16384
Per-stream byte threshold; once accumulated text reaches it, flush immediately (prevents fast-producing commands from saturating the channel)
6. Memory
Variable
Default
Purpose
SAGE_DB_TYPE
—
Database backend
SAGE_SESSION_MEMORY_BACKEND
—
Session memory backend implementation
SAGE_SESSION_MEMORY_STRATEGY
—
Session memory compress / recall strategy
SAGE_FILE_MEMORY_BACKEND
—
File memory backend implementation
MEMORY_ROOT_PATH
—
Root directory for file memory
ENABLE_REDIS_LOCK
false
Enable Redis distributed lock
MEMORY_LOCK_EXPIRE_SECONDS
—
Redis lock TTL
REDIS_URL
—
Redis connection string
7. MCP / AnyTool
Variable
Default
Purpose
SAGE_DEFAULT_ANYTOOL_TIMEOUT
—
AnyTool call timeout
SAGE_LS_PATH
—
Default root for the MCP list_dir tool
SAGE_LS_HIDDEN
false
Whether list_dir shows hidden files
SAGE_MCP_PER_CONNECTION_CONCURRENCY
100
Max concurrent MCP calls per pooled connection
SAGE_MCP_MAX_CONNECTIONS_PER_SERVER
0
Max pooled MCP connections per server; 0 means no fixed cap
SAGE_MCP_SESSION_IDLE_TTL_SECONDS
1800
Idle TTL for MCP pooled sessions
SAGE_MCP_REFRESH_DRAIN_TIMEOUT_SECONDS
30
Grace period while draining refreshed MCP connections
SAGE_MCP_CALL_TIMEOUT_SECONDS
300
MCP tool call timeout
SAGE_MCP_LIST_TOOLS_RETRY_ON_CONNECTION_ERROR
true
Retry MCP list_tools once on connection-like errors
SAGE_MCP_CALL_RETRY_ON_CONNECTION_ERROR
true
Retry MCP tool calls once on connection-like errors
Removed and ignored. Use SAGE_TASK_COMPLETION_MODE=turn_status / no_tool_call / llm_judge.
SAGE_CONTINUE_ON_PROCESSING_KEYWORDS
Removed and ignored. The SimpleAgent “processing keyword” must-continue rule has been removed.
SAGE_FORCE_TOOL_CHOICE_REQUIRED
Deprecated and ignored. tool_choice=required for turn_status-only rounds is controlled internally by the agent loop; code support will be removed in a future release.
SAGE_COMPLETE_ON_NO_TOOL_CALL
Removed and ignored. Use SAGE_TASK_COMPLETION_MODE=no_tool_call.
SAGE_SPLIT_SYSTEM
Deprecated and ignored. Split system messages are always enabled.
SAGE_STABLE_TOOLS_ORDER
Deprecated and ignored. Tools are always sorted by function.name before LLM requests.
SAGE_AUTO_LINT
Deprecated and ignored. File-tool linting is always enabled.
SAGE_SESSION_DIR_PATH
Legacy alias for SAGE_SESSION_DIR in CLI stream code.
LLM_API_KEY / LLM_API_BASE_URL / LLM_MODEL_NAME
Legacy names; use SAGE_DEFAULT_LLM_API_KEY / SAGE_DEFAULT_LLM_API_BASE_URL / SAGE_DEFAULT_LLM_MODEL_NAME.
10. Standard system variables (consumed but not set by Sage)
HOME, USERPROFILE, PATH, NODE_PATH, SSL_CERT_FILE are read for cross-platform path / certificate discovery.
Before changing any behaviour above, grep the codebase for os.environ.get('VARIABLE_NAME') to confirm the actual default and branching logic — this table is a summary, not a contract.