How should AI agents cooperate? What should a multi-agent system look like? Everyone is trying to figure this out right now. Should our agents be thought of as a team that coordinates over an issue tracker? Are they more like a swarm of bees or ants? Should they be arranged into command-and-control hierarchies of agent and sub-agent? Or should we trust the bitter lesson and bet on one big model? Here’s my take: Agents are actors. Multi-agent is just the actor model. An actor…
That sounds a lot like an agent! An agent receives a user message, it updates its context, it may spawn other agents, and generate messages in response. It also sounds a lot like Von Foerster’s non-trivial machine, a cybernetic model of the minimal system that can generate agentic behavior: a function that accumulates state through feedback (aka, a reducer). Actors can also be seen as an idealized biological cell. A cell has a membrane that protects its internals. It sends and receives signals that pass through the membrane. It may also occasionally spawn other cells. This cell analogy is what Alan Kay was reaching for when he designed one of the earliest manifestations of Object-Oriented Programming:
If each agent is a cell, how can we make the jump to multicellularity? OOP never properly made this jump, and it never attained the sublime levels of biological complexity that Kay envisioned. This is because mainstream OOP languages had fatal design mistakes that broke compositionality. Actors fix this. There are multiple formal mathematical models that let us reason about actor composition at scale. To scale up our multi-agent systems, we could borrow some ground rules from actors:
These qualities make it very easy to parallelize actors. You don’t have any of the problems of shared mutable state, because there is no shared mutable state. The system can scale horizontally, from one process to many, and from one computer to many. Designing our agents as actors lets us spin up lots of parallel agents. Now what? How should these swarms of agents interact and be structured? Here too, the actor model offers useful patterns:
This is just a sample of the patterns that emerge naturally from the actor model. It is pretty easy to imagine how they might be useful in a multi-agent system. Some of them are already common: scatter-gather is used for Claude Code’s Explore agents, and prompt resolvers are a riff on the become pattern. Actor agents could allow us to run hundreds of parallel agents on a computer, or thousands across load-balanced servers, or even millions of agents across the whole internet. With location transparency, “Have your agent call my agent” and “have your factory call my factory” become essentially the same move. Furthermore, if every agent signs its messages with a public key, we get a decentralized protocol for massively multi-agent systems. Signed messages give us the basis for untrusted coordination between agents. Because signed messages are non-repudiable, we can begin to accrue cryptographically-verifiable reputations for specific agents, and distribute those reputations through webs of trust. Our agents can decide whether to interact with another agent based on the agent’s reputation. It is also pretty easy to imagine how we might extend such a decentralized agent protocol to enable end-to-end encrypted communication between agents. In the actor model, actors send messages directly to other actors using an address, so just encrypt the message, and send directly to the other agent’s address. The implementation for such a protocol could be very simple. Sign JSON with an agent-controlled key, send it over the wire. For the details, I would be inclined to borrow from Nostr for message signing, ATProto for DID-based signing and key rotation, and UCAN for delegating authority from user to agent to sub-agent. But in many ways, this protocol problem is simpler than the problem of decentralizing social media. Actor communication is point-to-point, rather than broadcast, so it’s a good fit for HTTP. In its most basic incarnation, an agent could be a URL, its address could be a POST request to that URL, and messages could be signed with a JWT. Reflecting on this, I feel like I can begin to see the shape of a new internet, something that may supersede the web: the internet of agents |
No comments:
Post a Comment