Agent Mesh

Agent Mesh

The Agent Mesh is Kollab's multi-agent coordination layer. Multiple specialized agents work in parallel, claiming files from shared queues, and shipping code without stepping on each other.

Overview

When you spawn multiple agents on the Hub, they need coordination to avoid conflicts. The mesh provides:

  • Work queues — shared task list where agents claim items
  • File lanes — ownership claims that prevent edit conflicts
  • Task lifecycle — checkpoint, complete, approve, reject
  • Change feed — file change notifications and watching

Work Queues

The coordinator (or any agent) can add work items to a shared queue. Agents claim items and report progress through the task lifecycle.

Queue Operations

CommandDescription
hub_queueAdd a work item to the shared queue
hub_claimClaim the next available work item
hub_workView current queue and assignments
claimsList all active claims by agent
# Coordinator adds work to queue
/hub queue refactor auth module
# Agent claims the work
/hub claim
# Claimed: "refactor auth module"

Work items are first-come, first-served. Once an agent claims an item, it's theirs until completed. Other agents can see who claimed what through the work view.

File Lanes

When multiple agents edit files simultaneously, conflicts are inevitable. File lanes solve this by letting agents claim ownership of files before editing.

CommandDescription
lane_claimClaim ownership of a file
lane_releaseRelease file ownership when done
# Sapphire claims a file for editing
<lane_claim>src/auth.py</lane_claim>
# Lapis tries to claim the same file
Warning: sapphire has claimed src/auth.py
# Sapphire finishes and releases
<lane_release>src/auth.py</lane_release>

Best practice: Always claim before editing and release when done. Forgetting to release blocks other agents from that file.

Task Lifecycle

Agents report progress through a structured task lifecycle. This gives the coordinator visibility into what's happening across the mesh.

StageDescription
task_checkpointReport progress update on a task
task_completeMark a task as done with summary
task_approveApprove a completed task (reviewer)
task_rejectReject a task with reason (reviewer)
# Agent reports progress
<task_checkpoint id="auth-refactor">migrated login handler</task_checkpoint>
# Agent finishes
<task_complete id="auth-refactor">auth module refactored</task_complete>
# Coordinator approves
<task_approve id="auth-refactor">clean, ships</task_approve>

Change Feed

The change feed keeps agents informed about file modifications across the mesh. Agents can watch files they depend on and get notified when changes happen.

CommandDescription
file_changedNotify peers that a file was modified
file_watchWatch a file for changes
file_unwatchStop watching a file
feed_recentView recent file changes across the mesh
feed_fileView change history for a specific file

The Coordinator Role

The coordinator agent is responsible for splitting work, assigning tasks, monitoring progress, and reporting results back to you. It does not write code itself — it delegates to specialized agents.

The coordinator uses hub_capture to check agent output, hub_agents to see who's online, and hub_msg to send clarifications or corrections.

For more on the coordinator pattern, see the Coordinator docs.

Across Computers

To work with agents on your other computers, join them to an Agent Network with /connect. Their agents appear in the roster as agent@device, and you message them with hub_msg like any local agent.

Next Steps