Multi-agent patterns
Build multi-agent systems with message passing, shared memory, and coordination patterns.
Letta provides built-in tools for cross-agent communication to build multi-agent systems. Agents can communicate via message passing or share state via shared memory blocks.
Built-in multi-agent tools
Section titled “Built-in multi-agent tools”The built-in tools for multi-agent communication support both synchronous and asynchronous communication between agents on your Letta server.
There are three built-in tools for cross-agent communication:
| Tool | Type | Use case |
|---|---|---|
send_message_to_agent_async | Async | Fire-and-forget messaging between agents |
send_message_to_agent_and_wait_for_reply | Sync | Request/response between two agents |
send_message_to_agents_matching_all_tags | Sync | Supervisor broadcasts to worker groups |
Async messaging (no wait)
Section titled “Async messaging (no wait)”sequenceDiagram
autonumber
Agent 1->>Agent 2: "Hi Agent 2 are you there?"
Agent 2-->>Agent 1: "Your message has been delivered."
Note over Agent 2: Processes message
Agent 2->>Agent 1: "Hi Agent 1, yes I'm here!"
Agent 1-->>Agent 2: "Your message has been delivered."
The send_message_to_agent_async tool sends a message to another agent and returns immediately. The message contains a receipt indicating the sender, so the target agent can reply.
Sync messaging (wait for reply)
Section titled “Sync messaging (wait for reply)”sequenceDiagram
autonumber
Agent 1->>Agent 2: "Hi Agent 2 are you there?"
Note over Agent 2: Processes message
Agent 2->>Agent 1: "Hi Agent 1, yes I'm here!"
The send_message_to_agent_and_wait_for_reply tool sends a message and waits for the target agent’s response before returning.
Supervisor-worker messaging
Section titled “Supervisor-worker messaging”sequenceDiagram
autonumber
Supervisor->>Worker 1: "Let's start the task"
Supervisor->>Worker 2: "Let's start the task"
Supervisor->>Worker 3: "Let's start the task"
Note over Worker 1,Worker 3: All workers process their tasks
Worker 1->>Supervisor: "Here's my result!"
Worker 2->>Supervisor: "This is what I have"
Worker 3->>Supervisor: "I didn't do anything..."
The send_message_to_agents_matching_all_tags tool sends a message to a group of agents matching specific tags. This is synchronous - the result includes responses from each matched agent.
Coordination patterns
Section titled “Coordination patterns”Choose a pattern based on your use case:
Related resources
Section titled “Related resources”- Shared memory blocks - Share state between agents
- Memory blocks overview - Understanding core memory
- Shared memory tutorial - Step-by-step shared memory guide