Technology Encyclopedia Home >Mastering OpenClaw - How to Configure Multiple Independent Agents

Mastering OpenClaw - How to Configure Multiple Independent Agents

Note for first-time users: If you haven’t deployed OpenClaw yet, start with Tencent Cloud OpenClaw first. You can launch your OpenClaw instance in seconds with one click, then come back to this guide to explore more advanced use cases.

It has been more than a month since OpenClaw exploded in popularity, and we have seen many AI explorers continuously trying out different OpenClaw scenarios and workflows. As you get to know OpenClaw better, one issue gradually becomes obvious: when a single Agent handles many kinds of tasks, the memory burden becomes extremely heavy, which can dramatically increase token consumption. Later on, a single question may easily burn through hundreds of thousands of tokens.

Just like members in a real company or organization, different people handle different kinds of work. Clear division of labor and specialized roles are almost inevitable once a system reaches a certain level of complexity.

OpenClaw supports the same idea: you can create multiple isolated Agents, each with its own personality, skills, memory, workspace, and more. Your job is to define them, and then use them to build an “AI legion.”

Principle Explanation and Solution Overview

The core mechanism for implementing multiple Agents in OpenClaw is as follows:

  • An Agent is an isolated “brain”: it has its own workspace, where memory and skills are stored, and its own sessions.
  • Which Agent receives a request: this is determined by the bindings configuration, with the most specific rule taking priority.
  • Which model an Agent uses: this can be configured individually in agents.list[].model. At runtime, the model configured for that Agent overrides the default value first (code path: resolveDefaultModelForAgent).

Based on the above principles, this article uses the following approach:

  • The default main Agent continues to handle all private chats.
  • Each group is bound to a different group Agent.
  • Each Agent’s memory, skills, and model can be fully isolated.

Of course, you can also copy this principle and solution into your OpenClaw instance and ask it to help with the configuration through direct conversation. However, in practice, we found that if you rely entirely on OpenClaw to complete the whole configuration process by itself, it is easy to run into issues because model performance varies.

This guide will walk you through using the command line to configure an independent Agent for a Feishu group, fully isolated from the main Agent. That Agent can have its own workspace, making its context, memory, model, and more completely independent.

Prerequisites

Before you begin, make sure that:

Step 1: Create a Feishu Group and Obtain Its ID

First, create a Feishu group and obtain its conversation ID.

Create a Feishu Group

  1. Open the Feishu client and click the + button.
  2. Select Create Group.

Entry for creating a Feishu group

  1. Enter a group name and add members as prompted. You can also create the group without adding members for now.

Create a Feishu group and set its name

Obtain the Conversation ID

Getting the Feishu conversation ID is straightforward. You can copy it directly from the group settings:

  1. Open the group and click the ... button in the upper-right corner.
  2. Select Settings.

Entry to Feishu group settings

  1. Scroll to the bottom of the settings page and find the group information.
  2. Click Copy to copy the conversation ID.

Copy the Feishu conversation ID

The conversation ID looks like this: oc_5b6799cff4a754c15e5ff3025becc648

⚠️ Note: Keep the copied conversation ID safe, because you will need it in the later configuration steps. It is a good idea to save it in a local text file for convenience.

Step 2: Log In to the Server

After obtaining the conversation ID, log in to the server command line from the Tencent Cloud Lighthouse console.

  1. Log in to the Tencent Cloud Lighthouse Console, and find your OpenClaw instance.
  2. Click the Log In button on the instance card.
  3. Wait for the OrcaTerm terminal window to open, then follow the on-screen instructions to complete the login.

Lighthouse instance login and OrcaTerm terminal example

Step 3: Back Up the Configuration File

Before modifying the configuration file, it is strongly recommended that you back up the original file so you can quickly restore it if something goes wrong.

Run the following command to back up the OpenClaw configuration file:

cp ~/.openclaw/openclaw.json ~/.openclaw/openclaw.json.backup.$(date +%Y%m%d_%H%M%S)

After that, run the following command to confirm that the backup file has been created:

ls -la ~/.openclaw/openclaw.json*

View the OpenClaw configuration backup file

⚠️ Note: If OpenClaw fails to start or behaves abnormally in the later configuration process, you can restore the original configuration with the following commands:

cp ~/.openclaw/openclaw.json.backup.YYYYMMDD_HHMMSS ~/.openclaw/openclaw.json
openclaw gateway restart

Replace YYYYMMDD_HHMMSS with the actual timestamp from your backup file name.

Step 4: Configure the New Agent

Use the openclaw agents add command to add a new Agent. Replace the workspace path and the new Agent name (ID) with values you want to use:

openclaw agents add --workspace workspace-path new-agent-name-id

ℹ️ Note: Command parameter description:

  • --workspace: specifies the independent data workspace path. The recommended format is /root/.openclaw/workspace-feishu-team-name
  • new-agent-name-id: the recommended format is feishu-team-purpose
  • --model: if you need a custom model, add this argument and provide the model ID; otherwise, the default model will be used

In this example, we create an Agent for document writing, named feishu-writer, with the workspace set to /root/.openclaw/workspace-feishu-writer.

So run:

openclaw agents add --workspace /root/.openclaw/workspace-feishu-writer feishu-writer

If you see output similar to the following, the Agent has been created successfully:

Agent: feishu-writer
Workspace: ~/.openclaw/workspace-feishu-writer

Example output from

You can also run the following command to verify that the Agent was added successfully:

openclaw agents list

Verify successful Agent creation with

Step 5: Configure the Feishu Group Binding

Next, configure the binding relationship between the Feishu group and the new Agent.

If your configuration already contains other bindings, such as Telegram group bindings, it is recommended that you export the current configuration first:

openclaw config get bindings > /tmp/bindings-backup.json

Then add the Feishu group binding with the following command. Replace oc_5b6799cff4a754c15e5ff3025becc648 with the actual conversation ID you obtained:

openclaw config set --json bindings '[
  {
    "agentId": "feishu-writer",
    "match": {
      "channel": "feishu",
      "peer": {
        "kind": "group",
        "id": "oc_5b6799cff4a754c15e5ff3025becc648"
      }
    }
  }
]'

Configure  to bind the Feishu group to the Agent

❌ Warning:

openclaw config set --json bindings '[...]' will replace the entire current bindings configuration. In other words, if your command contains only one Feishu binding, all previously configured QQ, Telegram, or other bindings will be overwritten.

If you already have other bindings configured:

  1. Run openclaw config get bindings first and copy the existing bindings.
  2. Append one Feishu group binding to the existing array.
  3. Write the entire array back with config set --json bindings '[ existing bindings..., new Feishu binding ]'.

Step 6: Configure the Feishu Group Allowlist

Use the following command to configure the Feishu group access policy:

openclaw config set channels.feishu.groupPolicy allowlist

Then configure the list of allowed groups. Replace the conversation ID in the following command with your actual ID:

openclaw config set --json channels.feishu.groupAllowFrom '["oc_5b6799cff4a754c15e5ff3025becc648"]'

✅ Note: Using the allowlist policy ensures that only groups configured in groupAllowFrom can access OpenClaw. This is a safety measure.

Example of configuring  and

Step 7: Restart the Gateway

Restart the Gateway so it loads the new configuration:

openclaw gateway restart

After the restart is complete, use the following command to confirm the Gateway status:

openclaw gateway status

✅ Success: If the Gateway status shows running, the configuration file format is correct and has been loaded successfully.

Step 8: Add the Bot to the Group

Now add the Feishu bot to the group so that members can use the AI assistant directly in the group.

  1. Open the Feishu group, click the Settings button from the More menu in the upper-right corner, and select Group Bot:

Entry to the group bot settings in Feishu

  1. Select your bot and add it to the group.

⚠️ Note: The bot you add here is the same bot you used earlier in private chat.

Select the bot in the Feishu group

Confirm adding the bot to the group chat

  1. After the bot is added successfully, you will see a notification in the group.

Notification that the bot has joined the Feishu group chat

After the bot is added successfully, send a test message to confirm that it responds correctly.

⚠️ Note: By default, you need to @mention the bot when interacting with it in a group.

Test conversation by @mentioning the bot in a Feishu group chat

Step 9: Test and Verify Agent Isolation

After the configuration is complete, you should verify that the Agent isolation works as expected.

Test 1: Group Messages Use the Independent Agent

  1. In the newly created Feishu group, ask the bot: What is your workspace path?
  2. Verify that the bot returns the new Agent workspace path: /root/.openclaw/workspace-feishu-writer

Query the independent Agent workspace path in the group chat

Test 2: Verify Isolation Between the Main Agent and the Independent Agent

  1. Start a one-to-one private chat with the bot, not through the group.
  2. Ask: What is your workspace path?
  3. Verify that the main Agent returns the default workspace path: /root/.openclaw/workspace

Query the main Agent workspace path in private chat

Test 3: Verify Data Isolation

  1. In the group, ask the bot to remember some information, for example: Remember this: our team code name is "North Star".

Write the team code name into memory in the group chat

  1. In private chat, ask the bot: Do you remember our team code name?
  2. Verify that the main Agent cannot access information from the group.

Verify in private chat that the main Agent cannot access the group memory

✅ Success: If the main Agent replies with “I don’t know” or something similar, the independent Agent and the main Agent are fully isolated, and the configuration is successful.

Troubleshooting

Problem 1: Gateway Fails to Start

If the Gateway fails to start, first check whether the configuration file format is correct:

cat ~/.openclaw/openclaw.json | python3 -m json.tool

If it returns a JSON parsing error, fix the configuration file according to the error message.

If the configuration file format is correct but the Gateway still cannot start, restore the backup configuration:

cp ~/.openclaw/openclaw.json.backup.YYYYMMDD_HHMMSS ~/.openclaw/openclaw.json
openclaw gateway restart

Problem 2: The Bot Does Not Respond in the Group

Check the Gateway logs for error messages:

openclaw logs --follow

Common causes:

  • The conversation ID was not configured correctly in bindings.
  • The conversation ID was not added to groupAllowFrom.
  • The bot was not added to the group correctly.

Problem 3: Agent Isolation Does Not Work

Check whether the bindings configuration is correct:

openclaw agents list --bindings

Make sure that:

  • agentId matches the Agent ID shown by openclaw agents list.
  • peer.id is the correct conversation ID.

Problem 4: Configuration Commands Fail

If you encounter a JSON format error while running openclaw config set --json, make sure that:

  1. The JSON format is correct, especially quotation marks and commas.
  2. Strings use double quotes.
  3. There is no trailing comma after the last element of an array.

📝 Note: If you are not sure whether the JSON format is correct, you can validate it with an online JSON validation tool, or temporarily use openclaw config set to test a single field first.

Advanced Operations

After completing the above configuration, you can explore additional capabilities for your Feishu group:

  • Configure a custom model for the independent Agent to provide different AI capabilities.
  • Create multiple independent Agents for different teams, each with its own dedicated AI assistant.
  • Configure the Agent’s skills and permissions to provide more precise service.

Configure a Custom Model for the Agent

If you need a specific model for the independent Agent, you can specify it when creating the Agent:

openclaw agents add --workspace /root/.openclaw/workspace-feishu-writer --model kitcoding-openai/z-ai/glm4.7 feishu-writer

Configure Different Agents for Multiple Groups

If you need separate Agents for multiple Feishu groups, repeat the above steps:

  1. Create an independent Agent for each group.
  2. Add multiple group bindings in bindings.
  3. Add multiple conversation IDs to groupAllowFrom.

Configuration example:

openclaw config set --json bindings '[
  {
    "agentId": "feishu-writer",
    "match": {
      "channel": "feishu",
      "peer": {
        "kind": "group",
        "id": "oc_e4dfb35658c81ce5100add124c3592a8"
      }
    }
  },
  {
    "agentId": "feishu-operations",
    "match": {
      "channel": "feishu",
      "peer": {
        "kind": "group",
        "id": "oc_9f23c45769d92df621Bee02350c4603d"
      }
    }
  }
]'

openclaw config set --json channels.feishu.groupAllowFrom '[
  "oc_e4dfb35658c81ce5100add124c3592a8",
  "oc_9f23c45769d92df621Bee02350c4603d"
]'

Frequently Asked Questions

Q: Can I configure multiple Agents for a single group?
A: Currently, OpenClaw does not support binding multiple Agents to a single group. Each group can be bound to only one Agent, but you can configure different Agents for multiple different groups.

Q: Does an independent Agent inherit the main Agent’s configuration?
A: An independent Agent does not inherit the main Agent’s configuration. It has a completely independent workspace, memory, and state. However, it can inherit the default model and default workspace path from agents.defaults.

Q: Can I move an already configured Agent to another group?
A: Yes. You only need to change the peer.id in bindings to the new conversation ID, update groupAllowFrom, and restart the Gateway. Note that data from the original group is not migrated automatically to the new group.

Q: Is command-line configuration more complicated than manually editing the configuration file?
A: For beginners, using openclaw agents add and openclaw config set is simpler and safer than editing the configuration file manually with editors like nano. These commands automatically handle configuration formatting and reduce the chance of mistakes.

Q: What if I want to delete a configured Agent?
A: Use the following command to delete the Agent:

openclaw agents delete feishu-writer

This command deletes the Agent configuration as well as the related workspace and state data.


Join the User Community Group

You are welcome to scan the code to join the OpenClaw user community group, share your experience and questions, and explore more OpenClaw use cases with other developers.

QR code for the OpenClaw user community group


🚀 Developer Community & Support

1️⃣ OpenClaw Developer Community

Unlock advanced tips on Discord

Click to join the community
Note: After joining, you can get the latest plugin templates and deployment playbooks

2️⃣ Dedicated Support

Join WhatsApp / WeCom for dedicated technical support

Channel Scan / Click to join
WhatsApp Channel
WeCom (Enterprise WeChat)

Learn more on the official page: Tencent Cloud OpenClaw