potentialpaper

MemCode: Discrete Semantic Representations for Long-Term Agent Memory

Xin Li, Liang Hu, Duoqian Miao, Ming Peng, Qi Zhang

NeurIPS 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. MemCode improves long-term agent memory by rewriting dialogue into atomic memory units and retrieving them through complementary vector and discrete codebook paths.

Abstract. Long-term memory remains a fundamental bottleneck for large language model (LLM) agents across sessions. Existing systems typically adopt a write-then-retrieve paradigm, storing context-dependent dialogue fragments and retrieving them via nearest-neighbor search in continuous embedding space. This design yields unstable access units and systematically misses logically related but lexically distant evidence. We propose MemCode, a long-term agent memory framework that couples retrieval-oriented writing with discrete associative retrieval. MemCode rewrites dialogue into self-contained atomic memory units (AMUs), maps AMUs into a learnable codebook with isomorphic semantic quantization (ISQ), and uses codebook co-occurrence topology as a retrieval path complementary to vector search. For long-term memory stores, MemCode separates online atomic writes from asynchronous offline consolidation. On LongMemEval-S and LoCoMo with GPT-4o-mini and Qwen3-30B-A3B-Instruct-2507 backbones, MemCode achieves the best overall accuracy while keeping per-dialogue memory construction within roughly 40--130 seconds, making it 3--21$\times$ faster than LightMem and over an order of magnitude faster than A-MEM and MemoryOS.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
5 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]—[1]
Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:45 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
Meta-review

This paper proposes MemCode, a long-term memory framework that addresses the write–retrieve mismatch by converting dialogue into self-contained Atomic Memory Units and combining dense retrieval with discrete codebook-based associative retrieval. It further introduces asynchronous consolidation and reports improved overall accuracy and substantially lower memory-construction cost on LongMemEval-S and LoCoMo.

  • A central issue across Reviewers FAjq and hCSC is whether the reported gains can be clearly attributed to the codebook retrieval path. The current results do not fully separate the effects of AMUs, codebook retrieval, and asynchronous consolidation, and some temporal, multi-hop, and open-domain results appear inconsistent with the stated motivation. A clearer decomposition and explanation of these behaviours would be important for the discussion.

  • Reviewer FAjq raises a significant concern about missing closely related baselines, particularly graph-based associative retrieval such as HippoRAG or GraphRAG, as well as stronger modern RAG variants. Reviewer mdqw similarly notes the absence of attention-based memory baselines. These comparisons would help establish whether the benefit is specific to the discrete codebook design rather than associative retrieval more generally.

  • Reviewers FAjq and mdqw question whether the current evaluation directly supports the retrieval claims. Direct retrieval-level measures such as evidence recall@k, AMU hit rate, or MRR, together with the original LoCoMo metrics, would make it easier to verify that the codebook path recovers useful evidence rather than only improving end-to-end judged accuracy.

  • Reviewer mdqw also raises concerns about evaluation objectivity and reproducibility, including the use of GPT-4o-mini both within the pipeline and as an evaluator, the underspecified VQ-VAE/codebook training setup, possible overlap from DailyDialog, and the risk of noisy co-occurrence links creating spurious associations.

These points will be important considerations in the post-rebuttal discussion.

Final justification

All three reviewers now assign positive scores (Rating: 4), and the authors' rebuttal has substantively addressed the core concerns raised during the initial review.

Reviewer FAjq's central concern regarding the attribution of gains to the codebook path was resolved via a clean 2×2 ablation isolating codebook retrieval and asynchronous consolidation as independent, complementary contributors. The addition of same-budget HippoRAG2 and hybrid retrieval baselines confirms competitive accuracy without prohibitive overhead, and new retrieval-level diagnostics (Recall@K, coverage) validate that the codebook recovers evidence missed by dense retrieval.

Reviewer hCSC's concerns about the codebook's contribution and the model's behavior across question types were addressed through stratified analysis by evidence cardinality and component attribution tables. The reviewer confirmed their concerns were resolved and maintained their positive score.

Reviewer mdqw's concerns regarding evaluation objectivity, reproducibility, and association noise were mitigated by a multi-judge robustness analysis (five external models showing no significant bias), a completed VQ-VAE training specification and overlap audit, and explicit ablation of IDF noise controls that improve Multi-Hop and Temporal reasoning. The reviewer maintained their positive score.

The paper presents a novel and practically valuable solution to the write-retrieve mismatch in long-term agent memory, with strong empirical support and demonstrated efficiency-accuracy trade-offs. The authors have been responsive and thorough in their revisions. I therefore recommend acceptance.

Area Chair 5Vfu · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

This paper proposes MemCode, a long-term memory framework that addresses the write–retrieve mismatch by converting dialogue into self-contained Atomic Memory Units and combining dense retrieval with discrete codebook-based associative retrieval. It further introduces asynchronous consolidation and reports improved overall accuracy and substantially lower memory-construction cost on LongMemEval-S and LoCoMo.

  • A central issue across Reviewers FAjq and hCSC is whether the reported gains can be clearly attributed to the codebook retrieval path. The current results do not fully separate the effects of AMUs, codebook retrieval, and asynchronous consolidation, and some temporal, multi-hop, and open-domain results appear inconsistent with the stated motivation. A clearer decomposition and explanation of these behaviours would be important for the discussion.

  • Reviewer FAjq raises a significant concern about missing closely related baselines, particularly graph-based associative retrieval such as HippoRAG or GraphRAG, as well as stronger modern RAG variants. Reviewer mdqw similarly notes the absence of attention-based memory baselines. These comparisons would help establish whether the benefit is specific to the discrete codebook design rather than associative retrieval more generally.

  • Reviewers FAjq and mdqw question whether the current evaluation directly supports the retrieval claims. Direct retrieval-level measures such as evidence recall@k, AMU hit rate, or MRR, together with the original LoCoMo metrics, would make it easier to verify that the codebook path recovers useful evidence rather than only improving end-to-end judged accuracy.

  • Reviewer mdqw also raises concerns about evaluation objectivity and reproducibility, including the use of GPT-4o-mini both within the pipeline and as an evaluator, the underspecified VQ-VAE/codebook training setup, possible overlap from DailyDialog, and the risk of noisy co-occurrence links creating spurious associations.

These points will be important considerations in the post-rebuttal discussion.

Final justification

All three reviewers now assign positive scores (Rating: 4), and the authors' rebuttal has substantively addressed the core concerns raised during the initial review.

Reviewer FAjq's central concern regarding the attribution of gains to the codebook path was resolved via a clean 2×2 ablation isolating codebook retrieval and asynchronous consolidation as independent, complementary contributors. The addition of same-budget HippoRAG2 and hybrid retrieval baselines confirms competitive accuracy without prohibitive overhead, and new retrieval-level diagnostics (Recall@K, coverage) validate that the codebook recovers evidence missed by dense retrieval.

Reviewer hCSC's concerns about the codebook's contribution and the model's behavior across question types were addressed through stratified analysis by evidence cardinality and component attribution tables. The reviewer confirmed their concerns were resolved and maintained their positive score.

Reviewer mdqw's concerns regarding evaluation objectivity, reproducibility, and association noise were mitigated by a multi-judge robustness analysis (five external models showing no significant bias), a completed VQ-VAE training specification and overlap audit, and explicit ablation of IDF noise controls that improve Multi-Hop and Temporal reasoning. The reviewer maintained their positive score.

The paper presents a novel and practically valuable solution to the write-retrieve mismatch in long-term agent memory, with strong empirical support and demonstrated efficiency-accuracy trade-offs. The authors have been responsive and thorough in their revisions. I therefore recommend acceptance.

1 comment
Authors · CommentOpenReview ↗

Response to AC by Authors

Dear Area Chair,

Thank you for highlighting the key issues for the post-rebuttal discussion. We have addressed each point in the corresponding responses to FAjq, hCSC, and mdqw:

  1. Attribution and category behavior. We add the requested 2x2 Multi-Hop ablation with the AMU store and retrieval budget fixed. Codebook retrieval adds 5.32/3.90 points without/with consolidation, while consolidation adds 5.67/4.26 points with dense-only/dense+codebook retrieval. Thus, both contribute independently and complementarily. We also separate AMU construction from topology, stratify Temporal Reasoning by evidence cardinality, audit BM25's competing-date errors, and report the Open breakdown. These analyses explain why codebook retrieval helps distributed evidence, whereas Open can favor lexical anchors or episode continuity.

  2. Missing baselines. Beyond the original A-MEM graph baseline, we add Full HippoRAG2@40, hybrid dense-sparse reranking, and HyDE-style expansion under the same AMU store and evidence budget. HippoRAG2 is statistically indistinguishable but slightly lower than MemCode (77.92% vs. 78.12%), with 12,779 extra model calls and 47.8x retrieval latency. We also clarify that Full Text is the controlled full-history self-attention alternative under the same backbone; separately trained attention-memory methods would change the protocol, backbone, or training regime. We accordingly narrow our claim to competitive accuracy with lower lifecycle cost, not uniquely superior topology.

  3. Retrieval evidence and LoCoMo metrics. Because LoCoMo labels source turns rather than unique rewritten AMUs or AMU rankings, cross-system AMU hit rate/MRR is not directly defined. We nevertheless add a source-grounded diagnostic: codebook retrieval improves Recall@K/complete coverage@K by 3.60/3.71 points over Dense-20 and 1.13/1.69 over equal-budget Dense-40, while recovering 114/95 new evidence instances beyond them. We label this as a supplementary retrieval diagnostic accompanying QA. For BLEU/F1, we acknowledge reduced cross-paper lexical comparability, while explaining that all studied methods share one free-form generation and blinded-judging protocol and were not optimized under a common short-answer overlap objective.

  4. Objectivity and reproducibility. Qwen3 separates generation from the GPT-4o-mini judge, and five external judges re-evaluate the same outputs; the paper judge differs from their majority vote by only -0.19/-0.52 points, with κ=0.834/0.869\kappa=0.834/0.869, and no significant same-family affinity. We also provide the fixed VQ-VAE/codebook training setup, an overlap audit finding only generic DailyDialog matches are shorter than eight tokens, and explicit noise controls. The IDF ablation improves Multi-Hop, Temporal Reasoning, and Overall by 3.90, 1.87, and 1.95 points.

We will incorporate these analyses, baselines, diagnostics, and clarified limitations into the revised main text and appendix. Thus, each issue in the meta-review is addressed in the corresponding reviewer response, and our revised claims will follow the resulting evidence.

Best regards,

The Authors

Reviewer mdqwOpenReview ↗
Rating
4/6
Confidence
3/5
Quality
3/4
Clarity
4/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper proposes MemCode, a long-term memory framework for LLM agents across extended sessions. MemCode addresses the write-retrieve mismatch in existing memory systems by rewriting dialogue into AMUs and mapping these AMUs into a codebook through ISQ. The framework combines continuous vector search with discrete associative retrieval based on codebook co-occurrence topology, enabling access to logically related but lexically distant evidence. It further separates online atomic writing from asynchronous offline consolidation to support scalable memory maintenance. Experiments on LongMemEval-S and LoCoMo show that MemCode achieves the best overall accuracy while reducing memory construction time compared with existing baselines.

Strengths and weaknesses

Strengths

  1. The paper provides a clear analysis of the limitations of existing memory systems, while translating cognitive science inspired associative memory into a LLM memory framework.
  2. The use of VQ-VAE to quantize projected AMU states into discrete codes provides a meaningful refinement over continuous vector retrieval, enabling MemCode to preserve fine-grained cues and form compact semantic fingerprints for associative retrieval.
  3. MemCode demonstrates favorable efficiency compared with existing memory-augmented systems while achieving superior performance on the evaluated benchmark.
  4. The writing is clear, figures and tables are well-structured, and Appendix contains implementation details.

Weaknesses

  1. Although the Introduction highlights the limitations of attention mechanisms, the experiments do not include attention-based retrieval or memory baselines, making it unclear whether the proposed method specifically improves over attention-based alternatives.
  2. It lacks metric reporting consistent with the original benchmarks, such as BLEU and F1 on LoCoMo, which may affect the fairness of comparison. Moreover, using GPT-4o-mini as an evaluator while it is also involved in the system pipeline may introduce inductive bias.
  3. Relying on code co-occurrence to expand retrieval risks introducing spurious associations, since high-frequency or ambiguous codes may connect unrelated memories. Without a clear noise-control or correction mechanism, these noisy links can be amplified through multi-hop expansion and mislead temporal or multi-hop reasoning.
  4. The training setup of the VQ-VAE codebook is insufficiently specified. In particular, the manuscript does not clearly justify the use of DailyDialog for codebook learning or clarify whether DailyDialog overlaps with the evaluation benchmarks, which may affect the soundness and reproducibility of the reported results.
  5. The introduction points out the flaws of attention mechanisms, yet the experiments exclude attention-based retrieval and memory baselines. It cannot verify whether the proposed method achieves targeted improvements over attention-based alternatives, resulting in incomplete argumentation.
  6. The paper fails to adopt standard metrics (BLEU, F1) defined by the original LoCoMo benchmark, impairing comparison fairness. Besides, GPT-4o-mini is used both in the system pipeline and as an evaluator, which may introduce inductive bias and compromise objectivity.

[1] Wu, Di, et al. "Longmemeval: Benchmarking chat assistants on long-term interactive memory." Proceedings of the Thirteenth International Conference on Learning Representations (ICLR 2025).

[2] Maharana, Adyasha, et al. "Evaluating very long-term conversational memory of llm agents." Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (ACL 2024).

Questions

Please see the weaknesses.

Limitations

yes

Formatting concerns

No

2 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Dear Reviewer mdqw,

Thank you for the constructive feedback.

W1/W5: Attention baselines

The Introduction highlights the limitations or flaws of attention mechanisms. We emphasize this limitation to explain why persistent user memory requires external long-term memory organization once growing interaction history exceeds a practical context, not to claim that attention is ineffective. Our scope is user-specific interaction memory with a fixed backbone, not experience written through parameter updates.

The experiments exclude attention-based retrieval or memory baselines, making the targeted improvement over attention-based alternatives unclear and the argumentation incomplete. As clarified above, our goal is not universal superiority over attention mechanisms, but a fixed-backbone comparison of external memory organization with full-history self-attention. Within this scope, Full Text is the most direct controlled attention alternative: the same backbone receives the complete history and query, giving self-attention access to all interactions. Table R1 therefore verifies improvement over this alternative, not every separately trained attention-memory architecture.

We did not add a separately trained attention-memory baseline because the reproducible methods we identified change the LoCoMo protocol or backbone, or require additional memory-network training, conflating memory organization with protocol, architecture, or training.

Table R1 Full Text versus MemCode across two benchmarks and backbones.

Benchmark Backbone Full Text MemCode (Ours) +Asyn. (Ours) Gain: MemCode / +Asyn.
LongMemEval-S GPT-4o-mini 56.80 77.20 78.40 +20.40 / +21.60
LongMemEval-S Qwen3 54.80 73.80 74.60 +19.00 / +19.80
LoCoMo GPT-4o-mini 73.83 78.12 79.55 +4.29 / +5.72
LoCoMo Qwen3 74.87 76.36 76.88 +1.49 / +2.01

Table R1, summarized from Tables 1--2 in the main text, shows Overall gains over Full Text on both benchmarks and backbones: 1.49--20.40 points for MemCode and 2.01--21.60 with consolidation. The scope is explicit: Full Text remains better on LoCoMo Open questions (56.25 vs. 43.75; consolidation: 51.04), where full context can preserve implicit affect or motivation. We will revise the Introduction and Experiments to state this scope and label Full Text as the controlled full-history attention alternative.

W2/W6: Metrics and evaluator bias

The paper does not adopt the standard BLEU/F1 metrics defined by the original LoCoMo benchmark, which may impair comparison fairness. This concern conflates cross-paper comparability with within-protocol fairness. Missing lexical metrics limits comparison with earlier scores, but every method in our study uses identical generation and judging conditions. We target free-form semantic correctness without overlap-oriented short-answer or length constraints.

Our judge protocol follows recent practice: LongMemEval uses a GPT-4o judge; Mem0 shows that overlap can reward a wrong entity, date, location, or relation; LightMem uses judge-based LoCoMo accuracy for A-MEM and Mem0. All methods share the same GPT-4o-mini and Qwen3 answer backbones.

The evaluation targets differ: lexical scoring favors short, normalized, reference-like wording, whereas ours checks whether free-form answers preserve correct entities, relations, dates, quantities, and negations. A correct paraphrase can receive low F1/BLEU-1, while high overlap can remain wrong.

Because the generation targets differ, neither our system nor the recent judge-based baselines in our comparison were optimized or tested under a shared BLEU/F1 protocol. Computing BLEU/F1 on these free-form outputs post hoc would score lexical style under an unmatched objective, not create a comparable result. We therefore do not equate such scores with earlier lexical reports.

GPT-4o-mini is used in both the system pipeline and evaluation, which may introduce inductive bias and compromise objectivity. This is a plausible concern, so we test it rather than assume evaluator objectivity. First, every method uses the same prompt, reference, temperature, and blinded rule; the judge sees neither method identity nor retrieval traces. LightMem uses the same GPT-4o-mini/Qwen3 configurations and remains directly comparable.

Second, the Qwen3 setting separates generation from the GPT-4o-mini judge. Under this cross-model setting, MemCode and its asynchronous variant remain the best-performing methods on both LoCoMo and LongMemEval-S (Tables 1--2 in the main text). We then re-evaluated the same outputs with five external models.

Table R2 Multi-judge robustness on fixed outputs from our MemCode.

Evaluation GPT-4o-mini answers Qwen3 answers
GPT-4o-mini judge (paper) 78.12 76.36
Qwen2.5-32B-Instruct (Alibaba) 74.35 74.29
DeepSeek-V4-Flash (DeepSeek) 82.60 81.23
Grok-4.1-Fast-Non-Reasoning (xAI) 73.05 71.23
Kimi-K2.5 (Moonshot AI) 83.51 81.82
GLM-4.5-Air (Zhipu AI) 74.81 74.94
Five external judges: mean 77.66 76.70
Five external judges: majority vote 78.31 76.88

Third, Table R2 directly evaluates same-family preference: the paper judge differs from the five-judge majority by -0.19/-0.52 points, with Cohen's κ=0.834/0.869\kappa=0.834/0.869. GPT same-family affinity is +0.79 points (95% bootstrap CI [-0.48, 2.05]); this and the symmetric Qwen interval include 0. We detect no reliable preference and will add this analysis and both metric limitations to the revised Experiments and Limitations.

W3: Association noise

Relying on code co-occurrence to expand retrieval risks spurious associations because high-frequency or ambiguous codes may connect unrelated memories. This risk applies to unrestricted co-occurrence; MemCode addresses your two stated sources of noise before, during, and after expansion:

  1. Source-side IDF downweights frequent codes and τIDF\tau_{\mathrm{IDF}} filters them before expansion (Section 3.4, Eq. (9); appendix Table 7).
  2. Top-KK, depth HrH_r, and decay αh\alpha^h bound ambiguous neighbors. We use Hr=1H_r=1, preventing recursive graph propagation; Table 7 reports K=3K=3, α=0.3\alpha=0.3, and τIDF=0.5\tau_{\mathrm{IDF}}=0.5.
  3. Under the fixed Kv+KcK_v+K_c budget, codebook evidence only supplements dense retrieval and cannot expand context without limit (Section 3.4, Eqs. (10)--(11)).

Without a clear noise-control or correction mechanism, noisy links may be amplified through multi-hop expansion and mislead temporal or Multi-Hop reasoning. MemCode does include explicit noise control: one-hop expansion prevents repeated graph propagation, while the IDF ablation checks whether filtering protects the two reasoning categories you mentioned.

Table R3 IDF noise control on 1,540 LoCoMo questions.

Configuration Overall Multi Temporal Single Open
Without IDF (Ours variant) 76.17 60.99 74.77 84.66 51.04
Full MemCode (Ours) 78.12 64.89 76.64 87.04 43.75
Difference +1.95 +3.90 +1.87 +2.38 -7.29

The ablation in Table R3 directly answers this concern: IDF improves Multi-Hop by 3.90 points and Temporal by 1.87 points, while Overall rises by 1.95 points. Together with one-hop expansion, these results show that MemCode explicitly limits association noise and improves, rather than degrades, the two reasoning categories you identified. We will add this mechanism and evidence to Sections 3.4 and 4 and the appendix.

W4: Training and overlap

The VQ-VAE codebook training setup is insufficiently specified. The setup is already specified in appendix Table 5, including T5-base initialization, stride-1 projection, a 1,024-entry codebook, optimization/loss settings, EMA updates, dead-code revival, and next-utterance training from two preceding turns. It also states that these settings are fixed for all memory-runtime experiments. We will make the pointer from the main text clearer.

The manuscript does not justify using DailyDialog or clarify its overlap with the evaluation benchmarks, which may affect the soundness and reproducibility of the reported results. We chose DailyDialog because its human-written, low-noise dialogues support learning reusable local dialogue states without long-memory questions, answers, or labels. We use only its official train split (11,118 dialogues; 64,935 pairs), since the codebook learns local conversational patterns rather than evaluation-specific facts. For data isolation, training finishes before evaluation and the codebook is frozen; no benchmark history, question, answer, label, or trace updates it. We also audit exact utterance overlap after NFKC, case, alphanumeric, and whitespace normalization and deduplication.

Table R4 Exact-overlap audit against DailyDialog train.

Evaluation corpus Unique normalized utterances Exact matches Rate Matches with >=8 tokens
LoCoMo 5,867 14 0.239% 0
LongMemEval-S 189,472 88 0.046% 0

Taken together, the fixed training specification addresses reproducibility, while Table R4 argues against benchmark leakage: across 69,026 normalized DailyDialog utterances, all exact matches are generic acknowledgments or thanks, and none reaches 8 tokens. Thus, there is no substantive long-form overlap, and evaluation data never enters optimization. We will clarify the pointer to appendix Tables 4--5 and add the overlap audit and data-isolation procedure.

Authors · CommentOpenReview ↗

A kind reminder

Thank you again for your constructive review. We have carefully addressed each of your concerns in our detailed response and would like to add one clarification directly related to your concern that broad code associations may amplify retrieval noise.

Follow-up to W3 (spurious associations and noise control). IDF is intended to suppress broad, weak associations for structured retrieval, rather than improve every category uniformly. Table R3 shows that IDF raises Multi-Hop by 3.90 points, Temporal by 1.87, and Overall by 1.95, while lowering Open by 7.29; some Open questions can benefit from broader narrative cues. Appendix Table 7 provides complementary sensitivity evidence: the deployed setting (K=3,α=0.3,τIDF=0.5)(K=3, \alpha=0.3, \tau_{\mathrm{IDF}}=0.5) reaches 78.12% Overall, whereas expanding to K=9K=9 falls to 76.49%, and weaker IDF thresholds of 0.1 and 0.3 reach 77.27% and 77.34%. These results support bounded expansion and moderate filtering as safeguards against spurious propagation, while also making the category-level tradeoff explicit.

Together with our responses on attention-based comparisons, evaluation protocol, multi-judge robustness, and VQ-VAE training overlap, we hope these will address your concerns. We would greatly value your further feedback and participation in the discussion. Thank you again for your time and for helping us strengthen the paper.

Reviewer hCSCOpenReview ↗
Rating
4/6
Confidence
4/5
Quality
3/4
Clarity
3/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

The paper researches the question of long-term memory in cross-session dialogue with LLM agent. The main motivation is that existing memory systems mostly adopt write-then-retrieve pipelines, which store dialogue segments and retrieve them based on embedding similarity. The author argues that two problems arise within the pipeline: on the one hand, stored memories may remain context-dependent and difficult to use independently, and on the other hand, vector retrieval may miss logically related memories that are not close in surface semantics. To address the problem, the paper proposes the MemCode memory framework. Memcode firstly rewrite dialogues as atomic memory units and keeps timelines, speaker metadata and source pointers. It then maps these memory units into both continuous vector representations and discrete codebook fingerprints through isomorphic semantic quantisation. During retrieval time, Memcode applies a dual-path strategy: vector search retrieves locally similar memories, while codebook co-occurrence topology brings in associated evidence that may be missed by nearest-neighbour retrieval. Experiments on LongMemEval-S and LoCoMo show that MemCode improves overall accuracy over several long-term memory baselines while maintaining relatively efficient memory construction.

Strengths and weaknesses

Strength

  1. The motivation and research gap are clear and specific. The paper says: 1. context-dependent fragments are weak storage units and atomic facts are better, and 2. dense vectors may miss logically related but lexically distant content. I agree they are the issues when we apply RAG to the memory system.

  2. The design of atomic memory units (AMUs) and source pointers to replace raw dialogue segments and compressed summaries is plausible to some degree.

  3. I appreciate the codebook idea/insight in the methodology. I think this is the highlight point of the paper. The codebook is not for compressed tools but for an index to connect memory units and observe the complementary evidence compared with embedding similarity in RAG. In addition, applying global matrix and semantic fingerprinting to look related evidence is insightful. This method provides a new path for research on RAG in a memory system.

  4. The main experiment report performance and cost/efficiency, which is comprehensive to some degree and the fusion study are meaningful to reveal the contribution of the core contribution such as atomic-fact abstraction etc.

Weakness

  1. I found the paper little difficult to read. The abundance of formulas and specialized terminology make me spent several hours on Section 3 alone, even I search extra information on VQVAE/codebooks etc. to understand what the authors were trying to do. In addition, some terminology do not have any explaination such as CRUD in line 30, CA3 in line 99 etc. I hope maybe in the next version if author could provide specific introduction about VQVAE or some other terminology maybe helpful even in the appendix. But I thanks author to give me the chance to know more about the knowledge beyond my scope. And main experiment results also seems lack of emphasise, I do not know why the data name should be highlighted and they all seems say about performance and efficiency. In addition, some terminology in the experiment might need to be explained such as stride in figure 3.b, what is that mean? Nevertheless, I still want to emphasize that their core idea and insight are very valuable.

  2. The contribution/analysis of the codebook is a little confusing. In section 4.1, figure 3.a, we could see that, with the second retrieval path, the temporal question performance only increases by 0.3%, however, in table 3, we could see that when BM25 replaces the codebook, the temporal performance decreases around 6%, lower than even dense retrieval path in figure 3.a. What do you think/reason for their performance? In addition, the main result (line 264-268) said MemCode’s AMUs and discrete topology outperform when answers are grounded in explicit264entities, dates, speaker bindings, or linked facts (maybe point out to temporal/single-hop question?). So actually what is AMU and codebook/discrete contribution?

  3. Following line 266-267, "When answers depend on implicit affect or broad narrative continuity, Full Text and LightMem remain competitive; consolidation narrows this gap by restoring continuity at a small temporal-granularity cost.", I am curious about it. Actually, in my opinion, the codebook and the global matrix M will improve the connection between implicit facts, entities etc. whose semantic relations are not strong. That is the paper's core idea that the second retrieval path would expand the dense vector retrieval path. In addition, Lightmem apply compressed summaries, and Full text will make the LLM "lost in the middle". I think they are weaker at capturing the implicit connections. In addition, the codebook is worse than BM25 in open-domain questions significantly in Table 3. And BM25 is typically match with text overlap. Therefore, I am confused that if codebook are better to capture the implicit connection, why the open domain performance is worse but multi-hop performance is better? In addition, which part of the framework makes the open-domain performance worse? What is the advantage if we apply the second retrieval path? And what is the direction you think we might take to improve open domain or other needs implicit performance? I am looking forward to reading any analysis if the author could provide any.

Discussion: Following the last point, currently there are also some research trying to mitigate the RAG issues when applying RAG to a memory system, such as xMemory. It is a hierarchical structure that abstracts memory components/decoupling from raw messages and retrieval based on the components but not on the original message to avoid similarity issues when RAG apply vector matching. In addition, their relation between memory component and the theme will evolve when storing the dialogues. Do you think the decoupling and the evolve idea will improve some part of the Memcode framework such as AMUs or codebooks to capture implicit connections better?

Questions
  1. The contribution/analysis of the codebook is a little confusing. Please see weakness 2.

  2. I am confused about the implicit fact capture with the Memcode framework. Please see weakness 3.

  3. Please see the discussion. But the discussion is only arised from my curiosity. Whether the author responds or not does not affect my evaluation of this paper.

Limitations

yes

Final justification

After discussion, I will maintain my positive scores.

Formatting concerns

no

3 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Dear Reviewer hCSC,

Thank you for recognizing our motivation, AMUs, and associative codebook.

W1: Readability and presentation

The title and Section 3 are difficult to read. We will use a plainer title and present the retrieval pipeline before Section 3's formulas:

dialogue -> source-grounded AMUs -> dense and discrete indices -> complementary retrieval -> source reconstruction -> answer

This shows that AMU text stays intact and VQ-VAE code IDs are retrieval keys, not compressed memory.

What do CRUD, CA3, and stride mean, and where will they be defined? CRUD means Create, Read, Update, and Delete; CA3 motivates partial-cue retrieval. In Figure 3(b), stride is the projection step: 1 preserves every token position, while larger values downsample names, dates, and quantities. We will define CRUD/CA3 at first use and stride in the Figure 3(b) caption and text.

Will the revised version provide a specific introduction to VQ-VAE and other specialized terminology, including in the appendix? Yes. We will add a stage overview before formulas, a self-contained VQ-VAE/codebook primer in Section 3, and expanded background plus an appendix glossary.

Why are the data/model names highlighted, and how will the main experimental results be emphasized? Colored rows in Tables 1--2 separate GPT-4o-mini and Qwen3 blocks, not importance. Bold/underline mark each backbone's best/second-best result but are not self-explanatory. We will label groups in headers/captions, expand Asyn. at first use, and foreground Overall/category accuracy in the discussion in the main text.

W2/Q1: Temporal and components

Why is the Temporal Reasoning gain from the second retrieval path only about +0.6 points, while Codebook is 6.23 points above BM25? These compare different quantities. Figure 3(a) shows Dense-20 rising 76.0% to 76.6% with dual paths (exactly +0.62 before rounding). Against the same Dense-20 base in Table 3, Codebook adds +0.62 and BM25 -5.61; hence 0.62−(−5.61)=6.230.62-(-5.61)=6.23.

We stratify outputs by LoCoMo evidence turn IDs: one ID is single evidence and more than one is multiple evidence; outputs and retrieval do not define this split.

Table R1 Temporal Reasoning accuracy (%) by LoCoMo evidence cardinality (GPT-4o-mini).

Subset N Dense-20 Dense-20 + BM25-20 Dense-20 + Codebook-20 (Ours)
Single evidence 281 80.43 73.67 79.72
Multiple evidence 40 45.00 47.50 55.00
All Temporal 321 76.01 70.40 76.64

Table R1 shows Codebook changes Dense-20 by -0.71 on 281 single-evidence questions but +10.0 on 40 multiple-evidence questions; the dominant first subset dilutes association gains. Deltas use paired counts before rounding. Similarly, 276/282 Multi-Hop questions are multiple-evidence, with a +9.22 Codebook gain.

Why does replacing the codebook with BM25 reduce Temporal Reasoning accuracy below Dense-20? Codebook is uniquely correct on 35 questions versus BM25's 15. We audited each path's candidates to explain BM25's errors.

Table R2 Average Temporal retrieval noise by second path; groups are relative to Dense-20.

Measure BM25 Codebook (Ours)
Added candidates mentioning the target person 16.07 12.55
Target-person date buckets in added candidates 9.32 8.12
Final target-person date buckets in newly correct cases 13.44 13.68
Final target-person date buckets in newly incorrect cases 15.32 13.88
Increase from newly correct to newly incorrect cases +1.88 +0.20

Table R2 shows BM25 retrieves more target-person mentions/date buckets; date competition rises 1.88 in newly incorrect versus correct cases, against 0.20 for Codebook. Lexical matching thus adds competing dates: +0.62 compares Codebook with Dense-20, while +6.23 also includes BM25's -5.61.

What do AMUs and the codebook/discrete topology each contribute? Lines 264--268 describe their combined regime, not equal attribution. AMUs determine stored, addressable facts; topology determines their association and joint access.

Table R3 Component attribution for claims in lines 264--268 of the main text.

Component Direct role Primary property Isolating evidence
AMU construction (Ours) Write self-contained, source-linked facts; resolve entity, speaker, and time Explicit entities, dates, speaker bindings Figure 3(c) in the main text: +31.2/+25.5/+23.6/+24.3 points on Multi-Hop/Temporal/Single-Hop/Overall over w/o Atomic. Response audit: 2,169/2,354 unique question-evidence pairs have a source-linked AMU; 94.12% of first-person evidence makes the speaker explicit; 97.37% of relative-time evidence is timestamped
Codebook/discrete topology (Ours) On fixed AMUs, use discrete fingerprints, co-occurrence expansion, and IDF weighting Linked/distributed facts Figure 3(d) in the main text: removing graph expansion costs 5.7 Multi-Hop and 2.6 Overall points; removing IDF costs 3.9 and 1.9. Response cardinality analysis: +10.0 multiple-evidence Temporal and +9.22 Multi-Hop over Dense-20

Table R3 isolates the roles: AMU removal changes all storage units; topology ablations fix AMUs. AMUs provide source-grounded, addressable facts and topology associative access. Single-Hop/single-evidence Temporal mainly test AMUs; Multi-Hop/multiple-evidence Temporal expose topology.

Thus, +0.6 reflects a single-evidence-heavy mix; 6.23 also includes BM25's competing-date degradation; and AMUs/topology separate storage from association. We will add Tables R1--R3 and this attribution.

W3/Q2: Open performance

“Consolidation narrows this gap by restoring continuity at a small temporal-granularity cost.” Consolidation forms episode-like memories from fragmented AMUs, aiding context but potentially merging time points. Table 2 shows Open rising 43.75% to 51.04% and Overall 78.12% to 79.55%, while Temporal changes 76.64% to 75.39%.

The codebook and global matrix M should improve weak semantic connections; why can Full Text and LightMem remain competitive despite lost-in-the-middle and compression risks? The second path links distributed facts with weak local similarity. Open also needs affect and narrative continuity: Full Text retains discourse and LightMem compressed themes/summaries. Such episode cues may fragment across AMUs, so Open competitiveness does not imply stronger cross-memory association.

If Codebook captures implicit associations, why is it worse than BM25 on Open but better on Multi-Hop? Multi-Hop links distributed evidence; many Open questions need a lexical anchor or coherent episode. Table 3 reports aggregates and Table R4 the Open breakdown.

Table R4 Multi-Hop and complete Open accuracy breakdown (%) on LoCoMo (GPT-4o-mini).

Subset N Dense-20 Dense-20 + BM25-20 Dense-20 + Codebook-20 (Ours)
Multi-Hop 282 55.67 60.64 64.89
Open, no annotated evidence 4 50.00 75.00 75.00
Open, single evidence 45 51.11 55.56 44.44
Open, multiple evidence 47 42.55 42.55 40.43
All Open 96 46.88 50.00 43.75

Table R4 shows Codebook gains +9.22 over Dense-20 and +4.26 over BM25 on Multi-Hop. BM25 answers six more Open questions: five single-evidence, one multiple-evidence, none unannotated. This reflects lexical anchoring, not stronger distributed association.

Which part of the framework limits Open performance, what advantage does the second path provide, and how can Open or other implicit-information performance be improved? Atomic writing is not primary: removing it lowers Open 43.75% to 38.54% in Figure 3(c). The fixed 20+20 interface is limiting because some questions need an anchored passage or synthesized episode, not independent AMUs.

The second path changes access, not just candidate count: 69.3% of Codebook-added facts remain outside dense top-100 (appendix Figure 4), while doubling dense candidates adds only 1.4 Overall points (Figure 3(a)). It reaches beyond local dense neighborhoods.

We propose query-adaptive, multi-granular retrieval: codebook expansion for distributed evidence, lexical/entity anchors, episodic summaries, and typed-relation reranking.

Thus, codebook targets distributed evidence, consolidation restores some episode continuity at a temporal cost, and Open needs anchors/context beyond fixed 20+20. We will add the breakdown and clarify these types, limits, and improvements.

Q3: xMemory evolution

Could xMemory-style decoupling and evolving memory-to-theme relations improve MemCode's AMUs or codebooks for implicit connections? MemCode already decouples raw messages into source-grounded AMUs and evolves them via consolidation. Revisable AMU-to-theme membership could add evolving organization without replacing stable AMUs or code identities.

We run an unsupervised structural diagnostic on 10 stores (5,911 AMUs), combining normalized dense and IDF-weighted code features at about 25 AMUs/theme. Themes are frozen after the first half or refitted on full history; gold evidence only evaluates coverage. Among 276 multiple-evidence Multi-Hop questions, 220 retain all evidence as linked AMUs; 56 miss at least one before theme organization.

Table R5 Same-theme evidence coverage (%) for 220 eligible multiple-evidence Multi-Hop questions.

Theme assignment Same-theme coverage (%) Covered only under this setting Exact McNemar pp vs. frozen
Frozen themes 29.09 2 N/A
Evolving themes 31.82 8 0.109

Table R5 shows eight gains and two losses, not significant (p=0.109p=0.109). This structural, not QA, evidence makes xMemory-style evolution plausible, not an established accuracy gain. A conservative extension keeps code identities stable and evolves AMU-to-theme membership.

Reviewer hCSC · CommentOpenReview ↗

Thank the author effect for their response. Nearly my concern is solved. I will maintain my positive score.

Authors · CommentOpenReview ↗

Thank you for the reply

Thank you for reviewing our response and for your encouraging feedback. We are glad that our clarifications addressed nearly all of your concerns, and we sincerely appreciate your continued positive assessment. If you have any further concerns, please feel free to let us know.

Best regards,

The Authors

Reviewer FAjqOpenReview ↗
Rating
4/6
Confidence
4/5
Quality
4/4
Clarity
3/4
Significance
3/4
Originality
4/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper proposes MemCode, a long-term memory framework for LLM agents. The key idea is that current memory systems suffer from a write–retrieve mismatch: they often store context-dependent dialogue fragments, but later retrieve them using dense vector similarity, which can miss logically related but lexically distant evidence. MemCode addresses this by rewriting dialogue into self-contained Atomic Memory Units, assigning each unit both a dense embedding and a discrete codebook fingerprint, and retrieving memory through both vector search and codebook-based associative retrieval. It also uses asynchronous consolidation to merge, deduplicate, and update long-term memories.

Strengths and weaknesses

Strengths

S1) The core strength is the paper’s problem reframing: it identifies long-term agent memory as a write–retrieve mismatch, rather than just a storage or retrieval-scale problem. The proposed method is logically aligned with this diagnosis: AMUs improve the written memory units, while the codebook topology improves associative retrieval. This gives the paper a clear problem–method loop.

S2) The paper has strong practical value for real systems. It reports a meaningful efficiency–accuracy trade-off, achieving strong overall accuracy while substantially reducing memory-construction runtime compared with systems such as LightMem, A-MEM, MemoryOS, and Mem0. It also has useful engineering properties: AMUs keep source pointers, and consolidated facts preserve links to original evidence, which makes the memory system more traceable and auditable.

Weaknesses

W1) On effectiveness, the multi-hop results are not fully consistent with the design motivation. The paper argues that the codebook path should help multi-hop associative retrieval, but without asynchronous consolidation, MemCode’s Multi-Hop result on LoCoMo with GPT-4o-mini is still lower than Full Text. With Qwen3, MemCode without consolidation is also lower than LightMem on Multi-Hop. The authors explain this by saying that Full Text and LightMem preserve broader narrative continuity, while MemCode’s atomic segmentation may lose some long-range context. Consolidation can partially recover this by aggregating fragmented facts. This explanation is reasonable, but it suggests that the multi-hop gain may rely heavily on consolidation, not only on the codebook topology itself.

W2) The baseline comparison is missing important graph-based methods. A HippoRAG-style or GraphRAG-style baseline would be highly relevant because these methods also use graph-based associative retrieval for multi-hop evidence. MemCode uses a latent codebook co-occurrence graph, while graph-based methods use explicit entity or knowledge graphs. Without this comparison, it is hard to know whether the gain comes specifically from the discrete codebook design or from associative graph retrieval more generally. The paper also lacks stronger modern RAG baselines, such as dense retrieval with reranking, query rewriting, hybrid dense-sparse retrieval, or HyDE-style expansion.

W3) The paper mainly reports end-to-end accuracy, but does not provide direct retrieval metrics. Since the central claim is that the codebook path improves retrieval, the paper should report evidence recall@k, AMU hit rate, MRR, or similar metrics. Current results show that accuracy improves, but they do not directly show how much correct evidence is newly recovered by the codebook path.

Questions
  1. How much of the Multi-Hop improvement comes from the codebook path alone, and how much comes from asynchronous consolidation? Could the authors report dense-only, dense+codebook, dense+consolidation, and dense+codebook+consolidation results?

  2. Why is there no graph-based associative-retrieval baseline, such as HippoRAG? Could the authors compare MemCode’s latent codebook topology with an explicit entity-graph retrieval method under the same retrieval budget?

  3. Can the authors report retrieval-level metrics, such as evidence recall@k, AMU hit rate, or MRR, to directly verify that the codebook path recovers correct evidence missed by dense retrieval?

Limitations

No, not fully. The paper does discuss several important limitations, including the boundary of AMU-based abstraction, weaker performance on open-ended questions, privacy risks of persistent memory, and the need for user consent, deletion controls, retention limits, and access control. However, some methodological limitations are not sufficiently addressed.

First, the paper does not clearly decompose where the Multi-Hop improvement comes from. Existing ablations provide partial evidence, but they do not fully separate the contributions of dense retrieval, codebook retrieval, and asynchronous consolidation. A clearer factorial ablation comparing dense-only, dense+codebook, dense+consolidation, and dense+codebook+consolidation would help determine whether the Multi-Hop gains mainly come from the codebook topology, consolidation, or their interaction.

Second, the paper does not fully justify the absence of stronger associative-retrieval baselines, especially graph-based methods such as HippoRAG, which are closely related to the proposed codebook topology. More generally, comparisons with stronger modern retrieval systems, such as dense retrieval with reranking, hybrid dense-sparse retrieval, or query expansion methods, would make the evaluation more convincing.

Third, the paper does not report direct retrieval-level metrics, such as evidence recall@k, AMU hit rate, MRR, or precision of retrieved evidence. Since the main claim is that the codebook path improves memory retrieval, such metrics are important for validating whether the additional retrieval path actually recovers correct supporting evidence missed by dense retrieval.

I would encourage the authors to expand the limitations discussion to explicitly cover these evaluation and baseline issues, and to outline how future work could validate the method with direct retrieval metrics, stronger retrieval baselines, and more fine-grained ablations.

Final justification

Thank you for the detailed rebuttal. The new 2×2 ablation in Table R1 substantially addresses my concern about the attribution of multi-hop gains. It shows that both the codebook path and asynchronous consolidation provide independent and comparable improvements. I would still encourage the authors to include the same decomposition for Qwen3 and for temporal questions, since these are the settings where the trade-off appears most pronounced.

The added HippoRAG2 and stronger RAG baselines also significantly improve the evaluation. However, I would like to see category-level results, especially for Multi-Hop and Temporal, since overall accuracy may hide differences in the exact regimes where graph-based retrieval is most relevant. The cost comparison is useful, but the paper should clearly state that the reported “additional” calls/tokens are measured beyond the shared AMU construction cost.

The new source-grounded Recall@K and complete-coverage metrics are also helpful and directly address the lack of retrieval-level evidence. I recommend adding category-level retrieval recall and explaining why the QA gain over Dense-40 is larger than the Recall@K gain.

One minor but important issue: the rebuttal seems to use 70.57 as the Qwen3 LightMem Multi-Hop score, but this appears to be the temporal score. Please correct this comparison in the revision.

Overall, the rebuttal substantially addresses my main concerns. If the new experiments and clarifications are incorporated into the paper, I would be inclined to raise my score to 4.

Formatting concerns

N/A

2 comments
Authors · RebuttalOpenReview ↗
Rebuttal

Dear Reviewer FAjq,

Thank you for the constructive comments. We respond point by point below.

W1: Multi-Hop motivation

Why the Multi-Hop results can appear inconsistent with the design motivation. The apparent inconsistency reflects system-level comparisons that change both memory representation and retrieval. In Table 2 of the main text, base MemCode trails Full Text on GPT-4o-mini Multi-Hop (64.89 vs. 68.79), but consolidation raises it to 69.15; with Qwen3, it trails LightMem (59.22 vs. 70.57), and consolidation narrows the gap to 66.31. Full Text and LightMem preserve broader narrative continuity, whereas AMUs trade some continuity for atomicity, traceability, and efficient retrieval. These differences characterize the AMU representation's continuity boundary, not the isolated codebook-path effect. We will clarify this distinction in the revised version.

Does the Multi-Hop gain rely heavily on asynchronous consolidation rather than the codebook topology? Those cross-system comparisons cannot isolate attribution because they change both representation and retrieval. Table R1 in Q1 fixes the AMU representation and budget and shows a 5.32-point codebook gain without consolidation. Thus, the codebook path contributes independently, with a separate, comparable consolidation gain.

Q1: Codebook vs. consolidation

How much comes from the codebook path alone, and how much from asynchronous consolidation? We ran the requested 2x2 ablation on 282 LoCoMo Multi-Hop questions with GPT-4o-mini. Dense-only, dense+codebook, dense+consolidation, and dense+codebook+consolidation start from the same base AMU store with a total retrieval budget of 40:

Table R1 Requested 2x2 LoCoMo Multi-Hop ablation (GPT-4o-mini, n=282n=282); percentages with counts in parentheses.

Retrieval configuration Without asynchronous consolidation With asynchronous consolidation
Dense-only (Dense-40) 59.57 (168/282) 65.25 (184/282)
Dense + codebook (Dense-20 + Codebook-20, Ours) 64.89 (183/282) 69.15 (195/282)

Table R1 isolates both contributions: codebook adds 5.32 points without consolidation and 3.90 with it; consolidation adds 5.67 points with dense-only and 4.26 with dense+codebook. Averaged marginal gains assign 4.61 points (about 48%) to codebook and 4.96 (about 52%) to consolidation. The -1.42-point interaction indicates overlapping, not mutually dependent, gains; both are comparable and complementary, and their combination is best. We will add this ablation and clarify the representation/consolidation boundary in the revised Experiments and Limitations.

W2/Q2: Retrieval baselines

Why is there no graph-based associative-retrieval baseline such as HippoRAG? The original evaluation includes A-MEM as a graph-structured memory baseline (Tables 1--2 in the main text). Its explicit association edges form an evolvable note-level network matching our incremental personal-memory setting.

For HippoRAG2, an extracted entity-relation graph is the retrieval substrate, with query-side recognition before personalized PageRank. It is naturally batch-built over a relatively fixed corpus; growing personal memory would require repeated extraction, linking, and graph/index maintenance. LoCoMo supplies complete histories, enabling a favorable one-shot evaluation. Reported costs include one-shot graph construction and queries, but not repeated maintenance; Tables R2--R3 report same-budget results and costs.

Does the gain come specifically from the discrete codebook design or from associative graph retrieval more generally? Tables R2--R3 provide the requested same-budget comparison: the two topologies have statistically indistinguishable accuracy, so the gain is not unique to codebook association. The codebook achieves this level without Full HippoRAG2's graph-construction and query-time overhead, better fitting continuously updated long-term agent memory.

Missing stronger modern RAG baselines. We evaluate the requested families: hybrid dense-sparse retrieval with reranking and HyDE-style query reformulation with reranking. At the same maximum evidence budget in Table R2, BM25 and these controls reach 76.36--76.75 versus MemCode's 78.12, a 1.37--1.76-point advantage. Dense-40 reaches 74.61, so a larger dense budget alone does not close the gap.

How does MemCode's latent codebook topology compare with explicit entity-graph retrieval under the same retrieval budget? Full HippoRAG2@40 and MemCode use the same frozen 5,911-AMU store and retrieve at most 40 items. HippoRAG2 also builds an entity-relation graph and performs query-side recognition, so Table R2 compares its complete pipeline, not only a replacement path.

Table R2 End-to-end LoCoMo accuracy under graph-based and modern retrieval controls; all methods retrieve at most 40 evidence items.

Method LoCoMo accuracy (%)
Dense-20 73.18
Dense-40 74.61
Dense-20 + BM25-20 76.75
Hybrid dense-sparse + reranker 76.36
HyDE + reranker 76.69
Dense-20 + Codebook-20 (Ours) 78.12
Full HippoRAG2@40 77.92

Table R2 shows Full HippoRAG2 answers 1,200/1,540 questions (77.92%) versus MemCode's 1,203/1,540 (78.12%) under the shared budget; the 0.20-point difference is not significant. It therefore adds graph construction and query recognition without improving accuracy; Table R3 reports lifecycle costs.

Table R3 Accuracy and lifecycle-cost comparison beyond the shared AMU construction. MemCode accuracy refers to Table 2 in the main text; the latency ratio uses unrounded measurements.

Metric MemCode (Ours) Full HippoRAG2@40
LoCoMo accuracy (%) 78.12 77.92
Additional model calls 0 12,779
Additional processed tokens 0 8.47M
Explicit entity-graph construction time No explicit entity graph 34.49 min
Explicit entity-graph size No explicit entity graph 17,275 nodes / 109,779 edges
Retrieval latency per query 0.060 s 2.864 s (47.8x)

Tables R2--R3 answer Q2: Full HippoRAG2 has statistically indistinguishable but slightly lower accuracy (77.92 vs. 78.12), with 12,779 extra model calls, 8.47M tokens, 34.49 minutes of graph construction, and 47.8x retrieval latency. This profile is less suitable for continuously updated long-term user memory. We will add these and the modern RAG baselines and narrow the claim in the revised Experiments and Limitations.

W3/Q3: Retrieval metrics

Why direct retrieval-level metrics were not reported in the original comparison. LoCoMo has no official AMU-level protocol, and prior memory baselines provide no comparable mapping from rewritten memories to exhaustive AMU relevance labels. Rewriting, splitting, merging, and consolidation create many-to-many mappings among turns, memory units, and facts, making the writer part of the evaluated system. Applying passage recall, AMU hit rate, or MRR would mix incompatible units and relevance definitions; we therefore used one end-to-end QA protocol for all methods.

Can retrieval-level metrics directly verify how much correct evidence the codebook path recovers beyond dense retrieval? They can provide a supplementary source-grounded diagnostic, though not a standardized cross-system metric. MemCode's provenance pointers map retrieved AMUs to LoCoMo evidence IDs. Table R4 reports Recall@K and complete coverage@K; a branch audit counts evidence newly recovered beyond dense retrieval. After within-question deduplication, this covers 1,536 annotated questions and 2,354 unique question-evidence pairs; QA uses all 1,540 questions.

We report source-grounded Recall@K and complete coverage@K rather than AMU hit rate, MRR, or precision. LoCoMo labels supporting turns, not a unique relevant AMU or ranking, so hit rate and MRR lack required judgments. Its annotations may also omit valid support, making precision count valid but unannotated evidence as false positives.

For these source-grounded metrics, let QQ be the retrieval set, GqG_q the gold evidence dialogue IDs for question qq, and RqR_q the source IDs reached through retrieved AMUs:

MacroRecall=1∣Q∣∑q∈Q∣Rq∩Gq∣∣Gq∣,CompleteCoverage=1∣Q∣∑q∈Q1[Gq⊆Rq].\mathrm{MacroRecall} =\frac{1}{|Q|}\sum_{q\in Q}\frac{|R_q\cap G_q|}{|G_q|}, \qquad \mathrm{CompleteCoverage} =\frac{1}{|Q|}\sum_{q\in Q}\mathbf{1}[G_q\subseteq R_q].

Macro evidence Recall@K averages each question's recovered evidence fraction at the stated budget; complete coverage@K is the fraction recovering every annotated source.

Table R4 Source-grounded LoCoMo retrieval. QA uses 1,540 questions; retrieval metrics use 1,536 annotated questions; differences use unrounded values.

Retrieval configuration QA accuracy (%) Macro evidence Recall@K (%) Complete evidence coverage@K (%)
Dense-20 73.18 74.81 67.97
Dense-40 74.61 77.27 69.99
Dense-20 + Codebook-20 (Ours) 78.12 78.40 71.68

Table R4 shows codebook improves Recall@K over Dense-20 by 3.60 points (95% CI [2.84, 4.38]) and complete coverage by 3.71. Against equal-budget Dense-40, gains remain 1.13 (95% CI [0.23, 2.02]) and 1.69 points, ruling out candidate count.

The branch audit finds at least one gold source in 162/1,536 questions (10.55%), including 114 evidence instances beyond Dense-20 and 95 beyond Dense-40. It adds missing gold evidence for 103/492 Dense-20 miss cases (20.93%) and 88/461 Dense-40 miss cases (19.09%). These are source-recovery, not QA, statistics.

These results answer Q3: codebook recovers annotated evidence missed by dense retrieval, with measurable Recall@K and complete-coverage gains. This source-grounded diagnostic is not an official LoCoMo AMU benchmark because annotations may omit valid support. We will add the metrics and limitations to the revised Experiments and Limitations.

Authors · CommentOpenReview ↗

A kind reminder

Thank you again for your constructive and detailed review. We would like to kindly follow up on our response. We have seriously addressed your concerns in detail through the requested 2x2 ablation separating codebook retrieval from asynchronous consolidation, same-budget comparisons with graph-based and modern RAG methods, and retrieval-level diagnostics of evidence recovered beyond dense retrieval.

Follow-up to W1/Q1 (codebook vs. consolidation), W2/Q2 (graph-based retrieval), and W3/Q3 (retrieval-level verification). Table R1 shows that codebook retrieval contributes independently without consolidation, while the two components provide comparable and complementary gains. Tables R2--R3 show that explicit associative graph retrieval reaches statistically indistinguishable accuracy but requires substantially greater construction and query cost. Table R4 further verifies that the codebook path improves source-grounded evidence coverage beyond dense retrieval. Our claim is therefore not that associative retrieval is unique to the codebook, but that MemCode provides a lightweight associative design suited to continuously updated long-term agent memory.

We hope these controlled experiments and clarifications effectively address your concerns. We greatly value your continued feedback and participation in this discussion. Thank you once again for your time and for helping us improve the paper.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…