Welcome to ROSMASTER M3 PRO repository
10. OpenClaw multi-agent intelligent agent
OpenClaw Multi-Agent Intelligent Agents
OpenClaw Multi-Agent Intelligent Agents1. Course ContentCourse OverviewLearning Objectives2. Creating Agents2.1 Creating Agents Using the CLI Wizard2.2 Agent Directory Structure2.4 Configuring Bindings2.5 Restarting the Gateway to Apply Configuration3. Editing Agent Prompts3.2 Editing Steps3.3 Configuration Example: Creating a Customer Support Bot Agent4. Deleting Agents4.1 Deleting via CLI Commands4.2 Manually Cleaning Up Agent Directories4.3 Cleaning Up Binding Configurations
1. Course Content
Course Overview
- OpenClaw's multi-agent intelligent agent feature allows multiple isolated agents to run within the same gateway. Each agent has its own independent workspace, state directory, and session history.
- The multi-agent architecture is suitable for scenarios with multiple roles, such as one agent responsible for programming development and another for social media operations, with data isolation and no interference between them.
Learning Objectives
- Understand the concept and applicable scenarios of OpenClaw multi-agent intelligent agents.
- Master the creation of new agents using CLI commands.
- Master the methods for editing agent prompt files (AGENTS.md / SOUL.md / IDENTITY.md, etc.).
- Master the operation of deleting an agent.
2. Creating Agents
OpenClaw runs one agent by default (agentId is main). Additional isolated agents can be created using the following methods.
2.1 Creating Agents Using the CLI Wizard
OpenClaw provides the openclaw agents add command, which utilizes an interactive wizard to quickly create new agents:
openclaw agents add <agentId>For example, to create a "work" agent named work:
xxxxxxxxxxopenclaw agents add work

Upon execution, OpenClaw automatically performs the following actions:
- Creates the agent directory:
~/.openclaw/agents/<agentId>/ - Creates the workspace bootstrap files: including
AGENTS.md,SOUL.md,IDENTITY.md,TOOLS.md,USER.md, etc.
2.2 Agent Directory Structure
Once an agent is created, a complete file structure is generated within the ~/.openclaw/agents/<agentId>/ directory:
xxxxxxxxxx~/.openclaw/agents/<agentId>/├── agent/│ ├── auth-profiles.json # Authentication profiles│ ├── config.json # Agent configuration│ └── ...└── sessions/ # Session history storage└── <SessionId>.jsonl
The agent's workspace files are located within their respective workspace directories, where you can edit the bootstrap files to define the agent's behavior and personality. ### 2.3 Verifying Agent Creation
Once creation is complete, you can view all agents and their binding statuses using the following command:
xxxxxxxxxxopenclaw agents list --bindings
2.4 Configuring Bindings
A Binding is a rule that routes messages from a channel account to a specific agent. Each binding consists of:
- agentId: The ID of the target agent.
- match: The matching rule (based on channel, peer account, etc.).
Example Configuration (openclaw.json):
xxxxxxxxxx{ "agents": { "list": [ { "id": "main", "workspace": "~/.openclaw/workspace" }, { "id": "work", "workspace": "~/.openclaw/workspace-work" } ] }, "bindings": [ { "agentId": "main", "match": { "channel": "whatsapp", "peer": { "kind": "direct", "id": "+15551230001" } } }, { "agentId": "work", "match": { "channel": "whatsapp", "peer": { "kind": "direct", "id": "+15551230002" } } } ]}2.5 Restarting the Gateway to Apply Configuration
After creating agents or modifying binding configurations, you must restart the Gateway:
xxxxxxxxxxopenclaw gateway restartAfter restarting, verify the status of the agents and channels:
xxxxxxxxxxopenclaw agents list --bindingsopenclaw channels status --probe3. Editing Agent Prompts
Each agent's personality, behavioral rules, and capabilities are defined through Bootstrap Files located within its workspace. By editing these files, you can customize the agent's prompts. ### 3.1 Introduction to Bootstrap Files
In the first turn of a new session, OpenClaw injects the following workspace files into the agent's context:
| File | Purpose |
|---|---|
AGENTS.md | Operational instructions and memory; defines the behavioral rules the agent must follow. |
SOUL.md | Persona, boundaries, and tone; defines the agent's personality traits. |
IDENTITY.md | Agent name, vibe, and emoji identifier. |
TOOLS.md | User-maintained instructions and conventions for tool usage. |
USER.md | User profile and preferred forms of address. |
BOOTSTRAP.md | One-time initial setup ritual (can be deleted once completed). |
3.2 Editing Steps
Step 1: Navigate to the Agent's Workspace Directory
xxxxxxxxxx# Custom Agent Workspace (if a specific workspace was specified during creation)cd ~/.openclaw/workspace-<agentId>Step 2: Edit SOUL.md to Define the Agent's Personality
x# Role SettingYou are a professional programming assistant, specializing in Python and ROS2 development.# Tone and StyleMaintain a professional and concise tone; respond in Chinese.# Behavioral Boundaries- Do not perform dangerous operations.- Do not delete important user files.Step 3: Edit AGENTS.md to Set Operational Instructions
xxxxxxxxxx# Operational Rules- When answering questions, prioritize using the MCP Tool to retrieve the latest information.- If you encounter uncertain information, proactively ask the user for confirmation.- Before executing an action, first outline the steps you are about to perform.Step 4: Edit IDENTITY.md to Define the Agent's Identity
xxxxxxxxxx# NameCode Assistant# Emoji🤖# BioI am your dedicated programming assistant, ready to help you complete ROS2 development and Python programming tasks!Step 5: Restart the Gateway to Apply Changes
xxxxxxxxxxopenclaw gateway restart[!TIP]
- The content of the bootstrap file is injected into the LLM context during the very first turn of a new session; therefore, you must start a new session to see the effects of any modifications.
- You can initiate a new session within the WebChat interface using the
/newcommand.- Empty files will be skipped and will not be injected into the context.
- If a file is missing, OpenClaw will inject a placeholder line indicating "Missing File."
3.3 Configuration Example: Creating a Customer Support Bot Agent
xxxxxxxxxx# SOUL.md# Role DefinitionYou are a friendly customer support bot responsible for answering user inquiries regarding robot products.# Tone and StyleEnthusiastic, patient, and professional; respond in Chinese.# Behavioral BoundariesDo not disclose internal system configuration information.Do not perform operations that compromise the security of the bot.xxxxxxxxxx# AGENTS.md# Operational GuidelinesFor product-related functional issues, first use `SeeWhat` to observe the current environment.For technical issues, guide users to consult relevant tutorial documentation.For questions that cannot be answered, record the query and escalate it to technical personnel.4. Deleting Agents
4.1 Deleting via CLI Commands
To delete an agent that is no longer needed, use the following command:
xxxxxxxxxxopenclaw agents delete <agentId>For example, to delete an agent named work:
xxxxxxxxxxopenclaw agents delete work
4.2 Manually Cleaning Up Agent Directories
After executing the CLI command, it is recommended to also clean up the following residual data:
xxxxxxxxxx# Delete the agent's data directoryrm -rf ~/.openclaw/agents/<agentId># Delete the agent's workspacerm -rf ~/.openclaw/workspace-<agentId>4.3 Cleaning Up Binding Configurations
After deleting an agent, you must also remove the corresponding binding records and agent list entries from the openclaw.json configuration file:
- Open the configuration file:
~/.openclaw/openclaw.json - Remove the entry for the specific agent from
agents.list. - Remove any binding rules related to that agent from
bindings. - Save the file, then restart the gateway:
xxxxxxxxxxopenclaw gateway restart[!WARNING]
- Deleting an agent will permanently remove that agent's session history, authentication configurations, and all associated data.
- Before proceeding with the deletion, please ensure that you have backed up any important data.
- If the agent is currently running, it is recommended to first disable any associated channel bindings before performing the deletion.