Multi-bot Collaboration
You can run several Lark bots on one machine, each backed by a different CLI (say, one Claude Code and one Codex). Put them in the same group and different models can work together and pick holes in each other's work.
Get started in three steps
- Each bot is one Lark app. Configure the CLI each one should use (see bots.json).
- Add these bots and yourself to the same group (to create a group in one sentence, see One-click session group).
- @ the bot you want in the group and start talking.
Each bot is a separate process; they don't affect each other.
Common scenarios
Who gets the message: routing rules
@botA @botB /t <task>: each mentioned bot opens its own independent session on this message. Both bots share the same thread (anchored on your/tmessage), but the sessions are unrelated.- To make one bot the "default responder" in a multi-bot group (replies without an @, but steps aside when someone else is named), set its mention policy to
ambient. See Mention policy.
Letting bots hand off to each other
Bots hand off by actually @-mentioning each other in a message.
One rule to remember: if you don't
--mentionthe other bot, it is never triggered.
How:
- See who is in the group: run
botmux bots listinside a session. It lists the bots in the current group, each with itsopenId, capability tag (capability), andmentionable(whether it can be reliably @-mentioned). The<available_bots>block in incoming messages also hints which bots can take a handoff. - Then @ the other bot:
botmux send --mention <other openId> "...". Once it receives the @, it starts working.
If mentionable is false, there is no reliable @ handle for that bot in this group yet. Send /introduce in the group so the bots register each other, and precise @-mentions work from then on.
How bots find each other
- Within one deployment: by default, bots in the current group are discovered from the Lark group bot roster. Bots on the same machine can always talk to each other; bots on the same machine with the same owner can also run admin commands on each other, see Permissions.
- Across deployments (bots on someone else's machine): two paths, both going through the same team-trust gate with no
/grantneeded:- Federation in the Dashboard "Teams" panel: bring another deployment into the same team, then create cross-deployment groups;
- Central-platform team sync: the platform pushes down teams and groups (see "Team scope" below).
A plain /group or the Dashboard "New group" flow creates an ordinary group inside your deployment. It uses neither path and carries no cross-deployment team trust.
Letting bots that weren't @-mentioned catch up
By default a bot only sees messages that @ it. With group context sharing on, a bot automatically gets the group background it missed when it is woken up.
The owner or a human in allowedUsers @-mentions any bot managed by this deployment in the group and sends:
What happens once it's on:
- Bots in this deployment quietly "listen" to the group in the background, but listening never starts a model, so listening itself costs no tokens.
- When a bot is later woken up under the usual @ rules, it automatically receives the group messages it missed (with sources). The @ rules themselves don't change.
- One switch covers the whole group; no per-bot setup.
Limits and details:
status and the enable reply include a recall sync diagnostic, telling you whether recalled messages will be removed from the background in time:
Turning the switch off does no subscription check or setup.
Team scope: finding bots on other people's machines
Once connected to the central platform, you can find bots in your team on other people's machines by specialty (even if they aren't in your group yet), then bring them into a group. Three commands, one job each:
If this machine belongs to only one team, --team can be omitted; with several teams it is required.
Each bot returned by bots list --scope team has:
Key points:
- Only bots that joined the team are listed: the list only includes bots whose owner explicitly added them to the team in the platform's "Manage bots". If a bot is missing, its owner most likely hasn't added it yet.
- Specialties and online status are self-reported:
specialties/mentionable/onlineare for picking only, not trusted credentials. - appId, not @: you can't @ someone else's bot before it's in your group, so all three commands go by appId + platform auth. Permissions and team membership are decided entirely by the platform.
- Target group for
bots invite: you must already be in it, and the platform bot must be in it. If the platform bot is missing, botmux automatically uses one of your local bots already in the group to add it, then retries; usually you won't notice. You're asked to add it manually only when the group requires owner approval to add bots, or none of your local bots is in that group.
External bots: Lark bots that don't run on botmux
Lark bots from other frameworks or hosted agent platforms can join a team too. A team member registers one under "External bots" on the team card in the platform: its App ID, a name, and optionally its union_id (starts with on_). Once registered:
- it is added to the bot hall and listed in the team roster, and the team's botmux bots trust it without
/grant: in any shared group when itsunion_idis set and the Lark event carries a senderapp_idmatching the same entry; otherwise only in team groups (the hall and platform-created groups), including whenapp_idis absent or mismatched; bots list --scope teamfinds it (external: true), andcreate-group --team/bots invitecan bring it, with the member who registered it, into a group.
The member who registered it vouches for it: it is removed when that member leaves the team, and that member or a team admin can remove it. A bot that already runs on botmux can't be registered this way; its owner adds it to the team under "Manage bots". Same-team trust for an external bot requires its union_id to pair with the Lark-stamped sender app_id, preventing it from borrowing a person's or another bot's union. Its appId never makes a bot on this machine count as a team member or a same-machine bot.
Three ways to add bots, don't mix them up
To create a group with only your local bots, use botmux create-group --bot <name> or One-click session group.
Related
- Roles & Teams: give each bot a persona and capability tags
- One-click session group: add several bots to a new group in one sentence
- Session Relay: move a session into a collaboration group
- Multi-topic collaboration: let one bot open sub-topics and dispatch tasks to other bots
- Project Progress Card: the lead bot pins a card in the group that rolls up every sub-task's progress
