An organization runs two agent instances that share a common external memory store. Agent Instance A and Agent Instance B both retrieve context from the same vector store and both write new entries to it. An engineer is concerned about memory consistency — specifically, that both instances might simultaneously write conflicting entries about the same topic, creating divergent or contradictory memory. Which mechanism MOST effectively prevents this consistency problem?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Two people writing to the same notebook at the same time creates a mess — one crossing out what the other just wrote, contradictory notes in the margins. The coordinator pattern is the designated note-taker: everyone submits their observation to the coordinator, who consolidates and writes once. This serializes writes, deduplicates redundant entries, and prevents contradictory memory from forming in the first place rather than cleaning it up afterward.
Full explanation below image
Full Explanation
Shared memory consistency in multi-agent systems is a distributed write coordination problem. The solutions fall into two categories: prevent conflicts at write time (preferred) or resolve them at read time (less reliable).
Option A (free writes, newer overwrites older) creates semantic conflicts that are not always detectable by simple recency. If Agent A writes 'Repository X uses PostgreSQL' and Agent B writes 'Repository X uses MySQL' (because it observed a migration in progress), the later write does not represent ground truth — it represents one agent's observation at a moment in time. Vector stores do not automatically understand that these entries are about the same fact and that one should supersede the other.
Option B is correct. The coordinator pattern serializes all writes through a single logical writer: (1) Agent instances submit write requests to the coordinator with the proposed memory entry and a description of what it is about. (2) The coordinator checks whether a semantically similar entry already exists. If so, it can merge the new observation with the existing entry (updating the content and adding a timestamp) rather than creating a duplicate. (3) Writes are serialized — only one write is processed at a time, preventing simultaneous conflicting writes. (4) The coordinator owns the consistency model, deciding whether a new entry should update an existing entry, coexist alongside it, or be rejected as redundant. This is the same pattern as a database write coordinator or a distributed log leader.
Option C (per-instance namespaces with daily merge) delays conflicts rather than preventing them. During the merge, you still have to resolve which entry is correct when both namespaces have entries about the same topic. The merge problem is the consistency problem deferred.
Option D (deduplication at read time) does not prevent conflicting entries from existing in the store — it attempts to hide the conflict from the agent at retrieval time. Semantic similarity deduplication is imperfect and may remove entries that appear similar but represent genuinely different observations. The underlying store remains inconsistent.