Skip to main content

Environment variables

Environment variables fine-tune an agent's runtime behavior without changing its main configuration. You set them per agent in the Advanced card — see Set environment variables. Changes take effect only after the agent restarts.

Keys are case-sensitive. Booleans accept true or false. A variable you have not set uses the default listed below.

note

This page lists the variables most agents need. The platform accepts any key/value pair, and support teams sometimes provide additional variables for specific setups — variables not listed here keep working.

Agent behavior

VariableWhat it doesDefault
START_PHRASEThe agent's welcome message — the first message a customer sees. In Simple mode, the same value is edited as the Welcome message field.Not set
START_METAMetadata attached to the welcome message, such as quick-reply buttons. JSON, for example {"option_lines":["Hey","You"]}.Not set
REPHRASING_IT_TEXTThe text shown when the agent fails to produce a valid reply.Oops! Error on my side. Can you ask again in a different way?
PROMPT_FIELD_<AGENT>_<FIELD>Overrides one prompt field for one agent class. The name is case-sensitive; a mismatch is silently ignored.Not set
MODEL_KWARGSExtra parameters sent with each generation request to the LLM provider. JSON string.Not set
LLM_KWARGSExtra parameters for constructing the LLM handler. JSON string.Not set

Session

VariableWhat it doesDefault
SESSION_TIMEOUT_SECCloses the session this long after the last handled message or agent turn, in seconds. Each handled activity restarts the countdown.259200 (3 days)
OPERATOR_SESSION_TIMEOUT_SECThe same timeout for operator and Copilot sessions, in seconds. A negative value disables the timeout.864000 (10 days)
PROCESS_TIMEOUT_SESS2VThe maximum time one agent turn may take before it is aborted, in seconds.120
CUSTOM_STOP_MESSAGEA message sent to the customer when the session stops.Empty
MAX_AGENT_ERRORSThe number of agent errors during one run after which the agent is marked failed.10

Memory and summarization

The agent keeps two working memories: the scratchpad (its own reasoning steps) and the chat history. When a conversation grows past the limits below, older records are summarized so the agent keeps context without an ever-growing prompt.

VariableWhat it doesDefault
MEMORY_SIZEScratchpad length in messages. Oldest records drop past the limit.15
CONVERSATION_MEM_LIMITChat-history length in messages. Oldest records drop past the limit.16
ENABLE_SUMMARIZATIONSummarize old scratchpad records instead of dropping them.true
ENABLE_CONVERSATION_SUMMARIZATIONRun the conversation summarization step in the main flow.true
SUMMARY_LIMITThe scratchpad length that triggers summarization of the oldest records.15
SUMMARY_MEMORY_LIMITThe scratchpad length at which a prepared summary replaces the summarized records.25
VariableWhat it doesDefault
SHOW_RAG_SOURCESInclude the sources a knowledge-based answer came from. The portal sets this from the Show RAG sources switch in the Advanced card — change the switch instead of setting the variable.Follows the switch
SHOW_RAG_CHUNK_NUMBERSInclude chunk numbers in knowledge-based answers.false
SEARCH_TOOL_TOP_KThe number of top results the knowledge search returns.15
KB_SEARCH_CONTEXT_WINDOWThe context window, in chunks, used around each search hit.4
KB_SEARCH_MAX_SOURCES_LENThe maximum total length of source excerpts, in characters.25000

Language and speech

VariableWhat it doesDefault
REPLY_IN_USER_LANGUAGETranslate agent replies into the customer's detected language. Requires a translator integration.false
TRANSLATE_TO_ENTranslate customer messages to English before they reach the model. Requires a translator integration.false
LANG_DETECTION_MIN_LENGTHThe minimum message length, in characters, that triggers language detection.20
ENABLE_NERMask named entities during translation.false
WHISPER_LANGUAGEThe language (or comma-separated languages) for speech recognition, for example en or en,kk,ru.Depends on the speech model
WHISPER_PROMPTA custom prompt for the speech-recognition model.Not set
VAD_THRESHOLDThe voice-activity-detection threshold for speech recognition.0.6 (chat), 0.65 (SIP voice)
TTS_AZURE_SSML_MODESend SSML markup to Azure text-to-speech.false

Channels

VariableWhat it doesDefault
SHOW_VOICE_TRANSCRIPTIONShow the transcription text for customer voice messages. Telegram and WhatsApp only.true
LOG_WEBHOOK_MESSAGESLog every request that reaches the WhatsApp webhook.false
INTERCOM_TEAM_ID_FILTERA comma-separated list of Intercom team IDs the agent accepts messages from, for example 7727961,7727960. Unset accepts all teams.Not set
EMAIL_RETRY_LIMITThe number of email client request attempts before giving up. Email channel only.10

MCP servers

Connect the agent to Model Context Protocol servers. Each variable that ends in MCP_ENDPOINT defines one server; to configure several, give each its own prefix — for example WEATHER_MCP_ENDPOINT and CRM_MCP_ENDPOINT. Every other variable below uses the same prefix as its server, or no prefix for the default server.

VariableWhat it doesDefault
[PREFIX_]MCP_ENDPOINTRequired. The server URL (HTTP) or execution command (stdio). Defines the server.Not set
[PREFIX_]MCP_TRANSPORTThe protocol: streamable_http, http_sse, or stdio.streamable_http
[PREFIX_]MCP_AUTH_TYPEThe auth method: none, bearer, token, api_key, basic, or custom (auth through MCP_CUSTOM_HEADERS).none
[PREFIX_]MCP_AUTH_TOKENThe token, for bearer authentication.Not set
[PREFIX_]MCP_TOKENThe token, for token authentication.Not set
[PREFIX_]MCP_API_KEYThe API key value, for API-key authentication.Not set
[PREFIX_]MCP_API_KEY_HEADERThe HTTP header that carries the API key.X-API-Key
[PREFIX_]MCP_API_KEY_QUERY_PARAMA query parameter that carries the API key instead of a header.Not set
[PREFIX_]MCP_USERNAME / [PREFIX_]MCP_PASSWORDThe credentials, for basic authentication.Not set
[PREFIX_]MCP_CUSTOM_HEADERSCustom HTTP headers as a JSON string.Not set
[PREFIX_]MCP_CAPABILITIESThe server capabilities to use, comma-separated.tools
[PREFIX_]MCP_TIMEOUTThe request timeout, in seconds.30
[PREFIX_]MCP_CONNECT_TIMEOUTThe connection timeout, in seconds.5
[PREFIX_]MCP_INACTIVITY_TIMEOUTHow long an idle server connection is kept, in seconds.600
[PREFIX_]MCP_MAX_RETRIESThe number of retry attempts.3
[PREFIX_]MCP_MIN_ACTORSThe minimum number of pooled connections to the server.0
[PREFIX_]MCP_MAX_ACTORSThe maximum number of pooled connections to the server. Must be at least 1 and at least MCP_MIN_ACTORS.5
[PREFIX_]MCP_INCLUDE_TOOLSA comma-separated substring filter — only matching tools are exposed.Not set
[PREFIX_]MCP_EXCLUDE_TOOLSA comma-separated substring filter — matching tools are hidden.Not set
[PREFIX_]MCP_NAME_TRANSFORMERTool-name transformation rules, for example camel, snake, or s/old/new/g.Not set

Logging

VariableWhat it doesDefault
LOG_LEVELThe verbosity of the agent's system logs: DEBUG (most verbose), INFO, WARNING, or ERROR (least verbose). Raise it to INFO or DEBUG while troubleshooting, then set it back — verbose logs grow fast.ERROR

Spam detection

Spam detection scores every customer message and blocks messages that look like random characters or unreadable text. Turn it on and tune it entirely through environment variables.

VariableWhat it doesDefault
SPAM_DETECTION_ENABLEDMaster switch. All other SPAM_DETECTION_* variables apply only when this is true.false
SPAM_DETECTION_MESSAGEThe reply sent to the customer when a message is blocked.Your message was detected as spam and was not delivered.
SPAM_DETECTION_CONFIDENCE_THRESHOLDThe hard threshold (0–1): a single message at or above it is blocked immediately. Lower is stricter.0.5
SPAM_DETECTION_WEIGHTED_THRESHOLDThe soft threshold (0–1) for the weighted average over recent messages.0.35
SPAM_DETECTION_HISTORY_SIZEThe number of recent messages in the weighted check.5
SPAM_DETECTION_MIN_MESSAGES_FOR_DECISIONThe minimum message count before the soft threshold applies.3
SPAM_DETECTION_TIME_DECAY_FACTORThe decay applied to older messages in the weighted check, in (0, 1]. Lower forgets old messages faster.0.9

Advanced setups can replace the scoring pipeline (SPAM_DETECTION_COMPONENTS_CONFIG) and the exclusion rules (SPAM_DETECTION_EXCLUSION_RULES) with custom JSON.

Common issues

  • A variable has no effect. The agent was not restarted. In Simple mode, click Save; in Advanced mode, stop and start the agent.
  • A secret value cannot be revealed. Expected: values saved with Secret stay masked. To change one, enter a new value.
  • A prompt override is ignored. PROMPT_FIELD_* names are case-sensitive — the agent and field names must match exactly.

Was this article helpful?