Command Overview
The openclaw agents command is used to manage multiple AI agents. Each agent can have a different persona, model, skill set, and behavior configuration, making it ideal for scenarios that require multi-role AI.
View Agent List
openclaw agents list
Output:
Agents:
default gpt-4o-mini Active General assistant
code-helper gpt-4o Active Programming assistant
translator gpt-4o-mini Active Translation specialist
customer-svc claude-sonnet Inactive Customer service bot
Create a New Agent
openclaw agents create assistant-cn
Interactive creation:
Creating new agent: assistant-cn
Display name: Chinese Assistant
Description: AI assistant focused on Chinese conversation
Model [gpt-4o-mini]: qwen-72b
System prompt: You are a professional Chinese AI assistant, skilled in Chinese writing, translation, and knowledge Q&A. Always respond in Chinese.
Agent 'assistant-cn' created successfully.
Non-interactive creation:
openclaw agents create code-expert \
--display-name "Code Expert" \
--model gpt-4o \
--system "You are a senior full-stack engineer, skilled in code review, architecture design, and technical documentation." \
--tools code_exec,web_search \
--temperature 0.3
View Agent Details
openclaw agents show code-expert
Output:
Agent: code-expert
Display Name: Code Expert
Model: gpt-4o
Temperature: 0.3
Max Tokens: 4096
System Prompt: You are a senior full-stack engineer...
Tools: code_exec, web_search
Channels: discord-dev
Status: Active
Created: 2026-03-14
Messages: 1,520
Modify Agent Configuration
# Change model
openclaw agents update code-expert --model gpt-4o-mini
# Change system prompt
openclaw agents update code-expert --system "New system prompt"
# Change temperature
openclaw agents update code-expert --temperature 0.5
# Add a tool
openclaw agents update code-expert --add-tool image_gen
Assign an Agent to a Channel
# Assign agent to a channel
openclaw agents assign code-expert --channel discord-dev
openclaw agents assign assistant-cn --channel wechat-main
# View an agent's channel assignments
openclaw agents channels code-expert
A channel can only be bound to one agent, but one agent can serve multiple channels.
Inter-Agent Routing
Configure message routing rules to automatically dispatch messages to different agents based on content:
{
"routing": {
"enabled": true,
"rules": [
{
"match": "code|programming|bug|function",
"agent": "code-expert"
},
{
"match": "translate|translation",
"agent": "translator"
},
{
"match": ".*",
"agent": "default"
}
]
}
}
Enable/Disable Agents
# Disable an agent (stops processing messages)
openclaw agents disable customer-svc
# Enable an agent
openclaw agents enable customer-svc
Delete an Agent
openclaw agents delete old-agent
Note: Deleting an agent does not delete its conversation history.
Agent Statistics
openclaw agents stats code-expert
Agent Stats: code-expert (last 7 days)
Messages processed: 342
Avg response time: 2.1s
Token usage: 125,000
Estimated cost: $1.25
Active sessions: 5
Error rate: 0.3%
Bulk Management
# Export all agent configurations
openclaw agents export agents-backup.json
# Import agent configurations
openclaw agents import agents-backup.json
# Bulk update model
openclaw agents update-all --model gpt-4o-mini
Defining Agents in Config Files
{
"agents": {
"code-expert": {
"displayName": "Code Expert",
"model": "gpt-4o",
"systemPrompt": "You are a senior engineer...",
"temperature": 0.3,
"tools": ["code_exec", "web_search"],
"maxTokens": 4096
},
"translator": {
"displayName": "Translator",
"model": "gpt-4o-mini",
"systemPrompt": "You are a professional translator...",
"temperature": 0.3,
"maxTokens": 2048
}
}
}
Summary
openclaw agents lets you run multiple AI agents with different capabilities and personas within a single OpenClaw instance. Through thoughtful agent specialization and routing configuration, you can deliver customized AI services to different user groups.