A Conflict-Free Replicated Data Type (CRDT) is a data structure designed for distributed systems that can be updated concurrently by multiple agents without coordination, and whose state can always be merged deterministically. This property of strong eventual consistency ensures all replicas converge to the same value once they have all received the same set of updates, making CRDTs ideal for collaborative applications, distributed databases, and multi-agent system memory where low-latency writes are critical.
Glossary
Conflict-Free Replicated Data Type (CRDT)

What is a Conflict-Free Replicated Data Type (CRDT)?
A foundational data structure for building eventually consistent, coordination-free systems.
CRDTs achieve this through mathematical properties of commutativity, associativity, and idempotence in their merge operations. Common types include state-based CRDTs (CvRDTs), which exchange and merge full states, and operation-based CRDTs (CmRDTs), which broadcast and apply idempotent operations. They are a core alternative to consensus protocols like Raft or Paxos for scenarios where availability and partition tolerance are prioritized over strong, immediate consistency.
Key Properties of CRDTs
Conflict-Free Replicated Data Types (CRDTs) are data structures designed for distributed, coordination-free collaboration. Their core properties enable deterministic state convergence across replicas, making them ideal for collaborative applications, distributed databases, and multi-agent systems.
Eventual Consistency Guarantee
CRDTs provide a formal guarantee of eventual consistency. All replicas that have processed the same set of operations (potentially in different orders) will converge to the same final state, without requiring synchronous coordination or a central authority. This is achieved through commutative operations and idempotent delivery.
- Convergence: The system is guaranteed to reach a consistent state.
- Strong Eventual Consistency (SEC): A stronger guarantee that all correct replicas that have delivered the same updates have equivalent state.
Commutativity & Idempotence
The mathematical foundation of CRDTs lies in operations that are commutative (order-independent) and idempotent (repeatable without changing the result). This allows updates to be applied in any order across different replicas.
- Commutative Example: In a G-Counter (Grow-only Counter), two
increment()operations commute; the final count is the same regardless of application order. - Idempotent Example: A
set('value')operation to the same state is idempotent; receiving it multiple times doesn't alter the result.
These properties ensure that merge functions are deterministic and conflict-free.
Operation-Based vs. State-Based
CRDTs are implemented in two primary forms, each with different network semantics.
- Operation-Based CRDTs (CmRDTs): Replicas propagate operations (e.g.,
add(element)). Requires a reliable, ordered broadcast for correctness under concurrent updates. - State-Based CRDTs (CvRDTs): Replicas periodically exchange their full state and merge it using a join semilattice function (monotonic). More robust to message loss but can have higher bandwidth overhead.
The choice depends on network reliability and the nature of the data being synchronized.
Monotonic Semilattice
State-based CRDTs (CvRDTs) are modeled as a join semilattice. This is a partially ordered set where every pair of elements has a least upper bound (LUB), which serves as the merge function.
- Monotonic Growth: The state of a replica only moves "upward" in the lattice as it receives updates; it never regresses.
- Merge as LUB: The merge of two states
AandBproduces a new stateC = A ⊔ Bthat is the smallest state greater than or equal to bothAandB. This guarantees convergence.
Common examples include G-Sets (Grow-only Set) and PN-Counters (Positive-Negative Counter).
Causality Preservation
While CRDTs do not require operational ordering, many are designed to implicitly preserve causal relationships. This means if operation A happened before operation B on one replica, no other replica will see B before seeing A.
- Version Vectors / Dots: Used to track causality per replica. A Dot is a pair
(replica_id, sequence_number)uniquely identifying an operation. - Observed-Remove Set (OR-Set): Uses dots to correctly handle
addandremoveoperations, ensuring an element added after its removal is correctly present. This prevents the "lost update" problem common in naive sets.
Use Cases in Multi-Agent Systems
CRDTs are a foundational technology for shared state in decentralized, multi-agent architectures.
- Collaborative Editing: The canonical example, as seen in tools like Automerge or Yjs, where multiple users edit a document concurrently.
- Distributed Agent State: Agents operating on different nodes can maintain a shared, eventually consistent view of the world (e.g., a shared task board, inventory, or belief state) without a central database.
- Conflict-Free Configuration: Managing dynamic configuration or feature flags across a fleet of autonomous agents.
- Offline-First Agent Operation: Agents can continue operating with local state while disconnected, merging changes seamlessly upon reconnection.
How Do CRDTs Work?
Conflict-Free Replicated Data Types (CRDTs) are foundational data structures enabling decentralized, coordination-free state synchronization for distributed systems like multi-agent networks.
A Conflict-Free Replicated Data Type (CRDT) is a data structure designed for distributed systems that can be updated concurrently by multiple agents without coordination, and whose state can always be merged deterministically. This is achieved through mathematical properties of commutativity, associativity, and idempotence in its operations, ensuring all replicas converge to the same value. CRDTs are classified as either state-based (convergent) or operation-based (commutative).
In a state-based CRDT, each node maintains its full state. Nodes periodically exchange their entire state, and the receiving node merges the incoming state with its own using a deterministic merge function that computes the least upper bound of the two states, guaranteeing convergence. Operation-based CRDTs disseminate the operations themselves, which must be designed to be commutative, ensuring they can be applied in any order. This makes CRDTs ideal for eventual consistency models in collaborative editing, distributed counters, and agentic memory systems.
Common CRDT Examples and Use Cases
CRDTs are categorized by their underlying mathematical properties. The primary distinction is between state-based (CvRDTs) and operation-based (CmRDTs), each with specific data types designed for concurrent, conflict-free updates.
G-Counter (Grow-only Counter)
A state-based CRDT that supports only increment operations. Each replica maintains a vector of counts, one per replica. The merge function takes the element-wise maximum. This ensures the counter only grows and converges to the sum of all increments across all replicas, regardless of order.
- Use Case: Tracking 'like' counts, view counts, or any monotonic metric in a distributed system where counts can only increase.
PN-Counter (Positive-Negative Counter)
A state-based CRDT that supports both increment and decrement operations. It is implemented as two G-Counters: one for increments (P) and one for decrements (N). The total value is calculated as sum(P) - sum(N). Merging involves merging the corresponding P and N vectors independently.
- Use Case: Maintaining a distributed tally that can go up or down, such as inventory stock levels, voting scores, or bank account balances (in a simplified model).
G-Set (Grow-only Set)
The simplest set CRDT, which only supports add operations. Since elements are never removed, the merge operation is a simple union of all sets from all replicas. This trivially converges to the set of all ever-added elements.
- Use Case: Building an immutable, append-only log of events or collecting a deduplicated list of user IDs that performed an action.
2P-Set (Two-Phase Set)
A set that supports both add and remove operations, but with a key restriction: an element, once removed, can never be added again. It is implemented using two G-Sets: a set for adds (A) and a set for removals (R). An element is present if it is in A and not in R.
- Use Case: Use cases where a 'tombstone' is permanent, such as banning a user ID from a system or deleting a unique key that must not be reused.
OR-Set (Observed-Removed Set)
Also called an Add-Wins Set, this is the most commonly used set CRDT for practical applications. It supports adds and removes where adds take precedence over concurrent removes. Each element is tagged with a unique identifier (e.g., a replica ID and timestamp). To remove an element, all its observed tags are added to a tombstone set. An element is present if it has at least one tag not in the tombstone set.
- Use Case: Collaborative document editing (e.g., a shared list of items), real-time to-do lists, or maintaining a shared set of active sessions.
LWW-Register (Last-Write-Wins Register)
A state-based CRDT that holds a single value (e.g., a string, number, or JSON blob). Each update is paired with a timestamp (or a logical clock). The merge function picks the state associated with the highest timestamp, resolving conflicts by arbitrary but deterministic rule (e.g., replica ID tie-breaker).
- Use Case: Storing user profile fields (name, bio), configuration settings, or any value where a simple 'latest update wins' policy is acceptable. It's simple but can lose updates if clocks are skewed.
Multi-Value Register (MV-Register)
Also known as a Conflict-free Replicated Data Register, this is a more advanced alternative to LWW-Register. Instead of picking one value, it preserves all concurrently written values as a set. The merge result is the set of all values not causally dominated by another.
- Use Case: Capturing true concurrency without silent data loss. For example, if two users simultaneously edit the same field, the system can surface both values for manual resolution, rather than arbitrarily picking one.
CRDTs in Collaborative Editing
CRDTs are the foundational data structure behind real-time collaborative applications like Google Docs or Figma. They enable lock-free, concurrent editing of shared documents, lists, or canvases. Each user's edits are applied locally immediately (for low latency) and then asynchronously synced. CRDT merge functions ensure all replicas converge to the same final state.
- Key Benefit: Provides strong eventual consistency and an excellent user experience without centralized coordination or locking.
CRDTs in Multi-Agent Systems
In multi-agent systems, CRDTs provide a robust shared memory fabric for agents operating with partial connectivity or asynchronously. Each agent can maintain a local replica of shared state (e.g., a world model, task assignments, or a blackboard). Agents update their local replica based on perception or reasoning, and the CRDT merge function integrates these updates across the agent network.
- Key Benefit: Enables eventually consistent shared state without requiring all agents to be online simultaneously or imposing a single point of coordination, making the system highly resilient and scalable.
Frequently Asked Questions About CRDTs
Conflict-Free Replicated Data Types (CRDTs) are foundational data structures for building robust, coordination-free memory in distributed and multi-agent systems. This FAQ addresses their core principles, types, and practical applications.
A Conflict-Free Replicated Data Type (CRDT) is a data structure designed for distributed systems that can be updated concurrently by multiple agents without coordination, and whose state can always be merged deterministically. It works by ensuring that all operations are commutative (order-independent), associative (grouping-independent), and idempotent (duplicate-operation-safe). This mathematical property guarantees that any two replicas of the data, after applying any sequence of updates, can be merged into an identical final state using a predefined merge function. Common implementations include counters, sets, registers, and sequences, which are essential for collaborative editing, real-time synchronization, and agentic state management.
CRDTs vs. Traditional Consistency Approaches
A comparison of Conflict-Free Replicated Data Types (CRDTs) with traditional distributed consistency models, highlighting their fundamental trade-offs in availability, coordination, and conflict resolution for multi-agent memory systems.
| Feature / Property | Conflict-Free Replicated Data Types (CRDTs) | Strong Consistency (e.g., Linearizability) | Eventual Consistency (e.g., Optimistic Replication) |
|---|---|---|---|
Core Design Philosophy | Conflict-free by construction; state-based or operation-based | Single-copy serializability; appears as a single, up-to-date system | Convergence guarantee; replicas become consistent over time |
Coordination Required for Writes | |||
Availability During Network Partitions | |||
Guaranteed Read-After-Write Consistency | |||
Conflict Resolution Mechanism | Automatic, deterministic merge function | Prevention via coordination (e.g., locks, consensus) | Application-level or last-writer-wins (often manual) |
Typical Latency for Writes | < 1 ms (local) | 10-100+ ms (coordination cost) | < 1 ms (local) |
Data Convergence Guarantee | Strong Eventual Consistency (SEC) | Immediate Consistency | Eventual Consistency (no bound) |
Suitability for Multi-Agent Collaboration | |||
Implementation Complexity | High (designing merge semantics) | Medium (managing coordination) | Medium (handling conflicts manually) |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms in Distributed Systems & Agentic Memory
CRDTs are a foundational component for building eventually consistent, coordination-free systems. Understanding related concepts is crucial for designing robust multi-agent memory architectures.
Eventual Consistency
A consistency model that guarantees if no new updates are made to a data item, all reads will eventually return the last updated value. It prioritizes high availability and partition tolerance over immediate synchronization, making it ideal for distributed systems like CRDTs. For example, a collaborative document edited by two users will eventually show the same text on both screens, even if they were briefly offline.
- Key Property: Does not guarantee read-after-write consistency.
- Use Case: The underlying guarantee for CRDT-based systems, social media feeds, and DNS.
Operational Transformation (OT)
A concurrency control technique used in real-time collaborative editing (e.g., Google Docs). It transforms editing operations (like insert or delete) so they can be applied in any order while preserving intent. Unlike state-based CRDTs that merge final states, OT merges the operations themselves.
- Core Challenge: Requires a central server or complex logic to manage operation history and transformation rules.
- Comparison to CRDTs: OT often requires more coordination but can be more bandwidth-efficient for certain text-editing scenarios.
Version Vector
A data structure used to track causality between different versions of an object replicated across nodes. Each node maintains a counter for its own updates. By comparing vectors, a system can determine if versions are concurrent (diverged) or if one is a descendant of another.
- Function: Enables causal consistency models.
- Relation to CRDTs: Often used internally by CRDTs (especially operation-based CRDTs) to tag operations and understand partial order, aiding in conflict detection and resolution.
Conflict Resolution
The general process of reconciling divergent data states resulting from concurrent updates. CRDTs provide automatic, deterministic conflict resolution through their merge function (e.g., last-writer-wins for registers, union for sets). Other strategies include:
- Manual Merge: Requiring user intervention.
- Application-specific Logic: Using domain rules to decide the correct outcome.
- Pessimistic Locking: Preventing conflicts by allowing only one writer at a time. CRDTs embody a form of optimistic replication, allowing writes anywhere and resolving conflicts later.
Gossip Protocol
A peer-to-peer communication pattern where nodes periodically exchange state information with a randomly selected set of peers. This epidemic style of communication is highly fault-tolerant and efficiently propagates updates (like CRDT state changes) throughout a cluster without a central coordinator.
- Key Property: Provides robust eventual dissemination of information.
- Use with CRDTs: A common transport layer for propagating CRDT updates or entire states between nodes in a decentralized system, ensuring all replicas eventually converge.
State vs. Operation-Based CRDTs
The two primary design families for CRDTs:
- State-based (CvRDTs): Replicas periodically send their full state to other replicas. The receiving replica merges states using a commutative, associative, and idempotent join function (e.g., a monotonic lattice). Higher bandwidth, simpler logic.
- Operation-based (CmRDTs): Replicas propagate operations (e.g.,
add(element)). Operations must be delivered exactly once and in an order that respects causality. Lower bandwidth, requires reliable broadcast.
Both guarantee strong eventual consistency but have different trade-offs in network usage and implementation complexity.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us