Skip to content

Environment Variables ​

Configuration lives in .env (uv path) or data/config.yaml (Docker / web dashboard). Both map to the same environment variables described here.

The data/config.yaml file is normally written by the web setup wizard, but for headless deploys you can hand-write it: copy config.yaml.example to data/config.yaml and edit. (The uv path uses .env.example instead.)

on/off vs true/false

Most variables use on/off. The GEMINI_* variables use true/false because they are passed directly to the Google SDK.

Mixing them up silently disables the feature — ENABLE_DUCKDUCKGO=true will not report an error but the tool will not be registered.

Each variable in the tables below shows its accepted values.

Required ​

VariableDescription
DISCORD_BOT_TOKENYour Discord bot token
FAST_MODELModel in provider:model_id format (e.g. google:gemini-2.5-flash)
FAST_API_KEYAPI key for the fast model's provider. For local servers (Ollama, LM Studio) that require no authentication, set this to any non-empty string (e.g. local).

uv path only ​

VariableDescription
CHAT_SYS_PROMPT_PATHPath to the system prompt file (e.g. config/chat_sys_prompt.txt). Docker users configure the system prompt through the web dashboard instead.

Dual-model routing ​

VariableDefaultDescription
DEEP_MODEL(off)Second model in provider:model_id format. Leave blank to disable routing.
DEEP_API_KEYsame as FAST_API_KEYAPI key for the deep model (only needed for a different provider)
AUTO_ROUTEoffon/off — send complex messages to DEEP_MODEL automatically
FALLBACK_ON_ERRORoffon/off — fall back to the other model when one returns an error

See Model Providers & Routing for details on how routing works.

Custom endpoints ​

Useful for local inference servers (Ollama, LM Studio, vLLM) or API gateways.

VariableDescription
FAST_BASE_URLCustom endpoint for the fast model
DEEP_BASE_URLCustom endpoint for the deep model

When the bot runs in Docker and the model server runs on the host, use host.docker.internal instead of localhost:

ServerModel stringBase URL
Ollamaollama:llama3.2http://host.docker.internal:11434
LM Studiolmstudio:model-namehttp://host.docker.internal:1234/v1
vLLMvllm:model-namehttp://host.docker.internal:8000/v1
Any OpenAI-compatibleopenai-chat:model-namehttp://host.docker.internal:<port>/v1

Bot behaviour ​

VariableDefaultDescription
ENABLE_CONTEXTUAL_SYSTEM_PROMPTonon/off — inject user display names and current time into the system prompt
CONTEXT_TOKEN_BUDGET0Max input tokens per request; oldest messages are dropped when exceeded. 0 = no limit.
ENABLE_MESSAGE_BATCHINGoffon/off — merge rapid consecutive messages from the same person into one reply (Discord-style grouping)
MESSAGE_BATCH_WINDOW5Seconds to wait for the next message before replying; each new message resets the window
MESSAGE_BATCH_MAX_WAIT15Hard cap (seconds) on how long one burst is held, measured from its first message

Web search & browsing ​

VariableDefaultDescription
ENABLE_DUCKDUCKGOoffon/off — free DuckDuckGo search, works with any provider
ENABLE_BRAVE_SEARCHoffon/off — web search via the Brave Search API (requires BRAVE_API_KEY)
BRAVE_API_KEY—Brave Search API key; free tier at brave.com/search/api
ENABLE_WEBSITE_TOOLSoffon/off — let the bot fetch and read URLs from the conversation

Workspace ​

VariableDefaultDescription
ENABLE_WORKSPACEoffon/off — give the bot read access to a local folder
WORKSPACE_ROOTworkspace/Root folder the bot can access
WORKSPACE_SYS_PROMPT_PATHconfig/workspace_sys_prompt.txtWhere to store the generated workspace context

See Tools for more on workspace behaviour.

Skills ​

VariableDefaultDescription
ENABLE_SKILLSoffon/off — let the bot load skills from SKILLS_ROOT on demand
SKILLS_ROOTskills/Folder holding skill subfolders, each with a SKILL.md

A malformed SKILL.md aborts startup with a clear error rather than being silently skipped. See Tools for the skill folder layout.

Custom tools ​

VariableDefaultDescription
ENABLE_CUSTOM_APISoffon/off — enable HTTP API tools defined in CUSTOM_APIS_JSON
CUSTOM_APIS_JSON[]JSON array of REST API configs (name, base_url, api_key, description). Must be a single line — see Tools
ENABLE_SQL_DATABASESoffon/off — enable SQL tools defined in SQL_DATABASES_JSON
SQL_DATABASES_JSON[]JSON array of database configs (name, db_url, description)
CUSTOM_DIRcustomDirectory scanned for Python extension files (*.py) — see Custom Commands & Tools

For writing your own commands and agent tools in Python (no env var needed — just drop files into custom/), see Custom Commands & Tools.

Large tool results ​

VariableDefaultDescription
TOOL_RESULT_OFFLOAD_CHARS16000Tool results longer than this many characters reach the model as a preview it can read further into; the full text sits in a temporary SQLite database deleted when the bot stops. 0 = always send results in full. See Large Tool Results.
TOOL_RESULT_TTL_SECONDS3600How long a stored result stays readable. 0 = until the bot stops.

Both must be whole numbers of 0 or more; anything else stops the bot at startup with an error naming the variable.

Web dashboard ​

Set these on the web service, not the bot.

VariableDefaultDescription
WEB_ALLOWED_HOSTS(empty)Comma-separated extra hostnames or IPs the dashboard may be opened at, e.g. 192.168.1.50,dango.lan. localhost, 127.0.0.1 and ::1 are always allowed. Requests for any other Host get 400 — this blocks DNS-rebinding attacks. See VPS Deployment before adding one.

Google / Gemini-specific ​

These apply to google: models only. Ignored for all other providers.

Search & grounding ​

VariableDefaultDescription
GEMINI_SEARCHtruetrue/false — enable Google Search grounding
GEMINI_GROUNDING_THRESHOLDmodel defaultApply grounding only when confidence is below this value (0.0–1.0)
GEMINI_URL_CONTEXTfalsetrue/false — let the model fetch URLs mentioned in the conversation (Gemini only; not gemma-*)

Thinking (Gemini 2.5+ / Gemma 4) ​

VariableDefaultDescription
GEMINI_THINKING_BUDGETmodel defaultToken budget for reasoning; 0 disables thinking
GEMINI_THINKING_LEVELmodel defaultlow or high

Per-model overrides ​

Any GEMINI_* variable can be overridden for just one model using the FAST_ or DEEP_ prefix. CONTEXT_TOKEN_BUDGET (defined under Bot behaviour above) also supports per-model overrides:

Shared defaultFast overrideDeep override
GEMINI_SEARCHFAST_SEARCHDEEP_SEARCH
GEMINI_GROUNDING_THRESHOLDFAST_GROUNDING_THRESHOLDDEEP_GROUNDING_THRESHOLD
GEMINI_URL_CONTEXTFAST_URL_CONTEXTDEEP_URL_CONTEXT
GEMINI_THINKING_BUDGETFAST_THINKING_BUDGETDEEP_THINKING_BUDGET
GEMINI_THINKING_LEVELFAST_THINKING_LEVELDEEP_THINKING_LEVEL
CONTEXT_TOKEN_BUDGETFAST_CONTEXT_TOKEN_BUDGETDEEP_CONTEXT_TOKEN_BUDGET

MIT License · Built on Agno