TOPIC / RESOURCE
Multi-agent Feishu bot setup
When to use multi-agent (context too long, mixed task types, parallel execution), architecture patterns (pipeline, parallel, hierarchical), workspace.
Best for
- 已经把单机器人飞书路线跑稳
- 希望让不同机器人绑定不同 Agent
- 准备做角色分工、渠道分流或上下文隔离
When to use multi-agent
Consider it when different bots should have different roles, you want routing by channel or account, personal and work contexts need strong separation, or the single-agent setup is already stable. If you have not reliably run a single Feishu bot yet, focus on that first.
Core concepts
agentId— A distinct "brain" with its own workspace, state directory, and sessions.accountId— A concrete Feishu app instance (one bot identity).binding— A rule that routes incoming messages from a channel/account to a specificagentId.
Directory structure
Keep workspace, agentDir, and sessions distinct. Avoid multiple agents sharing the same agentDir; auth and sessions will conflict. Example:
~/.openclaw/
├── agents/ (main/agent/, dev/agent/, content/agent/)
└── workspace/ (main/, dev/, content/)
Minimal multi-agent template
Start with 2–3 agents. Ensure unique ids, separate workspaces, separate agentDirs, matching accountId ↔ binding, and tools.agentToAgent.allow includes all cooperating agents.
{
"agents": { "list": [{ "id": "main", "workspace": "~/.openclaw/workspace/main", "agentDir": "~/.openclaw/agents/main/agent" }, { "id": "content", "workspace": "~/.openclaw/workspace/content", "agentDir": "~/.openclaw/agents/content/agent" }] },
"channels": { "feishu": { "enabled": true, "accounts": { "main": {}, "content": {} } } },
"bindings": [
{ "agentId": "main", "match": { "channel": "feishu", "accountId": "main" } },
{ "agentId": "content", "match": { "channel": "feishu", "accountId": "content" } }
],
"tools": { "agentToAgent": { "enabled": true, "allow": ["main", "content"] } }
}
Feishu app setup
- Create a separate Feishu app per agent.
- Record each app's App ID and App Secret correctly.
- Enable bot capability and "join group as bot."
- Prefer long connection over webhook for initial setup.
- Publish the app — many "bot offline" issues come from unpublished apps.
Shared memory vs independent context
- Shared memory — When agents must align on user preferences or cross-session facts.
- Independent context — When roles are isolated and each agent should not leak context. Define this explicitly in
tools.agentToAgentand workspace rules.
Common mistakes
| Issue | Check |
|---|---|
| Bot offline | App ID/Secret, app published, auth errors in logs |
| Agents not cooperating | agentToAgent.allow, each workspace has AGENTS.md |
| Send-only or receive-only | Event subscription, message permissions, long connection |
| Routing not working | Correct bindings, accountId matches Feishu app |
External links
FAQ
Topic FAQ
When you have stable single-bot flow and need role separation, channel routing, or different context isolation.
Not strictly, but starting with one bot per agent is the easiest way to configure and debug.
RELATED
Related posts
OpenClaw Install Guide: Verify Before You Copy
The fastest install guide starts with the right decisions: current requirements, environment choice, and a clear first validation loop.
What is OpenClaw? More than a chat shell
OpenClaw makes more sense as an assistant platform with channels and skills than as a simple chat wrapper.