Repository navigation
en use custom rules
Custom rules let you make exceptions for one specific session without duplicating an entire configuration profile for every group or private chat. For example:
- Give a work group a professional persona and a specific chat model while other sessions keep their defaults.
- Let one group use plugin commands without automatic AI replies.
- Disable voice replies or selected plugins in a private chat.
- Choose specific knowledge bases for one session.
These rules take priority over the corresponding settings in the session's profile. Settings without an override keep their normal behavior. Rules do not create models, personas, plugins, or knowledge bases; set up those resources on their own pages first.
A UMO (Unified Message Origin) identifies a particular session on a platform instance. Custom rules belong to the UMO, not a user's display name or the title of the current conversation.
Send /sid in the group or private chat you want to configure, then compare its UMO with the session shown in the WebUI. Similar names across platforms and chats can be confusing; checking the UMO helps you select the right source. See Built-in Commands for command and wake-prefix details.
Note
Per-member conversation isolation in groups affects how sessions are identified. Use the UMO returned for the actual target message. Creating a new conversation within a session does not remove that UMO's custom rules.
- Have a conversation with the bot in the target group or private chat so AstrBot records the source.
- Open Custom Rules in the WebUI sidebar.
- Click Add Rule, select the target under Select Session, and click Next. If the session already has rules, use its edit button in the list instead.
- Change the settings in Edit Custom Rules, for example the chat model under Provider Configuration.
- Click Save beneath the section you changed. Service, provider, persona, plugin, and knowledge base sections save separately. Save each changed section.
- Send a new message in the target session to check the result.

Saved rules take effect without restarting AstrBot. The older Session Management and More Features → Custom Rules entry points now correspond to Custom Rules directly in the sidebar.
| Section | Setting | Purpose |
|---|---|---|
| Service Configuration | Enable Session | Turning this off stops processing messages from this source, including normal AI replies and plugin responses. Re-enable it from the WebUI. |
| Service Configuration | Enable LLM | Turning this off stops normal AI conversation processing for the session. Plugin commands can still work; each plugin controls its own behavior. |
| Service Configuration | Enable TTS | Controls whether the session can use synthesized speech output. A TTS model and the relevant profile settings must already be configured. |
| Service Configuration | Custom Name | Adds a note to help identify the session without changing its UMO. |
| Provider Configuration | Chat Provider, STT Provider, TTS Provider | Selects configured models for this session, or Follow Config. |
| Persona Configuration | Select Persona | Forces a persona for this session. Leaving it empty removes the forced-persona rule. |
| Plugin Configuration | Disabled Plugins | Disables selected plugins in this session without affecting other sessions. |
| Knowledge Base Configuration | Select Knowledge Bases, Top K Results | Overrides the profile's knowledge base selection and number of retrieval results. |
Service switches control whether the session may use features already configured. Checking LLM or TTS does not enable a feature disabled in the profile or configure a model automatically.
See WebUI, Plugins, and Knowledge Base for the underlying persona, plugin, and knowledge base setup.
A profile configures a complete set of bot behavior, such as models, wake conditions, message processing, and tools. A custom rule changes selected settings for an individual session.
For example, two groups may use the default profile while only group A needs a different chat model. Add a model rule for group A without affecting group B. If you later change the chat model in default, group A still uses its override until you remove the rule or select Follow Config.
A rule cannot load a plugin that has been disabled globally. Enable it on the Plugins page first, then use custom rules to disable it in selected sessions.
Search for the session or its note in the list, then use the edit button. Each section has its own save button.
- Models: Select Follow Config and save to remove that model override.
- Persona: Clear the selection and save to remove the forced-persona rule and restore normal persona selection.
- Plugins: Remove a plugin from the disabled list and save. Clearing the list removes the session's plugin-disable rule.
- Knowledge bases: Clear the selection and save to remove the session-level rule and restore the profile's knowledge base settings. This does not disable knowledge bases.
- Entire session: Use the delete button in the list and confirm to remove all custom rules for that UMO.
Deleting rules does not delete models, plugins, knowledge bases, or chat history.
Use Batch Operations below the rules list to change multiple sessions:
- Select sessions in the list, or choose all sessions, all groups, all private chats, or a custom group under Apply to.
- Select the LLM or TTS status or chat model to change.
- Click Apply Changes, then check the target sessions.
Only the selected settings are changed. Start with a few selected sessions before applying changes to a wider scope.
Group Management lets you organize related sessions into a named group and use that group as a batch-operation scope. A group does not automatically make its members inherit shared rules; apply the batch changes after adding members.
Have a conversation with the bot in that session, then refresh the page or reopen Add Rule. Sessions with existing rules are excluded from the add list; edit them in the main list instead.
Check for rules on that UMO. Session overrides still take priority. Select Follow Config, clear the forced persona, or remove the rule, then test again.
Disabling session processing prevents its messages from reaching later processing stages. Re-enable the session in the WebUI instead of relying on commands sent in the disabled chat.
Check the target UMO, the save result for the section you edited, and the availability of the selected resource. Test with a new message; rules do not rewrite replies that have already been generated.
- 首页
- 文档入口
- Top Level
- community events
- deploy
- dev
- others
- platform
- 接入 OneBot v11 协议实现
- 接入钉钉 DingTalk
- 接入 Discord
- 接入 Kook
- 接入飞书
- 接入 LINE
- 接入 Matrix
- 接入 Mattermost
- 接入 Misskey 平台
- 接入 QQ 官方机器人平台
- 通过 QQ官方机器人 接入 QQ (Webhook)
- 通过 QQ官方机器人 接入 QQ (Websockets)
- 接入 Satori 协议
- 接入 server-satori (基于 Koishi)
- 接入 Slack
- 接入消息平台
- 接入 Telegram
- 接入 VoceChat
- AstrBot 接入企业微信
- 接入企业微信智能机器人平台
- AstrBot 接入微信公众平台
- 接入个人微信
- providers
- use
- Home
- Docs Entry
- Top Level
- config
- deploy
- Deploy AstrBot on 1Panel
- Deploy AstrBot on BT Panel
- Deploy AstrBot on CasaOS
- Deploy AstrBot from Source Code
- Community-Provided Deployment Methods
- Deploy via Compshare
- Deploy with AstrBot Desktop Client
- Deploy AstrBot with Docker
- Deploy AstrBot with Kubernetes
- Deploy AstrBot with AstrBot Launcher
- Other Deployments
- Package Manager Deployment (uv)
- Installation via System Package Manager
- Preface
- dev
- AstrBot Configuration File
- API Scope–Endpoint Reference
- AstrBot HTTP API
- AstrBot Plugin Market JSON Specification
- Developing a Platform Adapter
- plugin
- AI
- Text to Image
- Handling Message Events
- Plugin Configuration
- Plugin Internationalization
- Plugin Views
- Sending Messages
- Session Control
- Minimal Example
- Plugin Storage
- AstrBot Plugin Development Guide 🌠
- Publishing Plugins to the Plugin Marketplace
- ospp
- others
- platform
- Connect OneBot v11 Protocol Implementations
- Connect to DingTalk
- Connecting to Discord
- Connect to KOOK
- Connecting to Lark
- Connecting to LINE
- Connecting to Matrix
- Connecting to Mattermost
- Connecting to Misskey Platform
- Connect QQ Official Bot
- Connect QQ via QQ Official Bot (Webhook)
- Connect QQ via QQ Official Bot (Websockets)
- Connect to Satori Protocol
- Connect server-satori (Koishi)
- Connecting to Slack
- Messaging Platforms
- Connecting to Telegram
- Connect to VoceChat
- Connect AstrBot to WeCom
- Connect to WeCom AI Bot Platform
- Connect AstrBot to WeChat Official Account Platform
- Connect Personal WeChat
- providers
- Connect 302.AI
- Agent Runners
- Built-in Agent Runner
- Connect to Coze
- Connect to Alibaba Cloud Bailian Application
- Connect to DeerFlow
- Connect to Dify
- Connect AIHubMix
- coze
- dashscope
- dify
- Model input images
- Large Language Model Providers
- Connect MiraRouter
- NewAPI
- Connect PPIO Cloud
- Connect LM Studio to Use DeepSeek-R1 and Other Models
- Integrating Ollama
- Connect ShengSuanYun
- Connecting to SiliconFlow
- Connecting Model Services
- Connecting to TokenPony
- use
- Agent Execution Mode {#agent-runner}
- Agent Sandbox Environment
- astrbot sandbox
- AstrBot CLI {#cli-commands}
- Docker-based Code Interpreter
- Built-in Commands
- computer
- Context Compression
- Custom Rules
- AstrBot Knowledge Base
- MCP
- AstrBot Plugins {#astrbot-star}
- Proactive Capabilities
- Skills {#anthropic-skills}
- SubAgent Orchestration {#agent-handoff-and-subagent}
- Unified Webhook Mode
- Web Search
- WebUI