Skip to content

Advanced Configuration

Advanced configuration is not something you need to modify during initial deployment. Once normal chat is working, adjust these settings based on your actual needs.

Where to Configure

Navigate to WebUI "System Configuration" -> "Basic Configuration." You can use the page search to quickly locate configuration item names.

When to Change Advanced Configuration

ScenarioRecommended Section
Bot replies too frequently; want to control costs or prevent spammingReply Quota
Want to control which messages trigger the botTrigger and Ignore Rules
Want to make regular commands easier to typeCommand Experience
Want to debug why the AI responded a certain wayDebugging and Logging
Upload files are too large and are being rejectedFile Upload
Image recognition is poor or too expensiveVision Capability
Model service requests need a proxyNetwork and Proxy
Sandbox tasks frequently time out or have insufficient concurrencySandbox Configuration
Need to use dangerous management commandsAdvanced Management Commands

Reply Quota

Reply quotas limit the number of bot replies in a channel, suitable for controlling API costs, reducing spamming, or protecting public channels.

Configuration ItemDefault ValueDescription
AI_CHAT_ENABLE_HOURLY_LIMITfalseEnable hourly limits to distribute the daily quota more evenly across each hour
AI_CHAT_QUOTA_SUPER_USERS_EXEMPTtrueAdministrators are exempt from reply quotas
AI_CHAT_QUOTA_WHITELIST_USERS[]Whitelisted user list; users in this list are exempt from reply quotas

When Quota Is Exhausted

When the quota is exhausted, the bot typically stops replying silently rather than posting "quota exhausted" in the group. If the bot suddenly goes quiet, check the quota settings first.

Trigger and Ignore Rules

Trigger rules determine when the bot responds to messages. In public group chats or high-volume channels, it is recommended to control the trigger scope based on actual needs.

Common configuration options include:

TypeDescription
Trigger RegexOnly messages matching the specified pattern are more likely to trigger the bot
Ignore RegexMessages matching the specified pattern will be ignored by the bot
Random ReplyAllow the bot to participate in chat by probability even when not explicitly called
Observation ModeOnly log and observe messages without actively replying

When configuring regex rules, it is recommended to test in a small-scale channel first. Rules that are too broad will cause the bot to reply frequently, while rules that are too narrow may prevent normal messages from triggering.

Channel-Level Configuration Takes Priority

If you only want to adjust a specific group or channel, use the override configuration in Channel Management rather than modifying global rules directly.

Command Experience

Configuration ItemDefault ValueDescription
COMMAND_MATCH_ALLOW_HYPHEN_FOR_UNDERSCOREtrueAllow hyphens to be used instead of underscores in commands. For example, /na-info will match /na_info

It is recommended to keep this enabled by default. This makes it easier to type commands on mobile devices.

Debugging and Logging

These settings are primarily for troubleshooting. It is recommended to keep them disabled during normal operation and only enable them temporarily when needed.

Configuration ItemDefault ValueDescription
SAVE_PROMPTS_LOGfalseSave chat prompt generation logs, useful for debugging what context the AI received
DEBUG_IN_CHATfalseOutput debug information in chat, suitable for temporarily locating issues
APP_LOG_LEVELINFOApplication log level. Change to DEBUG for more detailed logs

Disable After Debugging

Debug logs may contain large amounts of context information. After troubleshooting, it is recommended to disable debug-related settings.

File Upload

Configuration ItemDefault ValueDescription
MAX_UPLOAD_SIZE_MB10Maximum upload file size in MB

If you frequently have the AI analyze large images, documents, or spreadsheets, you can increase this value as needed.

Avoid Setting It Too Large

The larger the upload limit, the higher the processing time and resource consumption may be. Only adjust based on actual needs.

Vision Capability

Vision capability allows the bot to understand image content. It typically depends on model groups that support image input.

Common scenarios to watch for:

ScenarioRecommendation
Image recognition failsCheck whether the current model supports vision input
Images are too large or too numerousAdjust the upload limit or ask users to compress before sending
Costs are too highLimit image trigger scenarios to avoid sending every image to the model
Group chat image floodingUse trigger rules or channel override configuration to limit responses

If you are only doing regular text chat, there is no need to enable or adjust vision-related settings.

Network and Proxy

When model services, plugin interfaces, or certain external resources need to be accessed through a proxy, you can configure proxy-related options in the system configuration.

When using a proxy, it is recommended to confirm:

  • The proxy address is accessible from the Nekro Agent container or runtime environment
  • Proxy authentication information is correctly filled in
  • Whether different services need to use the same proxy
  • Whether internal network addresses should bypass the proxy

If the proxy is misconfigured, common symptoms include model request timeouts, plugins being unable to access external services, or update check failures. Use the Log Center to view specific errors.

Sandbox Configuration

The sandbox is used for executing AI-generated tasks. In most cases, the default settings are sufficient.

Configuration ItemDefault ValueWhen to Change
SANDBOX_RUNNING_TIMEOUT120Increase when regular sandbox tasks frequently time out before completing
SANDBOX_MAX_CONCURRENT4Increase when there are many concurrent tasks and the machine has sufficient resources
SANDBOX_IMAGE_NAMEkromiose/nekro-agent-sandboxChange when using a custom general sandbox image
SANDBOX_CHAT_API_URLAuto-generatedCheck when the sandbox cannot access the Nekro Agent API
SANDBOX_ONEBOT_SERVER_MOUNT_DIR/app/nekro_agent_dataCheck when the OneBot protocol bridge cannot access NA resource files

Claude Code Sandbox

If you use workspaces and Claude Code, you may also need to pay attention to the following settings:

Configuration ItemDefault ValueWhen to Change
CC_SANDBOX_IMAGEkromiose/nekro-cc-sandboxChange when using a custom Claude Code sandbox image
CC_SANDBOX_IMAGE_TAGlatestChange when pinning or switching the CC sandbox image version
CC_SANDBOX_PORT_RANGE_START40000Adjust when the host port range is occupied
CC_SANDBOX_PORT_RANGE_END49999Adjust when the host port range is occupied
CC_SANDBOX_STARTUP_TIMEOUT120Increase when the CC sandbox starts slowly or frequently times out

Check the Workspace Page First

If the Claude Code sandbox fails to start, it is recommended to first check the workspace page and sandbox logs before deciding whether to adjust these settings.

Advanced Management Commands

Configuration ItemDefault ValueDescription
ENABLE_ADVANCED_COMMANDfalseEnable advanced management commands

Advanced management commands may include high-risk operations such as data cleanup or workspace deletion. Only enable them when clearly needed.

Use with Caution

After enabling, ensure that only trusted administrators can use the related commands. After completing operations, if there is no ongoing need, it is recommended to disable this setting.

If you are unsure where to start, it is recommended to follow this order:

  1. Keep the default configuration and complete the deployment
  2. Confirm the bot can chat normally
  3. Set reply quotas based on channel size
  4. Adjust upload limits based on file processing needs
  5. Configure trigger and ignore rules based on channel size
  6. Temporarily enable debugging and logging when issues arise
  7. Adjust Claude Code sandbox settings as needed after using workspaces