Configuration Overview Config
ChatAI Plugin provides a flexible configuration system supporting global, group, and user level overrides.
Configuration Hierarchy
Priority
Lower level config overrides higher level config. For example: group config overrides global config for the same field.
Configuration Methods
Web Admin Panel (Recommended)
Recommended
Web panel provides visual configuration interface, changes take effect immediately without restart.
#ai管理面板Configuration File
Configuration file location:
plugins/chatai-plugin/config/config.yamlNote
After modifying config file directly, run #ai重载配置 or restart to apply.
Configuration Modules
| Module | Description | Documentation | Importance |
|---|---|---|---|
| Basic Config | Command prefix, debug mode, admins | Basic Config | ⭐⭐⭐ |
| Channels | API channels, retry mechanism, load balancing | Channels | ⭐⭐⭐ |
| Models | Model selection and parameter tuning | Models | ⭐⭐⭐ |
| Triggers | Trigger methods and conditions | Triggers | ⭐⭐ |
| Context | Conversation context management | Context | ⭐⭐ |
| Memory | Long-term memory system | Memory | ⭐⭐ |
| MCP | MCP server integration | MCP | ⭐⭐ |
| Proxy | Network proxy settings | Proxy | ⭐ |
| Frontend | Web admin panel customization | Frontend | ⭐ |
| Features | Group summary, portraits, events | Features | ⭐⭐ |
| BYM Mode | Persona mode, proactive chat | BYM | ⭐ |
Configuration File Structure
Full Configuration Example (click to expand)
# Basic Config
commandPrefix: "#"
debug: false
# Trigger Config
trigger:
private: prefix
group: at
prefix: "#chat"
# Channel Config
channels:
- name: default
baseUrl: https://api.openai.com/v1
apiKey: sk-xxx
model: gpt-4o
# Context Config
context:
maxMessages: 20
cleaningStrategy: sliding
# Memory Config
memory:
enabled: true
maxMemories: 1000
# MCP Config
mcp:
enabled: true
# Built-in Tools Config
builtinTools:
enabledCategories:
- basic
- userCore Config Reference:
| Config | Type | Default | Description |
|---|---|---|---|
commandPrefix | string | "#" | Command prefix |
debug | boolean | false | Debug mode |
trigger.group | string | "at" | Group trigger method |
context.maxMessages | number | 20 | Max context messages |
memory.enabled | boolean | true | Enable long-term memory |
Environment Variables
Security Tip
Sensitive information (like API Keys) should use environment variables to avoid plaintext storage in config files.
channels:
- name: openai
apiKey: ${OPENAI_API_KEY} # Reference environment variableSupported Environment Variables:
| Variable | Description | Example |
|---|---|---|
OPENAI_API_KEY | OpenAI API key | sk-xxx... |
ANTHROPIC_API_KEY | Claude API key | sk-ant-xxx... |
GOOGLE_API_KEY | Gemini API key | AIzaSy... |
HTTP_PROXY | HTTP proxy address | http://127.0.0.1:7890 |
Hot Reload
After modifying config, apply without restart:
#ai重载配置Hot Reload Scope
Most configs support hot reload, but the following require restart:
- Web server port
- Database path
Config Backup
Important
Regularly backup config files to avoid data loss.
cp config/config.yaml config/config.yaml.bakcopy config\config.yaml config\config.yaml.bakConfig Migration
Auto Migration
When upgrading from older versions, the plugin will auto-merge new config fields while preserving existing config.
Next Steps
| Document | Description | Recommended |
|---|---|---|
| Basic Config | Command prefix, debug mode and core settings | ⭐⭐⭐ |
| Channels | Configure API channels and load balancing | ⭐⭐⭐ |
| Models | Model parameter tuning | ⭐⭐ |