VI · Multi-AgentEmerging

Actor-Model Agents

also known as Actor Agents, Mailbox Agents, Message-Passing Agents

Implement each agent as an independent actor with its own mailbox, processing asynchronous messages one at a time and never sharing mutable state with peers.

This pattern helps complete certain larger patterns —

  • specialisesInter-Agent CommunicationDefine a protocol for agents to exchange tasks, capabilities, and results across process or vendor boundaries.

Context

A team is building a multi-agent system where several agents must run at the same time, react to events as they arrive, and keep going even when one of them crashes. There is no single conversational chair driving turn order, and the agents may live in different processes or on different machines.

Problem

If the agents are modelled as a request-and-response conversation, they are pinned to one thread of control and cannot easily run concurrently. If they share mutable state — a common dictionary, a shared queue, a global cache — concurrent reads and writes produce race conditions, and a crash in one agent corrupts state the others were relying on. Ad-hoc locking solves neither problem cleanly: it slows the system down and still leaves failure containment as an afterthought.

Forces

  • Concurrency and asynchrony are natural to agent systems but hostile to shared-state programming.
  • Actor-style isolation makes per-agent failure containment straightforward.
  • Sequential conversations are easier to reason about than concurrent mailboxes — but they do not scale to many agents.
  • A mailbox queue per agent costs memory and needs back-pressure rules.

Example

A monitoring system has a perception agent that ingests telemetry, an analysis agent that hypothesises causes, and a remediation agent that proposes actions. Each runs as its own actor with a mailbox. Telemetry arrives as messages to perception; perception emits analysis-request messages; analysis emits remediation-proposal messages. When the analysis actor crashes on a malformed input the supervisor restarts it with an empty mailbox; perception and remediation keep running. None of the three actors shares mutable state.

Diagram

Solution

Therefore:

Model each agent as an actor: a process or coroutine with its own mailbox, its own local state, and a message-handler that runs messages in receive order. Agents communicate only by sending messages — directly to a known agent id, or by publishing to a topic (see topic-based-routing). The runtime supervises actor lifecycles, restarts on crash, and routes messages across processes or machines. Pair with role-assignment when agents do have stable personas, and with supervisor when a coordinator is needed.

What this pattern forbids. Agents do not share mutable state and may not call each other synchronously; all cross-agent interaction must go through asynchronous mailbox messages.

And the patterns that stand alongside it, or against it —

  • complementsTopic-Based RoutingRoute inter-agent messages through named topics that agents subscribe to, instead of having senders address each other by id.
  • complementsEvent-Driven Agent★★Trigger the agent on external events (webhooks, message queues, file changes) instead of user requests or schedules.
  • complementsSupervisor★★Place a coordinating agent above a set of specialised agents and route work to them.
  • alternative-toConversational Multi-AgentHave agents converse turn by turn until a completion criterion fires; agent roles drive the conversation forward.
  • complementsCellular-Automata Agents·A swarm where each agent applies simple local rules to its immediate neighborhood; macro behavior emerges without a central orchestrator and without global information access.
  • complementsContract Net Protocol★★Classical bid-based multi-agent task allocation: a manager broadcasts a task announcement, contractors submit bids, and the manager awards the contract to the best bid.
  • complementsPerformative Message★★Inter-agent messages are typed by communicative intent (request, inform, propose, accept, refuse, query) rather than by free-form prose, so receivers can dispatch on act type.
  • alternative-toStigmergic Coordination★★Agents coordinate indirectly by leaving and reading marks in a shared environment (files, queues, scratchpads, world model) so that one agent's trace stimulates another's next action, with no direct messaging.

Neighbourhood

Click any neighbour to follow the language. Scroll to zoom, drag to pan.