Skip to content
5.5Advanced8 min

Shared Memory vs. Message Passing in Multi-Agent Systems

Sebastian KarallUpdated 17 October 2026
Definition

Shared memory and message passing are the two fundamental paradigms of agent coordination. With shared memory (the blackboard pattern), all agents read from and write to a common state. With message passing, agents communicate exclusively via messages and share no state. The choice determines a multi-agent system's consistency, coupling, scaling and debuggability.

Key Takeaways

  • Shared memory (blackboard) means a common state that all agents read from and write to; message passing encapsulates each agent and lets it communicate only via messages.
  • The critical consistency rule is: reads may run in parallel fan-out, writes must remain single-threaded. According to Cognition, concurrent writes to shared state lead to conflicting implicit decisions and fragile results.
  • Message passing dominates the 2026 standards: A2A defines a task lifecycle with opaque agent internals, the OpenAI Agents SDK uses handoffs, the Anthropic Claude Agent SDK uses the Agent tool (formerly the Task tool) with compressed returns.
  • Shared memory is debuggable with single-writer topologies, but collapses under free write access; message passing requires end-to-end distributed tracing with correlation IDs.
  • In practice, production systems combine both: internal shared state (e.g. a LangGraph state object with checkpointing), with message passing via A2A to the outside.

Shared memory and message passing are the two fundamental paradigms used to coordinate multiple AI agents. With shared memory (in its classic variant, the blackboard pattern), all agents read from and write to a common state. With message passing, each agent is encapsulated and communicates exclusively via messages, with no shared state. The decision between the two determines four properties of a multi-agent system: consistency, coupling, scaling and debuggability. This article compares the paradigms along these axes and shows when each one fits.

  • Shared memory / blackboard: a common state (scratchpad, vector store, state object) that all agents read from and write to. Tightly coupled, simple context exchange, but tricky with parallel writes.
  • Message passing: isolated agents, exchange only via messages. Decoupled, scales across process and vendor boundaries, is the standard behind A2A, the OpenAI Agents SDK and the Anthropic Claude Agent SDK.
  • The decisive rule: reads may run in parallel fan-out, writes should remain single-threaded, regardless of the chosen paradigm.

Shared Memory and the Blackboard Pattern

In the shared-memory approach, all agents share a central store. The classic blackboard pattern originates in AI research: a shared "blackboard" holds the current state of a task, specialized agents observe it, read the parts relevant to them, enter their partial results and react to changes that other agents have caused. There is no fixed execution plan; the order emerges from which agent is currently able to contribute something useful.

In modern multi-agent systems, shared memory appears in several forms. Four external storage layers are common:

  • Vector stores (pgvector, Pinecone, Weaviate, Qdrant) for retrieval-augmented context.
  • Structured databases (Postgres, BigQuery, SAP HANA, Snowflake) for facts.
  • Scratchpads as ephemeral shared notepads that agents read from and write to, usually with append-only or compare-and-swap semantics.
  • Persistent agent memory (Letta/MemGPT style, LangGraph's cross-thread store, Anthropic's memory tool).

The peer-to-peer or swarm pattern also partly falls under this: peer agents on a shared message bus and/or shared store with no fixed orchestrator. OpenAI Swarm is the reference here: an experimental framework released in October 2024 and succeeded by the production-ready OpenAI Agents SDK in March 2025. For DACH enterprise contexts, however, this free-form model is rarely suitable, because debuggability and accountability suffer as a result.

The weak point is consistency. As soon as two agents read the same store and at least one writes, a clear strategy is needed. Three options are common: (a) optimistic concurrency, (b) a single writer with multiple readers, or (c) explicit lock semantics. Most production systems choose (b), which corresponds to the Cognition rule "writes stay single-threaded".

Message Passing and Agent Communication via Messages

With message passing, each agent holds its own state and its own context window. Information flows only via explicit messages, never via direct access to another's state. This decouples the agents: an agent does not need to know anything about another's internal workings, model or memory; it only needs to know the message format.

This is precisely the design idea behind the Agent-to-Agent protocol (A2A), which was released by Google at Cloud Next in April 2025 and handed over to the Linux Foundation on June 23, 2025. A2A defines how agents talk, not how they think: each agent publishes an AgentCard (a JSON document with endpoint, capabilities, skills, modalities and auth schemes). A collaboration runs via a task lifecycle:

submitted -> working -> input-required -> completed | failed | canceled

The internal workings of the remote agent remain opaque throughout. This is exactly what allows a Salesforce agent to call an SAP agent without either one exposing prompts, memory or model to the other. While A2A covers the agent-to-agent level, the Model Context Protocol (MCP) governs the agent-to-tool level. The rule of thumb common across the industry (as of 2026): MCP for capabilities (agent to tool), A2A for collaboration (agent to agent).

Other stacks implement message passing with their own semantics:

Stack

Message-passing semantics

A2A

Task lifecycle, multi-part messages, artifacts as output, opaque internals between agents

OpenAI Agents SDK

Explicit handoffs: one agent ends its turn, the next takes over, conversation history is passed along

AutoGen (in maintenance mode, successor: Microsoft Agent Framework)

Group chat with turn-taking, shared conversation history, addressing via mentions

LangGraph

Typed state object passed through nodes, checkpointed, durable across server restarts

Anthropic Claude Agent SDK

Lead spawns sub-agents via the Agent tool (formerly the Task tool), sub-agents deliver compressed structured outputs

Bedrock Multi-Agent Collaboration

Supervisor plus collaborator agents, routing mode vs. full orchestration

Agentforce

Atlas Reasoning Engine routes, specialist agents deliver back, conversation context preserved

LangGraph is an interesting borderline case here: the typed state object is effectively a shared state, but it is passed in a controlled manner from node to node and checkpointed, so it is not written freely. This is the hybrid form common in practice.

The Trade-offs in Direct Comparison

Dimension

Shared memory / blackboard

Message passing

Coupling

High: all agents know the state schema

Low: only the message format is shared

Consistency

Tricky: race conditions with concurrent writes, needs single-writer or locks

Simpler: no shared state that can be corrupted

Scaling

Limited by write contention on the shared store

Scales across process, team and vendor boundaries

Context exchange

Very direct: full state immediately visible

Explicit: only what is deliberately sent

Debuggability

Good with single-writer, collapses under free write access

Needs distributed tracing with correlation IDs across all messages

Auditability

State snapshots, but "who decided what" often unclear

Each message is an audit-relevant data point

Typical use

Tightly coupled subtasks within one process

Cross-system, cross-vendor workflows

Standard protocol 2026

proprietary / framework-internal

A2A (Linux Foundation), MCP for tools

Two failure modes deserve particular attention. First, context fragmentation: sub-agents make incompatible implicit decisions. Cognition states this as a principle: "Actions carry implicit decisions, and conflicting decisions carry bad results." The remedies are sharing full traces under high coupling, single-threaded writes and explicit decision contracts. Second, debuggability collapse: with message passing there is no single trace covering the entire run, but rather N sub-agent trajectories plus synthesis. The remedy is end-to-end distributed tracing with correlation IDs propagated across every A2A task and every MCP call.

A Concrete Example: Read Fan-out with a Single Writer

The Anthropic Research Agent (June 2025) is the reference for the correct split. A lead agent (Claude Opus 4) decomposes the request and spawns N parallel sub-agents (Claude Sonnet 4). Each sub-agent has its own context window of around 200k tokens, researches independently and returns a compressed summary (not the full transcript) to the lead, which synthesizes. This is pure message passing with isolated contexts. The result, according to Anthropic's internal research eval: the multi-agent system performed 90.2% better than a single agent running Claude Opus 4. The price is around 15x the token consumption of a normal chat interaction; a single agent uses about 4x. These economics only pay off for high-value, parallelizable tasks.

A counterpart from insurance practice is Allianz Project Nemo: seven specialized agents (planner, cyber, coverage, weather, fraud, payout, audit) for food-spoilage claims after natural disasters. In Allianz's worked example, less than five minutes pass between filing the claim and the final review. That review stays with a human: a caseworker reads the audit summary and makes the final payout decision (human-in-the-loop as an explicit requirement). Allianz built the system in under 100 days and launched it in Australia in July 2025. Documented result: 80% less processing and settlement time for valid claims under AUD 500.

As pseudocode, the read fan-out topology with a single writer looks like this:

  1. fragments = parallel_map(sub_agent.research, subtasks): reads run in parallel as a fan-out with isolated contexts.
  2. result = lead.synthesize(fragments): exactly one writer merges the fragments.
  3. commit(result): the write stays single-threaded.

Concurrent writes by several agents to the same state, by contrast, should be avoided, because agents writing in parallel make implicit decisions that contradict each other.

When to Use Which Paradigm

  • Choose message passing when agents collaborate across process, team or vendor boundaries, when internals are to remain encapsulated and when auditing per message is required. This is the default for cross-system workflows (Agentforce to Joule to Copilot via A2A) and for read-mostly fan-out (research, retrieval, classification, review).
  • Choose shared memory when tightly coupled subtasks run within a single process, the shared state is small and the write frequency is low, and a single writer can be established. The blackboard suits tasks without a fixed execution plan.
  • Combine both, which is the production reality: an internal LangGraph flow with a durable state object and checkpointing, exposed to the outside as an A2A endpoint with an AgentCard. Controlled shared state internally, clean message passing externally.

For Agencies and B2B Decision-Makers

The choice of paradigm is a question of operational risk. Anyone setting up multi-agent workflows in the DACH region should default to message passing via the convergent standard combination of MCP plus A2A and deliberately confine shared memory to tightly coupled internal subtasks with a single writer. For marketing agencies this means, in concrete terms: content, research and review pipelines benefit from parallel read fan-out, while the final write step (publication, CRM entry) remains single-threaded. Anyone planning a production-ready, auditable agent architecture for their clients or their own organization should fix the coupling profile, the consistency strategy and the tracing infrastructure early, before the first line of orchestration is written. This is exactly where Blck Alpaca's consulting comes in.

Summarize with AIChatGPTClaudePerplexity

Opens the chat with a prepared prompt.

Frequently asked questions

What is the difference between shared memory and message passing for agents?
With shared memory, all agents share a common state (blackboard, scratchpad, vector store) that they read from and write to. With message passing, each agent holds an isolated state and exchanges information only via explicit messages. Shared memory couples more tightly and simplifies sharing context; message passing decouples, scales across process and vendor boundaries and is the prevailing model in the 2026 multi-agent standard (A2A, MCP).
What is the blackboard pattern for agents?
The blackboard pattern is a shared-memory variant: a common store (the blackboard) holds the state of the task, several specialized agents read the parts relevant to them, enter their partial results and react to changes made by others. It suits tasks without a fixed execution plan. The critical point is write consistency: in production it is usually implemented as a single writer with multiple readers, or with append-only or compare-and-swap semantics.
When should I choose message passing instead of shared memory?
Message passing is the right choice when agents collaborate across process, team or vendor boundaries, when internals (prompts, models, memory) are to remain encapsulated, and when per-message auditability is required. This is exactly what the A2A protocol covers. Shared memory is more worthwhile within a single process for tightly coupled subtasks with a low write frequency and one clear single writer.
Why are parallel writes to shared state problematic?
Concurrent writes by several agents to the same state create race conditions and contradictory implicit decisions. Cognition sums this up in a principle: actions carry implicit decisions, and conflicting decisions carry bad results. The standard solution is: parallelize reads, keep writes single-threaded, i.e. only one agent or pipeline stage commits the final state.
Which paradigm do the common frameworks use in 2026?
As of 2026, most stacks rely on message passing with differing semantics: A2A uses a task lifecycle with artifacts and opaque internals, the OpenAI Agents SDK uses explicit handoffs, AutoGen (now in maintenance mode, succeeded by Microsoft Agent Framework) uses group chat with turn-taking, the Anthropic Claude Agent SDK uses the Agent tool (formerly the Task tool) with compressed returns. LangGraph uses a typed, checkpointed state object between nodes, a state that is effectively shared but passed through in a controlled manner.

Want to go deeper?

Get new analyses straight to your inbox, or see how we put this knowledge to work for companies.