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
If two agents scribble in the same notebook at the same time, you get a mess. Make one memory coordinator the only writer, then have the other agents submit write requests to it. That serializes writes, dedupes duplicates, and stops contradictory memory before it lands.
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).
The coordinator pattern is correct. It serializes all writes through a single logical writer: agent instances submit write requests to the coordinator with the proposed memory entry and a description of what it is about. 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. Writes are serialized, so only one write is processed at a time, preventing simultaneous conflicting writes. 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.
Allowing both instances to write freely and relying on newer entries overwriting older entries when similar entries are retrieved creates semantic conflicts that are not always detectable by simple recency. If one instance writes 'Repository X uses PostgreSQL' and another 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.
Partitioning the memory store so each agent instance writes to its own exclusive namespace and merging namespaces once daily 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.
Using vector similarity 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.