PACMI: Provenance-Aware Cascading Memory Invalidation for Long-Term LLM Agents
Organizations: University of Southern Queensland · Southern University of Science and Technology · Jiangsu University · The University of Sydney · Uploading Inc.
Abstract
LLM agents rely on long-term memory to retain and reuse information when performing tasks over long horizons. Existing methods provide limited support for handling memories that become outdated as new observations or domain evidence arrive. Such outdated memories may remain semantically relevant, continue to affect dependent records, and retain value as historical evidence. This calls for two capabilities: dependency tracking to identify downstream effects and historical preservation to retain useful past records. We propose Provenance-Aware Cascading Memory Invalidation (PACMI), a framework that represents memories and new evidence in a provenance graph with typed dependency edges. PACMI assigns records to a four-state validity lattice, propagates validity changes to dependent memories, and uses the resulting states for retrieval and stale-premise detection. We also introduce a diagnostic benchmark with 100 cases and 300 queries across five domains. The evaluation separates node, context-, and answer-level performance. PACMI achieves the highest final-answer accuracy on this benchmark, and its paired difference from the strongest baseline is significant under an exact McNemar test. The premise checker achieves perfect precision, recall, and F 1 on the controlled query distribution. Cascading propagation primarily improves memorystate correctness: removing it increases final-answer errors from 3 to 11, but the paired difference does not reach the 0.05 significance threshold. Code and data will be made publicly available.
Figures & tables
| Node identification | Context | Accuracy by query type | Answer level | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Method | DR | AR | UI | OI | SIC | CVER | Q1 | Q2 | Q3 | Final | Reuse |
| Vector RAG | – | – | – | – | 0.53 | 0.58 | 0.95 | 0.28 | 1.00 | 0.74 | 0.10 |
| Recency-RAG | – | – | – | – | 0.47 | 0.66 | 1.00 | 0.39 | 0.95 | 0.78 | 0.04 |
| LLM-Only Update | 1.00 | – | 0.68 | 0.00 | 0.49 | 0.64 | 1.00 | 0.47 | 0.42 | 0.63 | 0.03 |
| CUPMem-style | 0.93 | – | 1.00 | 0.00 | 0.40 | 0.76 | 0.97 | 0.43 | 1.00 | 0.80 | 0.03 |
| A-MEM-style | – | – | – | – | 0.47 | 0.88 | 1.00 | 0.71 | 1.00 | 0.90 | 0.00 |
| Variant | AR | UI | SIC | Acc | Prem. | Hist. |
|---|---|---|---|---|---|---|
| PACMI | 1.00 | 0.00 | 0.34 | 0.99 | 1.00 | 1.00 |
| w/o Provenance | 0.00 | 1.00 | 0.37 | 0.97 | 0.98 | 1.00 |
| w/o Cascade | 0.00 | 1.00 | 0.41 | 0.96 | 0.98 | 0.99 |
| w/o Validity States | 1.00 | 0.00 | 0.56 | 0.97 | 0.98 | 1.00 |
| w/o Premise Check | 1.00 | 0.00 | 0.34 | 0.83 | 0.80 | 1.00 |
| w/o Hist. Preserv. | 1.00 | 0.00 | 0.20 | 0.77 | 0.99 | 0.36 |
| Method | Per update | Per query | Total |
|---|---|---|---|
| Vector RAG | 0 | 0 | 0 |
| Recency-RAG | 0 | 0 | 0 |
| LLM-Only Update | 1 | 0 | 100 |
| CUPMem-style | 1 | 0 | 100 |
| A-MEM-style | 1 | 0 | 100 |
| PACMI | 1 | 400 |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Domain | Cases | Old Mem. | New Evid. | Queries | Affected |
|---|---|---|---|---|---|
| Personal Profile | 20 | 120 | 20 | 60 | 40 |
| Location & Preference | 20 | 120 | 20 | 60 | 40 |
| Work & Project | 20 | 120 | 20 | 60 | 40 |
| Finance & Recommendation | 20 | 120 | 20 | 60 | 40 |
| Tool / Workflow State | 20 | 120 | 20 | 60 | 40 |
| Total | 100 | 600 | 100 | 300 | 200 |
| Method | Parameter | Value |
|---|---|---|
| PACMI, Vector RAG, Recency-RAG, | top- (final context) | 5 |
| LLM-Only Update, CUPMem-style | ||
| A-MEM-style | seed top- | 5 |
| A-MEM-style | maximum expanded context | 8 |
| Recency-RAG | similarity weight | 0.7 |
| Recency-RAG | recency weight | 0.3 |
| TP | FP | FN | TN | Prec. | Rec. | |
|---|---|---|---|---|---|---|
| 100 | 0 | 0 | 200 | 1.000 | 1.000 | 1.000 |
| Method | DR | AR | UI | OI | SIC | CVER |
|---|---|---|---|---|---|---|
| Vector RAG | – | – | – | – | 0.534 [0.520, 0.548] | 0.583 [0.565, 0.600] |
| Recency-RAG | – | – | – | – | 0.473 [0.456, 0.489] | 0.659 [0.639, 0.680] |
| LLM-Only Update | 1.000 [1.000, 1.000] | – | 0.680 [0.590, 0.770] | 0.000 [0.000, 0.000] | 0.487 [0.468, 0.505] | 0.641 [0.619, 0.665] |
| CUPMem-style | 0.930 [0.870, 0.980] | – | 1.000 [1.000, 1.000] | 0.000 [0.000, 0.000] | 0.396 [0.385, 0.407] | 0.755 [0.741, 0.769] |
| A-MEM-style | – | – | – | – | 0.467 [0.455, 0.479] | 0.882 [0.848, 0.916] |
| PACMI | 1.000 [1.000, 1.000] | 1.000 [1.000, 1.000] | 0.000 [0.000, 0.000] | 0.000 [0.000, 0.000] | 0.338 [0.320, 0.355] | 0.828 [0.806, 0.850] |
| Method | Q1 Accuracy | Q2 Accuracy | Q3 Accuracy | Final Accuracy | Stale Reuse |
|---|---|---|---|---|---|
| Vector RAG | 0.950 [0.900, 0.990] | 0.280 [0.190, 0.370] | 1.000 [1.000, 1.000] | 0.743 [0.710, 0.777] | 0.100 [0.070, 0.133] |
| Recency-RAG | 1.000 [1.000, 1.000] | 0.390 [0.290, 0.490] | 0.950 [0.900, 0.990] | 0.780 [0.743, 0.817] | 0.040 [0.020, 0.063] |
| LLM-Only Update | 1.000 [1.000, 1.000] | 0.470 [0.370, 0.570] | 0.420 [0.320, 0.520] | 0.630 [0.580, 0.680] | 0.027 [0.010, 0.047] |
| CUPMem-style | 0.970 [0.930, 1.000] | 0.430 [0.330, 0.530] | 1.000 [1.000, 1.000] | 0.800 [0.767, 0.837] | 0.033 [0.013, 0.057] |
| A-MEM-style | 1.000 [1.000, 1.000] | 0.710 [0.620, 0.800] | 1.000 [1.000, 1.000] | 0.903 [0.873, 0.933] | 0.003 [0.000, 0.010] |
| PACMI | 1.000 [1.000, 1.000] | 0.970 [0.930, 1.000] | 1.000 [1.000, 1.000] | 0.990 [0.977, 1.000] | 0.000 [0.000, 0.000] |
| Variant | Affected Recall | Under-Invalidation | Stale-in-Context | Final Accuracy | Premise Resistance | Historical Preservation |
|---|---|---|---|---|---|---|
| PACMI | 1.000 [1.000, 1.000] | 0.000 [0.000, 0.000] | 0.338 [0.320, 0.355] | 0.990 [0.977, 1.000] | 1.000 [1.000, 1.000] | 1.000 [1.000, 1.000] |
| w/o Provenance Graph | 0.000 [0.000, 0.000] | 1.000 [1.000, 1.000] | 0.369 [0.351, 0.387] | 0.970 [0.950, 0.987] | 0.980 [0.950, 1.000] | 1.000 [1.000, 1.000] |
| w/o Cascading Invalidation | 0.000 [0.000, 0.000] | 1.000 [1.000, 1.000] | 0.413 [0.399, 0.426] | 0.963 [0.940, 0.983] | 0.980 [0.950, 1.000] | 0.990 [0.970, 1.000] |
| w/o Validity States | 1.000 [1.000, 1.000] | 0.000 [0.000, 0.000] | 0.561 [0.549, 0.572] | 0.970 [0.947, 0.990] | 0.980 [0.950, 1.000] | 1.000 [1.000, 1.000] |
| w/o Premise Checking | 1.000 [1.000, 1.000] | 0.000 [0.000, 0.000] | 0.338 [0.320, 0.355] | 0.833 [0.800, 0.867] | 0.800 [0.720, 0.870] | 1.000 [1.000, 1.000] |
| w/o Historical Preservation | 1.000 [1.000, 1.000] | 0.000 [0.000, 0.000] | 0.200 [0.200, 0.200] | 0.767 [0.733, 0.800] | 0.990 [0.970, 1.000] | 0.360 [0.270, 0.460] |
| Comparison | Scope | Errors | Discordant | Exact | |
|---|---|---|---|---|---|
| PACMI vs A-MEM-style | Q1+Q2+Q3 | 3 / 29 | 29 / 3 | yes | |
| PACMI vs w/o Cascading Invalidation | Q1+Q2+Q3 | 3 / 11 | 11 / 3 | 0.057373 | no |
| PACMI vs w/o Premise Checking | Q2 | 3 / 50 | 48 / 1 | yes |
| Method | New-Evidence Coverage |
|---|---|
| Vector RAG | 0.843 |
| Recency-RAG | 1.000 |
| LLM-Only Update | 0.863 |
| CUPMem-style | 1.000 |
| A-MEM-style | 1.000 |
| PACMI | 0.987 |
| Ablation | Implementation |
|---|---|
| w/o provenance graph | Disables the use of incoming dependency edges for distinguishing directly replaced memories from downstream dependency records and disables all graph propagation. Relation classification, deterministic consistency constraints, direct stale detection, and direct-state assignment remain enabled. |
| w/o cascading invalidation | Retains the graph and direct stale-memory detection but disables traversal from directly stale nodes to downstream dependent nodes. |
| w/o validity states | Removes validity-state filtering, state-dependent ranking biases, and validity-state labels from the retrieved context. Other query-time ranking signals remain unchanged. |
| w/o premise checking | Skips premise detection and always uses the neutral answer-generation prompt. |
| w/o historical preservation | Excludes superseded and historical-only prior memories from retrieval, including for historical queries. |
| Variant | Aff. Rec. | Over-Inv. | Under-Inv. | SIC | New-Ev. Cov. |
|---|---|---|---|---|---|
| PACMI | 1.00 | 0.00 | 0.00 | 0.34 | 0.99 |
| w/o Provenance Graph | 0.00 | 0.00 | 1.00 | 0.37 | 0.99 |
| w/o Cascading Invalidation | 0.00 | 0.00 | 1.00 | 0.41 | 0.99 |
| w/o Validity States | 1.00 | 0.00 | 0.00 | 0.56 | 0.96 |
| w/o Premise Checking | 1.00 | 0.00 | 0.00 | 0.34 | 0.99 |
| w/o Historical Preservation | 1.00 | 0.00 | 0.00 | 0.20 | 1.00 |
| Variant | Final Acc. | Stale Reuse | Premise Resist. |
|---|---|---|---|
| PACMI | 0.99 | 0.00 | 1.00 |
| w/o Provenance Graph | 0.97 | 0.01 | 0.98 |
| w/o Cascading Invalidation | 0.96 | 0.01 | 0.98 |
| w/o Validity States | 0.97 | 0.02 | 0.98 |
| w/o Premise Checking | 0.83 | 0.02 | 0.80 |
| w/o Historical Preservation | 0.77 | 0.00 | 0.99 |
| Variant | Current | Stale Premise | Historical |
|---|---|---|---|
| PACMI | 1.00 | 0.97 | 1.00 |
| w/o Provenance Graph | 1.00 | 0.91 | 1.00 |
| w/o Cascading Invalidation | 0.99 | 0.91 | 0.99 |
| w/o Validity States | 0.97 | 0.94 | 1.00 |
| w/o Premise Checking | 1.00 | 0.50 | 1.00 |
| w/o Historical Preservation | 1.00 | 0.94 | 0.36 |
| Variant | Recall@Depth-1 | Recall@Depth-2 |
|---|---|---|
| PACMI | 1.00 | 1.00 |
| w/o Provenance Graph | 0.00 | 0.00 |
| w/o Cascading Invalidation | 0.00 | 0.00 |
| w/o Validity States | 1.00 | 1.00 |
| w/o Premise Checking | 1.00 | 1.00 |
| w/o Historical Preservation | 1.00 | 1.00 |