Repository navigation
en use subagent
A SubAgent is an AI assistant with a specific responsibility. The main Agent talks to the user, delegates suitable tasks to a SubAgent, and continues its response using the returned result.
For example, one SubAgent can research sources while another organizes files. Each uses its own Persona prompt and tool selection, and can optionally use a different chat model. This separates responsibilities and reduces the tools the main Agent must choose directly, but also adds model calls and waiting time. Simple conversations with only a few tools usually do not need orchestration.
Introduced in v4.14.0, this feature is still marked experimental. This page covers AstrBot's built-in AI. Orchestration provided by an external AI application is configured in that application.
- When enabled, the main Agent receives tools named
transfer_to_<name>, such astransfer_to_research_assistant, alongside its own tools. - The main Agent reads each SubAgent's public description to decide whether to delegate. It passes a clear task and can include images when needed.
- The SubAgent uses its Persona's prompt, preset dialogue, and tools to complete the task.
- It returns the result to the main Agent, which organizes the response and continues the conversation.
The model decides when to delegate. Delegation is neither automatic for every message nor a fixed workflow. A SubAgent receives the delegated task and its own preset dialogue; it does not automatically receive the main Agent's entire conversation history. Include necessary background, file paths, and constraints in the task.
The delegation tool also supports background execution. The main Agent can acknowledge submission first and be woken again when the SubAgent finishes. Proactive delivery still depends on the chat platform; see Proactive Capabilities.
Confirm that AstrBot's built-in AI can hold a conversation and that its chat model supports tool calling. Under Extensions → Persona in the WebUI, create a dedicated Persona, such as “Research Assistant”:
- Explain how it should collect information, verify sources, and present results.
- Select only the tools needed for research, such as configured web search or MCP tools.
- If it only analyzes text, it can have no tools.
The Persona describes how the assistant works. The public description explains when the main Agent should ask for its help.
Open Extensions → SubAgents, click Add SubAgent, then click Expand on the new card.

| Setting | What to enter |
|---|---|
| Agent name | For example, research_assistant. Start with a lowercase English letter; use only lowercase letters, numbers, and underscores. Maximum 64 characters. Names must be unique. |
| Chat Provider (optional) | Select the SubAgent's chat model. Leave empty to use the chat provider resolved for the current conversation. This is not a separate API key field. |
| Choose Persona | Select the Persona you created. Its preview appears on the right. Required. |
| Description for the main LLM | Describe suitable tasks, required inputs, and expected results. Avoid vague descriptions such as “a powerful assistant.” |
| Enable switch | Controls whether this SubAgent participates in orchestration. New SubAgents are enabled by default. |
Example public description:
Researches and verifies information. Delegate questions that need a comparison, recent information, or a summary of sources. Include the question and constraints. I return concise findings with source links.
Manage tools on the Persona page; the SubAgent page has no separate tool selector. A Persona with all tools selected can use currently available tools. A specific selection uses only matching tools that still exist and are enabled. Computer-use tools also require the appropriate runtime and permissions.
Turn on Enable SubAgent orchestration, then click Save in the upper right. Adding, editing, disabling, or deleting a SubAgent, and changing either global switch, all require saving. Saving reloads orchestration without restarting AstrBot.
This page manages global orchestration settings, rather than a separate SubAgent list for the currently selected configuration profile.
By default, the main Agent can use its own tools directly or delegate. With Deduplicate main LLM tools (hide tools duplicated by SubAgents) enabled, overlapping tools assigned to enabled SubAgents are removed from the main Agent's tool list.
For example, if both have a search tool, the main Agent can search directly or delegate when deduplication is off. With deduplication on, it uses the research SubAgent for that search task.
Start with deduplication off and enable it after confirming the SubAgent works. Giving every SubAgent all tools makes clear responsibilities difficult to maintain.
- Check the required tools first: configure web search, connect the MCP service, and so on.
- Send an explicit request, such as “Ask the research assistant to compare these two options and provide source links.”
- Look for
transfer_to_research_assistantand subsequent calls in the conversation's tool activity or Data & Logs → Logs. - Check that the answer follows the Persona's instructions before adding more SubAgents.
The model may still answer directly. Creating a SubAgent alone does not guarantee delegation.
| Symptom | What to check |
|---|---|
| Cannot save | Check names, duplicates, and Persona selection, including disabled SubAgents. |
| Main Agent never delegates | Check both enable switches and saved settings. Use a tool-capable model and a specific public description. |
| SubAgent cannot use a tool | Check Persona tool selection, plugin/MCP status, runtime, and permissions. Selecting a disabled tool does not reactivate it. |
| Result lacks context | Specify the background and constraints to pass. Full conversation history is not automatically shared. |
| SubAgent model fails | Check that the selected Chat Provider exists and works, or clear it to use the conversation's model. |
| Persona changes are not reflected | Save the SubAgent page again to reload the Persona content. |
A SubAgent is not a separate container or account permission boundary. It calls tools in the current conversation's AstrBot environment. Configure file and execution isolation through Agent Sandbox.
SubAgent execution history is not persisted as an independent conversation. There is no separate Skills isolation configuration. This page does not configure multi-level delegation and should not be treated as an arbitrarily nested tree of Agents.
- 首页
- 文档入口
- 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