MELD: A Protocol for Merging Knowledge Across Distributed Agentic Memories
Authors: Lauri Lovén, Jaakko Sauvola, Jukka Riekki, Sasu Tarkoma
Organizations: Future Computing Group, University of Oulu, Finland · University of Oulu, Finland · University of Helsinki and University of Oulu, Finland
Autonomous agents share a transport and can call each other's tools, but they cannot share what they know: no protocol lets two agents' memories reconcile a fact phrased two ways, link related facts held apart, or reconcile contradictory knowledge without silently discarding either claim. We present MELD, a self-managing coherence mechanism for a federation of agent memories whose run-time model is the knowledge graph itself. Each brain admits every incoming claim through a five-outcome procedure (insert, merge, relate, conflict, or reject), decided from three signals (scoped claim-key identity, embedding similarity, and a natural-language-inference verdict) under context and freshness gates, and acting through exactly one auditable, authenticated Patch, the only object that mutates state. A binding onto standard publish/subscribe transport with a per-claim status CRDT keeps sovereign brains coherent in claim status without a coordinator: self-healing after partitions and under lossy routing, and self-protecting against silent rewrite by a peer, under a benign-fault model. MELD does not adjudicate truth; a detected contradiction is preserved for later adjudication, never silently resolved. On HotpotQA distractor, distributed merge is recall-non-inferior to a centralized store under a pre-specified equivalence test and recall-superior to naive union at about 11% less live storage; the merge classifier separates at AUC 0.968 with a 0.013 false-merge rate on adjudicated candidate pairs; the status CRDT reconverges in 30/30 real partition-heal trials where last-writer-wins manages 11/30; and semantic routing delivers about 3x fewer messages at matched recall. We evaluate on a real computing continuum spanning an operator-grade 5G edge, national HPC, and a local tier, with empirically calibrated thresholds.
Figures & tables
Figure 1. MELD at a glance. Top: a shared transport lets capabilities cross (e.g. via MCP), but the same fact stored two ways stays unreconciled. Bottom: each brain merges on receive: it senses three signals ( κ scoped claim-key, σ similarity, χ inference), decides among same-enough, overlaps, conflicts, or insert (novel), and acts by one auditable Patch, the only object that mutates state (tabulated in the electronic supplement, Appendix N).
Figure 2. Running example as a sequence trace (threaded through Sections 3 – 5 ); it instantiates the hybrid, cross-administrative-boundary deployment of Section 9.3 . Two admin domains (US, EU) each run a domain aggregate and peer across the dashed boundary. Four reasons make the brains differ, each driving one mechanism: locality (each tier ingests its own source), data minimization (a privacy-relevant property, not a guarantee: only a claim crosses the wire, never the customer data, message 1), sovereignty (the Context gate keeps the US rule related, not fused when the US aggregate peers across the boundary, even at identical similarity; the scope is part of the claim key, so the two are not even key-identical, Section 4.1 ; message 2, the one arrow that crosses), and latency/partition (the status CRDT converges c2 to overruled regardless of delivery order, message 4). Receiver B runs the decision procedure on each delta and emits exactly one Patch. The overrule (accent) is applied because it carries a MAC under the federation group key (asserted origin: EU authority C ) and stays within the domain; a US-origin overrule of an EU claim would append but never materialize (the authorization predicate, Section 5 ). All signal values reproduce from the reference implementation.
Figure 3. The merge decision procedure, a first-match cascade over five outcomes. The signals κ,σ,χ are read on the adjudicated candidate pair (a second pair is read only when the gate-aware fallback of Section 4.2 fires); a delta whose MAC fails verification, or is stale or overruled, is dropped before any semantic test. A claim with no candidate at or above the relatedness floor is novel and insert ed; reject is the admission gate alone, never “no match found”. Contradiction is tested next, so a contradicting pair is conflict , not relate . Same-enough is then a hierarchy: claim-key identity in a compatible frame ( κ=1∧Context≈ ) decides first, else similarity σ≥θmerge gated by Context and authority. Anything remaining relate s; every path emits exactly one Patch, the only object that mutates local state.
Figure 4. Recall under decentralized merge (HotpotQA distractor; N=200 /condition/model; k=5 , overlap 0.5 , N=3 brains, all-MiniLM-L6-v2). Distributed merge matches the centralized store on recall@ 5 (two one-sided-test equivalence, Δ=0.05 ) and exceeds naive union ( +0.035 , CI excluding zero) at ≈11% fewer live units. recall@ k is a store/encoder property, hence identical across all five models (text).
Figure 5. Sync-latency surface: p50 publish-to-merge latency vs added one-way RTT, one line per (routing × fan-out N ), N∈{3,4} ; error bars are 95% bootstrap CIs (HotpotQA, 15 seeds/cell). Semantic routing (solid) stays low and falls as N grows, where broadcast (dashed) rises with N . The N=2 cells are omitted from this figure: they spike under WAN in both modes, an emulation artifact (netem queueing on the low-fan-out replication- 2 workload, without the replication-factor control that would isolate it) rather than an MELD property, and no claim rests on them. They are reported, with this confound named, in the electronic supplement’s exact-values table (Appendix H) for completeness only.
Routing ( n=180 /arm)
Mode
Wasted-delivery
Recall
Deltas/cell
Broadcast
≈2/3 (by constr.)
1.000
585
Semantic
0.003 [0.003, 0.004]
0.997
195
Convergence (partition heal, n=30 seeds)
Baseline
Reconverges
Healed agreement
Status-CRDT
30/30=1.000
1.000 [1.000, 1.000]
Table 1. Distributed-protocol results: routing and convergence. Top: routing ablation ( n=180 cells per arm): semantic routing delivers ∼3× fewer deltas per cell at matched merge recall, for a measured wasted-delivery rate of 0.003 ; a routing-free broadcast wastes ≈2/3 by construction on this workload (Section 7.5 ). Bottom: partition-heal convergence ( n=30 seeds): the status CRDT reconverges on all trials to full healed agreement, while last-writer-wins reconverges on a minority and stays split. Bracketed values are 95% bootstrap CIs.
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
Probe (size)
MELD
Ablated / baseline
Conflict representation and authority
contradiction flagging
100% CONTRADICTS
auto-merge: 0%
authority tie-break
picks canonical †
recency-only
Gate necessity: each gate necessary (distinct-key, same-scope probes)
Context, cross-frame ( 1 )
RELATE
drop → false MERGE
inference, contradiction ( 1 )
CONFLICT
drop → false MERGE
Appendix
Table 2. Consolidated ablations: deterministic, model-free checks on small constructed probes. Each row reports what a mechanism does on a probe built to need it, against the ablated or baseline alternative. These are necessity and invariant demonstrations, not error rates over a distribution (the measured false-merge rate is the main paper’s merge-classification result, Section 7.2).
Trial
Diverged first
Reconverged
Heal (ms)
1
yes
yes
2147.1
2
yes
yes
3007.5
3
yes
yes
2135.4
4
yes
yes
2989.9
5
yes
yes
2145.7
6
yes
yes
2993.1
Appendix
Table 3. Per-trial cross-tier partition-heal over the real Kafka WAN (laptop + CSC HPC + 5GTN edge). Every trial diverged under the partition and reconverged after the heal; heal latency is the link-restoration-to-reconvergence time.
Condition
recall@5
recall@10
recall@20
Centralized
0.575
0.731
0.794
Distributed merge
0.675
0.806
0.881
Naive union
0.650
0.806
0.894
Exact-dedup
0.650
0.806
0.894
live units: merge 363 central 375 union/dedup 488
Appendix
Table 4. Second-substrate recall on LongMemEval ( n=40 , overlap 0 , all-MiniLM-L6-v2; mean recall@ k / mean live units). Distributed merge is recall-non-inferior to centralized at every k and holds ≈26% fewer live units than union; exact-dedup tracks union, so the compaction is semantic.
N
recall
semantic deliv/claim
broadcast deliv/claim
broadcast/semantic
2
1.000
1.0
2
2×
4
1.000
1.0
4
4×
8
1.000
1.0
8
8×
16
1.000
1.0
16
16×
32
1.000
1.0
32
32×
64
1.000
1.0
64
64×
Appendix
Table 5. Node-scaling of sync overhead (representative N ; full set {2,3,4,6,8,12,16,24,32,48,64,96,128} in scale-sweep.json ). Semantic deliveries per claim are flat in N at routing recall 1.000 ; broadcast grows as N , so the overhead ratio is linear in cluster size.
Figure 6. MELD scaling, side by side. (a) sink throughput vs offered claim rate: achieved throughput tracks the ideal (grey dashed) to a knee at ≈54 merges/s, then saturates. (b) per-claim sync overhead vs cluster size N (log–log): semantic routing is O(1) (flat) where broadcast is O(N) (unit slope; the sweep of this appendix). (c) sink live-store vs N (log–log): merge-on-receive is O(1) (flat at the 26 -fact corpus) where naive union is O(N) (Appendix G).
N
merge live units
union live units
1
26
26
2
26
52
8
26
208
32
26
832
128
26
3328
Appendix
Table 6. Sink state-load vs cluster size (corpus =26 novel facts; full set in sink-load.json ). The merge sink stays corpus-sized for all N ; naive union grows as N .
Routing
RTT (ms)
N=2
N=3
N=4
Broadcast
0
36.0 [32.8, 42.2]
57.1 [56.7, 57.7]
80.0 [79.5, 80.5]
10
74.6 [74.3, 75.0]
76.7 [76.4, 77.1]
100.9 [100.3, 101.5]
25
134.8 [134.5, 135.1]
108.1 [107.4, 108.8]
130.8 [130.2, 131.4]
50
234.7 [234.5, 235.0]
157.3 [156.7, 158.0]
179.2 [178.6, 179.9]
Semantic
0
10.4 [10.3, 10.6]
8.4 [8.2, 8.7]
7.2 [7.1, 7.4]
10
52.4 [52.2, 52.6]
20.1 [16.3, 23.8]
8.8 [8.6, 9.1]
Appendix
Table 7. Sync-latency surface: p50 publish-to-merge latency (ms) by added one-way RTT and fan-out N , per routing mode ( 95% bootstrap CIs in brackets).
Experiment
Dataset(s)
Tier
Headline result
Distributed-vs-centralized merge (headline)
HotpotQA distractor; LongMemEval
CSC / sim
Recall non-inferior to centralized ( 0.630 vs 0.619 ); +0.035 vs naive union at ≈11% less live storage
Merge holds recall flat as overlap rises where union degrades; exact-dedup tracks union, so the win is semantic
Classifier robustness & signal generality
104 -pair gold
local
Macro-F1 0.845→0.684 (embedding noise) / 0.653 ( 50% NLI corruption), false-merge ≤0.049 throughout; across six encoder × NLI pairings macro-F1 0.765 – 0.845 , with the NLI (not the encoder) setting the false-merge rate
Sync latency & fan-out
HotpotQA workload
5GTN (multi-host)
p50 flat-to-falling in N (semantic) vs O(N) broadcast
Saturation throughput
HotpotQA workload
edge / local
Single-sink knee ≈54 merges/s (compute-bound)
Appendix
Table 8. Experiment inventory for MELD. Datasets and tiers as used here; “sim” = multi-process single host; “5GTN” = University of Oulu 5G test-network edge; “CSC” = Finnish national HPC.
Loss
No-digest agree.
(distinct maps)
With-digest agree.
Links repaired
0.000
1.000
1
1.000
0.0
0.003
0.967
3
1.000
1.4
0.010
0.850
4
1.000
4.2
0.050
0.433
9
1.000
21.6
0.100
0.117
12
1.000
45.6
Appendix
Table 9. Anti-entropy under independent per-delivery loss ( 12 brains, 24 claims, 168 links; seeds 0 – 4 ). Without the digest, per-claim agreement falls and the federation fragments; with periodic reconciliation it is 1.000 throughout, in one round.
Nlocal
Scan median (ms)
Scan p95 (ms)
NLI residual, matched (ms)
16
0.089
0.101
11.99
64
0.282
0.323
11.72
256
1.024
1.176
12.15
1,024
3.925
4.269
13.24
4,096
15.591
17.550
16.63
Appendix
Table 10. Claim-count scaling of candidate selection ( K=200 incoming claims per store size, seed 0 , dense rung). Candidate-set size scanned equals Nlocal by construction; scan latency grows linearly ( 3.80 ms/ 1 k claims); the NLI-dominated residual (matched deltas, the rest of the per-delta call) stays flat, so the two curves cross once the scan reaches the residual’s scale.
Figure 7. The layer stack and the deployment topology. Left: MELD is the new protocol layer over a public typed-link agent-memory substrate (Zep/Graphiti, A-MEM), with its status convergence resting on standard CRDT theory; both foundations are public/standard, and only the protocol layer, drawn dark, is new. Right: harnesses (execution), agents (task logic), and agent brains (knowledge) are kept distinct; many agent brains PUBLISH graph deltas, content-routed over a pub/sub fabric, into a platform global brain, whose sink is the merge procedure, not an opaque aggregator. It runs the same procedure as any brain and holds no special authority; the federation converges without it. On a harness, the agent speaks MCP to tools and MELD to brains.
Control element
In MELD
Monitored state
an incoming graph delta versus the held claim it candidate-matches
Uncertainty
embedding similarity σ and an NLI contradiction verdict χ (reliability-bounded)
one authenticated Patch , the sole object that mutates local state
Invariant
a detected contradiction is never silently merged; per-claim status is strong-eventually-consistent; a canonical brain is not silently rewritten
Failure model
benign-fault (crash, partition, reorder, loss, stale/overruled deltas); not Byzantine
Appendix
Table 11. MELD as a self-managing control loop: one authenticated Patch is the only state mutation. Self-managing, not self-optimizing (thresholds calibrated offline).