D-Mem: A Dual-Process Memory System for LLM Agents 

Report GitHub Issue

 × 

 Title: 

Content selection saved. Describe the issue below:

 Description: 

 Submit without GitHub 
 Submit in GitHub 

 Back to arXiv 

 Why HTML? 

 Report Issue 

 Back to Abstract 

 Download PDF 

 Abstract 

 1 Introduction 

 2 Related Work 

 2.1 Retrieval-Augmented Generation (RAG) 

 2.2 Agentic Memory for Autonomous Agents 

 3 Methodology 

 3.1 Mem0 ∗ : The System 1 Retrieval Foundation 

 Robust Query Resolution. 

 3.2 Gated Deliberation Policies 

 Policy 1: Majority Voting. 

 Policy 2: Consensus. 

 Policy 3: Quality Gating (ours). 

 3.3 Full Deliberation 

 Stage 1: Chunked Fact Extraction. 

 Stage 2: Multi-stage Filtering. 

 Stage 3: Answer Generation. 

 4 Experiments 

 4.1 Setup 

 Datasets. 

 Metrics. 

 LLMs. 

 Baselines. 

 4.2 Overall Performance 

 Comparison with Baselines. 

 Effectiveness of Dual-Process Routing. 

 Generalization and Robustness. 

 4.3 In-depth Analysis of Quality Gating 

 Per-Category Analysis 

 Impact of Filtering and Model-Specific Variations. 

 4.4 Fallback Mechanism Analysis 

 Adaptability to Dataset Complexity 

 Selection Bias in Fallback Routing. 

 Model-Specific Sensitivity in Quality Gating. 

 4.5 Case Study: Why Static Retrieval Fails 

 5 Conclusion 

 6 Limitations 

 References 

 A Prompt Templates 

 A.1 Answer Generation Prompt (Mem0) 

 A.2 Filter Prompt (Ours) 

 A.3 Fact Extraction Prompt (Ours) 

 A.4 Fact Filtering System Prompt (Ours) 

 A.5 Consensus Prompt (Ours) 

 A.6 Majority Voting Prompt (Ours) 

 A.7 Quality Gating Prompt (Ours) 

 A.8 LLM-as-a-Judge Prompt (Mem0) 

 B Implementation Details 

 B.1 Hyperparameter Settings 

 B.2 System Configuration 

 C Comprehensive Evaluation Results 

 D Computational Resources and Reproducibility 

 E Ethics Statement 

 Privacy and Data Security. 

 Environmental and Computational Impact. 

 Memory-Induced Bias and Safety. 

 F Artifact Licenses and Terms of Use 

 License: arXiv.org perpetual non-exclusive license

arXiv:2603.18631v1 [cs.AI] 19 Mar 2026

D-Mem: A Dual-Process Memory System for LLM Agents

 Zhixing You 

Einstein Institute of Mathematics 

The Hebrew University of Jerusalem, Israel 

 zhixing.you@mail.huji.ac.il 

&Jiachen Yuan 

Independent Researcher 

 yuan.jachen@gmail.com 

 Corresponding author 

 Jason Cai 

AWS AI 

 cjinglun@amazon.com 

Abstract

Driven by the development of persistent, self-adapting autonomous agents,
equipping these systems with high-fidelity memory access for long-horizon reasoning has emerged as a critical requirement.
However, prevalent retrieval-based memory frameworks
often follow an incremental processing paradigm that
continuously extracts and
updates conversational memories into vector databases,
relying on semantic retrieval when queried.
While this approach is fast,
it inherently relies on lossy abstraction,
frequently missing contextually critical information
and struggling to resolve queries that rely on fine-grained contextual understanding.
To address this, we introduce D-Mem, a dual-process
memory system. It retains lightweight vector retrieval
for routine queries while establishing an exhaustive Full
Deliberation module as a high-fidelity fallback.
To achieve cognitive economy without sacrificing
accuracy, D-Mem employs a Multi-dimensional Quality Gating policy to
dynamically bridge these two processes.
Experiments on the LoCoMo and RealTalk benchmarks using
GPT-4o-mini and Qwen3-235B-Instruct demonstrate the
efficacy of our approach. Notably, our Multi-dimensional Quality Gating
policy achieves an F1 score of 53.5 on LoCoMo with GPT-4o-mini.
This outperforms our static
retrieval baseline, Mem0 ∗ (51.2), and recovers 96.7% of the
Full Deliberation’s performance (55.3), while incurring
significantly lower computational costs. 1 1 1 Code will be released upon acceptance of the paper. 

 D-Mem: A Dual-Process Memory System for LLM Agents 

 Zhixing You † † thanks: Corresponding author 

 Einstein Institute of Mathematics 

 The Hebrew University of Jerusalem, Israel 

 zhixing.you@mail.huji.ac.il 

 Jiachen Yuan 

 Independent Researcher 

 yuan.jachen@gmail.com 

 Jason Cai 

 AWS AI 

 cjinglun@amazon.com 

 1 Introduction

The development of LLM-based autonomous agents marks a significant evolution, shifting the application focus from stateless text generators to persistent, self-adapting entities deployed in dynamic, long-horizon environments
 Xi et al. ( 2025 ); Wang et al. ( 2024 , 2026 ) . As agents operate
in increasingly complex scenarios, the capability to
accumulate experiences and self-evolve across extended interactions
becomes a critical necessity. However, this continuous adaptation is fundamentally
hindered by the static nature of deployed LLM parameters.
Despite the advent of ever-expanding context windows,
simply feeding massive dialogue histories into the model is computationally expensive and frequently exacerbates the "Lost-in-the-Middle" phenomenon
 Liu et al. ( 2024 ) . To address this,
recent frameworks like MemoryBank, Zep and Mem0
developed an incremental memory processing paradigm Zhong et al. ( 2024 ); Rasmussen et al. ( 2025 ); Chhikara et al. ( 2025 ) .
These systems
continuously extract, compress, and update
conversational memories into vector databases to
enable efficient, scalable semantic retrieval.

While highly effective for routine, explicit
queries, this paradigm introduces a critical
vulnerability for deep reasoning: lossy abstraction Zhu et al. ( 2026 ) .
By aggressively performing query-agnostic
compression—condensing continuous dialogues into
semantic snippets independent of future
queries—the system strips away potentially crucial
contextual nuances. Consequently, when faced
with queries
requiring rigorous deduction, it frequently misses
contextually critical information—such as unstated
temporal logic (e.g., relative time calculations) or
multi-hop dependencies. This leaves agents struggling with
a severe performance bottleneck: static retrieval
simply cannot reconstruct the precise logical
chains lost during compression. To address the fundamental
limitations of query-agnostic memory compression, we
introduce D-Mem, a dual-process memory system that
emulates the human cognitive process of metacognitive
monitoring Kahneman ( 2011 ); Evans and Stanovich ( 2013 ) .
Rather than abandoning efficient vector
retrieval, D-Mem leverages it as a rapid System 1 baseline (Mem0 ∗ ), while
introducing a robust System 2 fallback mechanism. D-Mem operates
on two distinct cognitive levels:

 • 

System 1 (Mem0 ∗ ):
Acting as an enhanced incremental memory processing module built upon the Mem0 architecture, this system
performs a
rapid, low-cost static retrieval (Top-K) based on
surface similarity within the compressed memory space.

 • 

System 2 (Full Deliberation): When
System 1 fails to resolve the query, the system
escalates to an exhaustive deliberate reading mode. Bypassing the
compressed memory, this module directly processes the raw dialogue
history. It executes a query-guided temporal scan,
utilizing the original question as a discriminative
anchor to systematically extract query-relevant facts
chunk-by-chunk via a quantitative scoring mechanism (0-10).
By applying strict
multi-stage filtering, it synthesizes a highly grounded, high-fidelity
answer-closely mimicking the human cognitive
process of purposeful reading.

Crucially, executing
System 2 indiscriminately incurs massive computational overhead. On the LoCoMo dataset,
it increases input tokens and inference time by
over 10 × \times compared to the fast path (see Table  1 for details). To achieve
cognitive economy, D-Mem incorporates a metacognitive
assessment step. Acting as a rigorous analytical
gatekeeper, this module evaluates the initial System 1
output against a strict multi-dimensional pass/fail
rubric—encompassing relevance, faithfulness & consistency,
and completeness. The architecture escalates to the
computationally intensive System 2 exclusively when
the initial output fails to satisfy any of these criteria,
ensuring that Full Deliberation is
triggered only by critical information deficits.

In summary,
our main contributions are as follows:

 • 

The dual-process D-Mem Framework.
To overcome the fundamental limitations of
query-agnostic memory compression, we propose D-Mem,
a novel architecture that integrates efficient
vector retrieval (System 1) with an exhaustive
deliberate reading mode (System 2). To
bridge these processes and balance cognitive economy
with reasoning accuracy, we introduce a
Multi-dimensional Quality Gating policy (hereafter, Quality Gating).
Serving as a metacognitive checkpoint, it offers an
accuracy-efficiency trade-off.

 • 

Full Deliberation as a robust baseline. We
establish a Full Deliberation method that exhaustively
processes raw dialogue history chunk-by-chunk. Because
this extraction mechanism is strictly query-guided,
it ensures that explicit, nuanced details are meticulously
preserved. Furthermore, its chunk-by-chunk processing
effectively mitigates the "Lost-in-the-Middle" phenomenon.
By establishing this high-fidelity upper bound,
we isolate a critical bottleneck shift: to surpass
this baseline, future long memory architectures must
evolve beyond extracting explicit facts to actively
capturing and synthesizing implicit information across
longitudinal history.

 • 

High Performance with Computational Efficiency. Through
comprehensive evaluations on the LoCoMo Maharana et al. ( 2024 ) and RealTalk Lee et al. ( 2025 ) 
benchmarks using GPT-4o-mini and Qwen3-235B-Instruct,
we demonstrate the efficacy of our framework. Notably,
our Quality Gating achieves an F1 score of 53.5
on LoCoMo and exhibits consistent substantial gains on RealTalk.
This outperforms our Mem0 ∗ (51.2) and
recovers 96.7% of the
Full Deliberation’s performance (55.3)
with significantly fewer tokens and inference time.

 2 Related Work

 2.1 Retrieval-Augmented Generation (RAG)

Standard RAG retrieves documents via dense similarity
and feeds them to a generator. Subsequent work has
improved this pipeline through query
expansion  (Zhang et al. , 2024 ) ,
re-ranking  (Yu et al. , 2024 ) , relevance
filtering  (Rossi et al. , 2024 ) , and
query-transformation  (Zheng et al. , 2024 ) .
These techniques refine how to
retrieve.
Recent Agentic RAG paradigm
actively assess their own information needs,
refines whether retrieval is sufficient
 (Asai et al. , 2024 ; Xu et al. , 2026 ) .

 2.2 Agentic Memory for Autonomous Agents

Early frameworks like MemGPT (Packer et al. , 2024 ) 
introduced operating system-inspired virtual context
management via hierarchical paging.
Other memory systems
like Mem0 (Chhikara et al. , 2025 ) and MemoryBank
 (Zhong et al. , 2024 ) employ an incremental
processing paradigm that continuously extracts and
updates conversational memories into vector databases.
Such aggressive vectorization inherently fragments semantic context.
To preserve relational integrity, recent works have explored structural
optimizations. For instance,
G-Memory (Zhang et al. , 2025 ) and Mem0 g (Chhikara et al. , 2025 ) 
construct graph-based hierarchies,
and A-Mem (Xu et al. , 2025 ) utilizes interconnected notes.
Despite these structural enhancements, these methods remain
fundamentally query-agnostic. Because the memory representation
is aggressively compressed and pre-fixed during the storage phase,
they inevitably suffer from lossy abstraction —stripping
away nuanced temporal and causal logic.

To circumvent the pitfalls of lossy abstraction,
recent advancements like GAM (Yan et al. , 2025 ) 
and E-mem (Wang et al. , 2026 ) entirely abandon query-agnostic compression.
Instead, they pivot towards episodic context reconstruction and multi-agent
deliberative paradigms, prioritizing reasoning fidelity by exhaustively
processing raw, uncompressed historical context.
However, discarding lightweight retrieval to apply such heavy
deliberation indiscriminately incurs a massive, inflexible computational
overhead. This approach ignores the "cognitive economy" of System 1,
where the majority of routine queries can be efficiently resolved
via rapid semantic recall, obviating the need for deep episodic reconstruction.

 3 Methodology

 Figure 1: Architectural overview of D-Mem. Components of
Part A illustrates the memory mechanism of Mem0 ∗ .
The elements highlighted in soft pale pink
denote our
key modifications over the original Mem0
framework: (1) utilizing the top-10 similar
memories rather than a general summary during
the Extraction Phase, and (2) incorporating an
additional relevance filtering step prior to
memory updates. Part B illustrates the Quality
Gating mechanism, which evaluates the initial answer
from Mem0 ∗ and dynamically determines whether to trigger the
Full Deliberation fallback. 

To circumvent the pitfalls of lossy abstraction
inherent in prior designs while maintaining
computational efficiency, we introduce D-Mem,
a dual-process memory architecture. The framework
is operationalized through three coupled components:
(1) Mem0 ∗ serves as the foundational
lightweight retrieval module. It improves upon
the standard Mem0 paradigm by efficiently
extracting and updating salient conversational
memories within a vector database, designed to
rapidly resolve the majority of routine queries.
(2) The Quality Gating acts as a
dynamic evaluative router. It evaluates the initially retrieved context from
Mem0 ∗ against a multi-dimensional quality
rubric.
Specifically, the gate assesses the retrieved
memory along three orthogonal dimensions:
 Relevance , Faithfulness & Consistency , and Completeness .
If the retrieved context falls short on any of these axes,
the gate triggers the fallback mechanism.
(3) The Full
Deliberation mechanism provides a high-fidelity
fallback. Triggered exclusively when the quality
gate deems the lightweight retrieval inadequate,
this module bypasses compressed representations
to exhaustively process the raw, uncompressed
historical context. By structurally decoupling
routine semantic recall from
resource-intensive exhaustive full deliberation,
D-Mem enables high-fidelity reasoning for
complex queries while preserving strict
cognitive economy.

 3.1 Mem0 ∗ : The System 1 Retrieval Foundation

The Mem0 ∗ module follows an incremental processing paradigm
and serves as our foundational System 1, enabling fast associative retrieval.
As illustrated in Figure  1  Part A,
this module comprises two phases: extraction phase and update phase .

Formally, to reflect the dynamic nature of
incremental processing, we model the
conversation as a continuous stream. Let
 ℋ t − 1 = ( m 1 , m 2 , … , m 2 ​ t − 2 ) \mathcal{H}_{t-1}=(m_{1},m_{2},\dots,m_{2t-2}) 
denote the accumulated dialogue history prior to
the t t -th interaction round. Each message m i m_{i} 
represents an individual utterance augmented with
timestamp and speaker metadata. The maintenance
pipeline dynamically triggers upon the ingestion
of the new interaction round at step t t , defined
as the message pair ( m 2 ​ t − 1 , m 2 ​ t ) (m_{2t-1},m_{2t}) .

 • 

 Extraction Phase: Mem0 ∗ 
conditions the LLM on two complementary
sources: (1) the top- 10 10 most semantically similar
existing memories ℱ \mathcal{F} retrieved from the vector database,
and (2) recent messages ( m 2 ​ t − 10 , … , m 2 ​ t − 2 ) (m_{2t-10},\dots,m_{2t-2}) 
from ℋ t − 1 \mathcal{H}_{t-1} . Here ℱ \mathcal{F} serves as a
dynamic background context and the recent
message sequence offers granular temporal
context. This dual contextual information,
combined with the new message pair, forms
a comprehensive input for the LLM to extract
salient memories Ω = { ω 1 , … , ω n } \Omega=\{\omega_{1},\dots,\omega_{n}\} .

 • 

 Update Phase: Once the set of
candidate memories Ω \Omega is extracted, the system
retrieves the top-5 semantically similar historical
memories for each ω i ∈ Ω \omega_{i}\in\Omega via vector
embeddings. To minimize cognitive load and mitigate
noise, low-relevance items are explicitly discarded
using a strict cosine similarity threshold ( > 0.8 >0.8 ).
The retained historical memories constitute the
contextual background ℬ \mathcal{B} .
Subsequently, an LLM cross-references the newly
extracted memories Ω \Omega against the contextual
background ℬ \mathcal{B} to evaluate potential
contradictions and redundancies.
This dictates precise memory operations
for memories in ℬ \mathcal{B} and Ω \Omega :
 ADD , UPDATE , DELETE , or
 NOOP .

Robust Query Resolution.

During inference, given a user query q q ,
Mem0 ∗ retrieves the top-30 most similar memories C C 
and generates an initial answer A i ​ n ​ i ​ t = LLM ​ ( q , C ) A_{init}=\text{LLM}(q,C) .

To further mitigate hallucination,
we also employ a rigorous filtering pipeline to
derive a highly refined context C ′ C^{\prime} :

To filter out noise memories in C C , an LLM
evaluates the initial context C C against the query q q .
It retains only strictly necessary memories C f ​ i ​ l ​ t ​ e ​ r C_{filter} to answer
 q q . In the edge case where aggressive filtering
eliminates all candidates (i.e., C f ​ i ​ l ​ t ​ e ​ r = ∅ C_{filter}=\emptyset ), the system conservatively falls back
to the original unfiltered context C C to
preserve recall.

 3.2 Gated Deliberation Policies

To operationalize the routing between the Mem0 ∗ 
and the Full Deliberation fallback (as mentioned in Subsection  3.3 ),
we formalize a Gating Policy 𝒢 \mathcal{G} .

Formally, given the initial answer A i ​ n ​ i ​ t A_{init} ,
the user query q q , and the retrieved context
 C C , we define the gating function 𝒢 \mathcal{G} :

 𝒢 : ( A i ​ n ​ i ​ t , q , C ) → { 0 , 1 } . \mathcal{G}:(A_{init},q,C)\rightarrow\{0,1\}. 

Here, the system outputs A i ​ n ​ i ​ t A_{init} if 𝒢 ​ ( … ) = 0 \mathcal{G}(\dots)=0 ,
and it executes the
full deliberation if 𝒢 ​ ( A i ​ n ​ i ​ t , q , C ) = 1 \mathcal{G}(A_{init},q,C)=1 .

To comprehensively evaluate this dual-process
routing, we investigate three distinct
 gated deliberation policies :

Policy 1: Majority Voting.

The system generates three candidate answers from
the same Top-30 context (with temperature > 0 >0 
for diversity). A judge determines whether a
 majority consensus exists—i.e., at
least two of the three answers are semantically
equivalent. If a majority exists, one answer is
selected from the majority group (e.g., by
preferring clarity and verbatim extraction);
otherwise 𝒢 ​ ( A i ​ n ​ i ​ t , q , C ) = 1 \mathcal{G}(A_{init},q,C)=1 and
the system falls back to Full Deliberation.

Policy 2: Consensus.

As in Majority Voting, three answers are generated
from Top-30 retrieval. The trigger requires
 full semantic agreement: all three
answers must be equivalent. If any answer differs,
 𝒢 ​ ( A i ​ n ​ i ​ t , q , C ) = 1 \mathcal{G}(A_{init},q,C)=1 and the system
invokes Full Deliberation.
This policy is stricter than Majority Voting and
triggers fallback more often.

Policy 3: Quality Gating (ours).

An LLM checks the quality of the initial answer A i ​ n ​ i ​ t A_{init} 
against a quality rubric with three
dimensions: Relevance , Faithfulness & Consistency ,
and Completeness .
If the answer successfully passes all three dimensions,
then the system returns A i ​ n ​ i ​ t A_{init} ; otherwise,
 𝒢 ​ ( A i ​ n ​ i ​ t , q , C ) = 1 \mathcal{G}(A_{init},q,C)=1 
and the system falls back to Full Deliberation.

 3.3 Full Deliberation

The Full Deliberation mechanism serves
both as a new baseline and as the
fallback path for all Gated Deliberation policies.
Instead of relying on semantic search, it
processes the complete conversation
history through three stages:

Stage 1: Chunked Fact Extraction.

The conversation is partitioned into chunks of 60
messages each. For each chunk, an LLM
extracts query-relevant facts and assigns a
relevance score (0–10). A sliding context
window of 4 preceding messages maintains
continuity 

... [OUTPUT TRUNCATED - 22229 chars omitted out of 72229 total] ...

 Twelfth International Conference on Learning Representations ,

 External Links: Link 

 Cited by: §2.1 .

 W. Zhong, L. Guo, Q. Gao, H. Ye, and Y. Wang (2024) 
 MemoryBank: enhancing large language models with long-term memory .

 In Proceedings of the Thirty-Eighth AAAI Conference on Artificial Intelligence and Thirty-Sixth Conference on Innovative Applications of Artificial Intelligence and Fourteenth Symposium on Educational Advances in Artificial Intelligence ,

 AAAI’24/IAAI’24/EAAI’24 .

 External Links: ISBN 978-1-57735-887-9 ,
 Link ,
 Document 

 Cited by: §1 ,
 §2.2 .

 S. Zhou and J. Han (2025) 
 A simple yet strong baseline for long-term conversational memory of llm agents .

 External Links: 2511.17208 ,
 Link 

 Cited by: §4.1 ,
 Table 1 .

 Q. Zhu, S. Chen, R. Yu, Z. Wu, and B. Wang (2026) 
 From lossy to verified: a provenance-aware tiered memory for agents .

 External Links: 2602.17913 ,
 Link 

 Cited by: §1 .

 Appendix A Prompt Templates

In this section, we provide the complete prompt templates used in our experiments.
For the sake of reproducibility and fair comparison,
the prompts utilized for the static retrieval baseline and the evaluation judge are sourced from the mem0 open-source repository Chhikara et al. ( 2025 ) . Templates specifically designed for our Multi-dimensional Quality Gating and Full Deliberation modules are denoted with “(Ours)”.

 A.1 Answer Generation Prompt (Mem0)

The following prompt is used for generating answers from retrieved memories in all methods:

 ⬇ 

 You are an intelligent memory assistant tasked with retrieving 

 accurate information from conversation memories . 

 # CONTEXT : 

 You have access to memories from two speakers in a conversation . 

 These memories contain timestamped information that may be 

 relevant to answering the question . 

 # INSTRUCTIONS : 

 1. Carefully analyze all provided memories from both speakers 

 2. Pay special attention to the timestamps to determine the answer 

 3. If the question asks about a specific event or fact , look for 

 direct evidence in the memories 

 4. If the memories contain contradictory information , prioritize 

 the most recent memory 

 5. If there is a question about time references ( like " last year ", 

 " two months ago ", etc .), calculate the actual date based on the 

 memory timestamp . For example , if a memory from 4 May 2022 

 mentions " went to India last year ," then the trip occurred in 2021. 

 6. Always convert relative time references to specific dates , months , 

 or years . For example , convert " last year " to "2022" or " two 

 months ago " to " March 2023" based on the memory timestamp . 

 Ignore the reference while answering the question . 

 7. Focus only on the content of the memories from both speakers . 

 Do not confuse character names mentioned in memories with the 

 actual users who created those memories . 

 8. The answer should be less than 5-6 words . 

 9. If the memory information is insufficient to answer the question , 

 respond with " NONE ". 

 # APPROACH ( Think step by step ): 

 1. First , examine all memories that contain information related 

 to the question 

 2. Examine the timestamps and content of these memories carefully 

 3. Look for explicit mentions of dates , times , locations , or events 

 that answer the question 

 4. If the answer requires calculation ( e . g ., converting relative 

 time references ), show your work 

 5. Formulate a precise , concise answer based solely on the evidence 

 in the memories 

 6. Double - check that your answer directly addresses the question asked 

 7. Ensure your final answer is specific and avoids vague time references 

 Memories for user {{ speaker_1_user_id }}: 

 {{ speaker_1_memories }} 

 Memories for user {{ speaker_2_user_id }}: 

 {{ speaker_2_memories }} 

 Question : {{ question }} 

 Answer : 

 A.2 Filter Prompt (Ours)

This prompt is used in the Filter method to filter irrelevant memories:

 ⬇ 

 You are an AI assistant that selects which memory items are 

 relevant to the user ’ s question . 

 Instructions : 

 - Only output the indexes of memory items that are relevant 

 to the question . 

 - If none are relevant , output an empty list []. 

 - Do not answer the question . 

 - Be strict : only select items that clearly help answer the question . 

 User question : "{ user_question }" 

 Memory items : 

 1. { memory_1 } 

 2. { memory_2 } 

 3. { memory_3 } 

 ... 

 Output format ( JSON array of indexes ): 

 [ ... ] 

 A.3 Fact Extraction Prompt (Ours)

This prompt is used in the Full Deliberation method to extract relevant facts from conversation history:

 ⬇ 

 You are a Personal Information Organizer , specialized in accurately 

 extracting and scoring facts from conversations . 

 # ROLE : 

 - Your job is to extract ** relevant facts ** from a given conversation . 

 - Each extracted fact must directly support answering the user ’ s question . 

 # INPUT : 

 - A user question 

 - ** History **: Previous conversation messages for context . 

 * DO NOT * extract from this section . 

 - ** Conversation **: Current conversation chunk to extract facts from . 

 ** Your task is to extract new facts learned * only * from this section ** 

 based on user question and History . 

 # INSTRUCTIONS : 

 1. Extract only the facts from ** Conversation ** that can ** help answer 

 the given question **. Ignore irrelevant parts . 

 2. The extracted fact ** must be a complete , standalone statement **. 

 - Include ** timestamp and speaker ** for every fact . 

 - ** Resolve pronouns ** ( like " it ", " they ") using the conversation context . 

 - Pay attention to ** contextual meaning **. 

 3. Assign a ** relevance score (0-10)**: 

 - 0 = Irrelevant 

 - 5-6 = Somewhat relevant 

 - 7-8 = Clearly relevant 

 - 9-10 = Essential for answering the question 

 4. Output must be in ** strict JSON format ** as a * list * of * objects *, 

 wrapped under a single " facts " key . 

 Each object in the list must contain ** EXACTLY TWO KEYS **: 

 - " fact ": ( string ) The resolved statement with timestamp / speaker . 

 - " score ": ( integer ) The relevance score (0-10). 

 - Only include facts with a ** score >= 5**. 

 - If no fact qualifies , return {" facts ": []}. 

 A.4 Fact Filtering System Prompt (Ours)

This prompt is used in the Full Deliberation method to further filter extracted facts:

 ⬇ 

 You are an AI Relevance Filter . Your task is to analyze a list of 

 numbered memory items and select * only * the indexes of the items 

 that are strictly necessary and relevant to answer a user ’ s question . 

 # Instructions : 

 - Return a JSON object with a single key " indexes ", which contains 

 an array of the relevant memory indexes . 

 - ** IMPORTANT : Indexes start from 1. The first item is index 1, 

 the second is index 2, and so on .** 

 - Select memory items that : 

 1. Provide facts , dates , events , or context that directly help 

 answer the question . 

 2. Contain key details for a correct and complete answer . 

 3. Be strict : only memory items that clearly help answer the 

 question should be selected . 

 - Avoid : 

 - Memory items unrelated to the question . 

 - Vague or duplicate entries ( if two items are almost the same , 

 keep only one ). 

 - If no relevant memory exists , return {" indexes ": []}. 

 - ** Do not answer the question .** 

 # Output Format 

 Return * only * a valid JSON object with an " indexes " key . 

 Example : {" indexes ": [1, 3]} 

 A.5 Consensus Prompt (Ours)

This prompt is used in the Consensus policy to check if all three generated answers are semantically equivalent:

 ⬇ 

 You are a Semantic Consistency Judge . 

 Task : Analyze a Question and 3 Candidate Answers to determine if 

 all answers are semantically equivalent . 

 # Judgement Criteria : 

 1. ** True Match ( Equivalent ):** 

 - ** Formatting :** "2023-01-01" == " Jan 1, 2023". 

 - ** Abbreviation :** " NYC " == " New York City ". 

 - ** Structure :** " $50 " == " It is $50 ". 

 - ** Context :** Use the ’ Question ’ to resolve ambiguities . 

 2. ** List / Set Logic ( Multiple Items ):** 

 - ** Order Independence :** " Red , Blue " == " Blue , Red " ( Unless 

 the question explicitly asks for a ranked order ). 

 - ** Delimiters :** " Apple , Banana " == " Apple and Banana ". 

 - ** Completeness :** All items must be present . " A , B " != " A , B , C " 

 ( Mismatch ). 

 3. ** Mismatch ( Not Equivalent ):** 

 - ** Contradiction :** " Yes " != " No ". 

 - ** Different Values :** "100 m " != "1 km ". 

 - ** Partial / Missing :** " Paris " != " Paris , Texas " ( if specific 

 location is needed ). 

 - ** Subset / Superset :** If one answer has 3 items and another 

 has 2, it is a mismatch . 

 4. ** Selection Logic ( If Match ):** 

 - ** STRICT EXTRACTION :** You MUST choose one answer ** VERBATIM ** 

 from the provided ’ Answers ’ list . 

 - ** Priority Hierarchy ( Apply in order ):** 

 - ** Step A ( Strip Fillers ):** Avoid answers containing 

 conversational fillers like " It is ", " The answer is ", 

 " I think ", " Confirmed ". 

 - ** Step B ( Maximize Clarity ):** Between the remaining options , 

 prefer the one with ** standard formatting ** over extreme 

 abbreviations or ambiguity . 

 - ** Step C ( Tie - Breaker ):** If both are clear and have no fillers , 

 select the ** Shortest ** one . 

 - ** NO EDITING :** Do not remove words . 

 # Output Format ( MUST be valid JSON ): 

 - If ALL 3 match : 

 {" consensus ": true , " answer ": " answer "} 

 - If ANY differ : 

 {" consensus ": false } 

 # Constraints : 

 - Output ONLY valid JSON . NO Markdown , NO extra text . 

 - When consensus is true , " answer " MUST be one of the provided 

 Answers strings verbatim . 

 A.6 Majority Voting Prompt (Ours)

This prompt is used in the Majority Voting policy
to check if at least 2 out of 3 generated answers are
semantically equivalent:

 ⬇ 

 You are a Majority Consistency Judge . 

 Task : Analyze a Question and 3 Answers . Determine if there is a 

 ** majority consensus ** ( at least 2 out of 3 answers share the same 

 semantic meaning ). 

 # Judgement Logic : 

 1. ** Semantic Grouping :** 

 - Compare the meanings of Answer 1, 2, and 3. 

 - " Jan 2023" == " January 2023" ( Match ). 

 - " Paris " != " London " ( Mismatch ). 

 2. ** Majority Rule :** 

 - **3/3 Match :** All three are equivalent . -> Consensus FOUND . 

 - **2/3 Match :** Two answers are equivalent , one is an outlier . 

 -> Consensus FOUND ( Ignore the outlier ). 

 - **0 Matches :** All three are different . -> Consensus NOT FOUND . 

 # Selection Logic ( If Consensus Found ): 

 1. ** Filter :** Consider ONLY the answers that form the majority group . 

 ( Discard the outlier ). 

 2. ** Strict Extraction :** You MUST select one answer ** VERBATIM ** 

 ( word - for - word ) from the majority group . 

 3. ** Priority Hierarchy ( Apply in order ):** 

 - ** Step A ( Strip Fillers ):** Avoid answers containing 

 conversational fillers like " It is ", " The answer is ", 

 " I think ", " Confirmed ". 

 - ** Step B ( Maximize Clarity ):** Between the remaining options , 

 prefer the one with ** standard formatting ** over extreme 

 abbreviations or ambiguity . 

 - ** Step C ( Tie - Breaker ):** If both are clear and have no fillers , 

 select the ** Shortest ** one . 

 # Output Format ( MUST be valid JSON ): 

 - If Majority exists : 

 {" consensus ": true , " answer ": "< one original answer string 

 verbatim from Answers >"} 

 - If NO Majority : 

 {" consensus ": false } 

 # Constraints : 

 - Output ONLY valid JSON . NO Markdown , NO extra text . 

 - When consensus is true , " answer " MUST be one of the provided 

 Answers strings verbatim . 

 - ** NEVER ** pick the outlier answer . 

 A.7 Quality Gating Prompt (Ours)

This prompt is used in the Quality Gating policy
to evaluate answer quality and trigger
Full Deliberation:

 ⬇ 

 You are the ** Answer Quality Auditor **. Your task is to act as a strict gatekeeper for a RAG system . 

 ### Input Data 

 # memories 

 {{ speaker_1_memories }} 

 {{ speaker_2_memories }} 

 # question 

 {{ question }} 

 # answer 

 {{ answer }} 

 ### Evaluation Protocol ( Execute in Order ) 

 #### 1. Relevance 

 - ** Check **: Does the Answer directly and fully address the Question ? 

 - ** Rule **: 

 - ** Irrelevant **: Off - topic ? -> FAIL . 

 - ** Vagueness **: If memories are vague and Answer admits it -> PASS . 

 - ** Retrieval Trigger **: If the answer is information is missing , mark as FAIL . 

 - ** Output **: {" relevance ": " pass " | " fail "} 

 #### 2. Faithfulness & Consistency ( Fact Check ) 

 - ** Check **: Does the Answer contradict the Memories ? 

 - ** Rule **: 

 - ** Hallucination **: Does it contain info NOT in memories ? -> FAIL . 

 - ** Conflict **: Does it contradict the latest memory timestamp ? -> FAIL . 

 - ** Logic Separation **: Do NOT mark math / time errors here ( handle them in Logic Check ). 

 - ** Output **: {" faithfulness ": " pass " | " fail "} 

 #### 3. Completeness & Relevance 

 - ** Check **: Does the Answer directly and fully address the Question ? 

 - ** Rule **: 

 - ** Irrelevant **: Off - topic ? -> FAIL . 

 - ** Incomplete **: Misses key details requested ? -> FAIL . 

 - ** Vagueness **: If memories are vague and Answer admits it -> PASS . 

 - ** Retrieval Trigger **: If the answer is " I don ’ t know " or information is missing , mark as FAIL . 

 - ** Output **: {" completeness_relevance ": " pass " | " fail "} 

 ### Output Format ( JSON ) 

 Return ONLY valid JSON . 

 { 

 " relevance ": { 

 " status ": " pass " | " fail " 

 }, 

 " faithfulness ": { 

 " status ": " pass " | " fail " 

 }, 

 " completeness_relevance ": { 

 " status ": " pass " | " fail " 

 } 

 } 

 A.8 LLM-as-a-Judge Prompt (Mem0)

This prompt is used to evaluate the quality of generated answers using an LLM as a judge:

 ⬇ 

 Your task is to label an answer to a question as ’ CORRECT ’ or ’ WRONG ’. You will be given the following data : 

 (1) a question ( posed by one user to another user ), 

 (2) a ’ gold ’ ( ground truth ) answer , 

 (3) a generated answer 

 which you will score as CORRECT / WRONG . 

 The point of the question is to ask about something one user should know about the other user based on their prior conversations . 

 The gold answer will usually be a concise and short answer that includes the referenced topic , for example : 

 Question : Do you remember what I got the last time I went to Hawaii ? 

 Gold answer : A shell necklace 

 The generated answer might be much longer , but you should be generous with your grading - as long as it touches on the same topic as the gold answer , it should be counted as CORRECT . 

 For time related questions , the gold answer will be a specific date , month , year , etc . The generated answer might be much longer or use relative time references ( like " last Tuesday " or " next month "), but you should be generous with your grading - as long as it refers to the same date or time period as the gold answer , it should be counted as CORRECT . Even if the format differs ( e . g ., " May 7 th " vs "7 May "), consider it CORRECT if it ’ s the same date . 

 Now it ’ s time for the real question : 

 Question : { question } 

 Gold answer : { gold_answer } 

 Generated answer : { generated_answer } 

 First , provide a short ( one sentence ) explanation of your reasoning , then finish with CORRECT or WRONG . 

 Do NOT include both CORRECT and WRONG in your response , or it will break the evaluation script . 

 Just return the label CORRECT or WRONG in a json format with the key as " label ". 

 Appendix B Implementation Details

 B.1 Hyperparameter Settings

Key hyperparameters used in our experiments:

 • 

 TopK : 30 (number of memories retrieved per speaker)

 • 

 Temperature for Answer Generation : 0.0 (deterministic)

 • 

 Temperature for Multiple Answers : 0.7 (for diversity in Majority Voting and Consensus methods)

 • 

 MESSAGES_CHUNK_SIZE : 60 (messages per chunk in Full Deliberation method)

 • 

 HISTORY_SIZE : 4 (previous messages as context in Full Deliberation method)

 • 

 Preliminary Score Threshold : 6 (minimum relevance score for filtering in Full Deliberation method)

 • 

 LLM Filter Threshold : 6 (minimum facts to trigger LLM-based filtering)

 • 

 Fact Extraction Score Threshold : 5 (minimum relevance score for extraction in Full Deliberation method)

 B.2 System Configuration

 • 

 Vector Store : Qdrant (local instance)

 • 

 Embedding Model : OpenAI’s text-embedding-3-small 

 • 

 API Providers : OpenAI (GPT-4o-mini), Qwen (Qwen3-235B-Instruct)

 Appendix C Comprehensive Evaluation Results

In the main text, due to space constraints, we
present the aggregated performance and key
analytical visualizations of our proposed D-Mem
framework. In this section, we provide the
complete, fine-grained evaluation results across all tested dimensions, datasets, and base models.

 • 

 Table 3 : Full results on the LoCoMo dataset using GPT-4o-mini. This table also includes results from prior baseline frameworks (LangMem, Mem0, RAG, Zep, Nemori) for a comprehensive historical comparison.

 • 

 Table 4 : Full results on the RealTalk dataset using GPT-4o-mini. Note that RealTalk inherently excludes Single-Hop questions.

 • 

 Table 5 : Full results on the LoCoMo dataset using the Qwen3-235B-Instruct model.

 • 

 Table 6 : Full results on the RealTalk dataset using the Qwen3-235B-Instruct model.

These detailed tables substantiate the core claims made in Section 4 (Main Paper), particularly demonstrating the consistent superiority of our Multi-dimensional Quality Gating policy in balancing high-fidelity reasoning with cognitive economy.

 Table 3: Overall Performance Comparison (LoCoMo, GPT-4o-mini) 

 Method 
 F1 Score 
 LLM-as-a-Judge 
 BLEU 
 Efficiency 

 S-H 
 M-H 
 Temp 
 O-D 
 Avg 
 S-H 
 M-H 
 Temp 
 O-D 
 Avg 
 S-H 
 M-H 
 Temp 
 O-D 
 Avg 
 In 
 Out 
 Time 

 Full Context 
 53.1 
 35.4 
 44.1 
 24.5 
 46.2 
 83.0 
 66.8 
 56.2 
 48.6 
 72.3 
 44.7 
 26.1 
 36.1 
 17.2 
 37.8 
 – 
 – 
 – 

 LangMem 
 38.8 
 33.5 
 31.9 
 29.4 
 35.8 
 61.4 
 52.4 
 24.9 
 47.6 
 51.3 
 33.1 
 23.9 
 26.2 
 23.5 
 29.4 
 – 
 – 
 – 

 Mem0 
 44.4 
 34.3 
 44.4 
 27.1 
 41.5 
 68.1 
 60.3 
 50.4 
 40.6 
 61.3 
 37.7 
 25.2 
 37.6 
 19.4 
 34.2 
 – 
 – 
 – 

 RAG 
 22.2 
 18.6 
 19.5 
 19.0 
 20.8 
 32.0 
 31.3 
 23.7 
 32.6 
 30.2 
 18.6 
 11.7 
 15.7 
 13.5 
 16.4 
 – 
 – 
 – 

 Zep 
 39.7 
 27.5 
 44.8 
 22.9 
 37.5 
 63.2 
 50.5 
 58.9 
 39.6 
 58.5 
 33.7 
 19.3 
 38.1 
 15.7 
 30.9 
 – 
 – 
 – 

 Nemori 
 54.4 
 36.5 
 56.7 
 20.8 
 49.5 
 82.1 
 65.3 
 71.0 
 44.8 
 74.4 
 43.2 
 25.6 
 46.6 
 15.1 
 38.5 
 – 
 – 
 – 

 Basic Methods 

 Mem0 ∗ 

 55.2 
 38.8 
 59.3 
 25.8 
 51.2 
 79.2 
 63.8 
 73.2 
 40.6 
 72.7 
 45.5 
 27.0 
 48.3 
 19.4 
 41.1 
 2186.2 
 5.2 
 1.278 

 Filter 
 54.3 
 41.0 
 61.0 
 27.9 
 51.6 
 78.4 
 67.4 
 75.7 
 50.0 
 74.0 
 45.2 
 29.4 
 48.8 
 20.8 
 41.6 
 3161.7 
 28.5 
 2.673 

 Gated Deliberation 

 Majority Voting 
 54.5 
 40.2 
 60.2 
 25.1 
 51.3 
 79.1 
 65.6 
 72.0 
 46.9 
 73.1 
 45.1 
 27.9 
 49.2 
 18.4 
 41.1 
 7501.4 
 32.6 
 3.318 

 Consensus 
 57.5 
 42.2 
 61.5 
 25.3 
 53.5 
 83.5 
 68.4 
 72.9 
 44.8 
 76.1 
 47.3 
 30.3 
 49.6 
 19.9 
 43.0 
 15543.6 
 213.0 
 9.549 

 Quality Gating (ours) 
 57.1 
 41.4 
 62.0 
 29.9 
 53.5 
 83.0 
 68.8 
 73.2 
 50.0 
 76.3 
 47.2 
 29.8 
 50.3 
 22.4 
 43.1 
 12524.6 
 156.6 
 8.03 

 Full Deliberation 
 58.9 
 44.2 
 63.0 
 31.1 
 55.3 
 83.1 
 73.4 
 77.9 
 54.2 
 78.4 
 48.2 
 32.0 
 50.6 
 24.0 
 44.2 
 34805.0 
 629.9 
 23.725 

 Table 4: Overall Performance Comparison (RealTalk, GPT-4o-mini) 

 Method 
 F1 Score 
 LLM-as-a-Judge 
 BLEU 
 Efficiency 

 M-H 
 Temp 
 O-D 
 Avg 
 M-H 
 Temp 
 O-D 
 Avg 
 M-H 
 Temp 
 O-D 
 Avg 
 In 
 Out 
 Time 

 Basic Methods 

 Mem0 ∗ 

 32.0 
 47.5 
 21.7 
 37.3 
 51.2 
 68.0 
 54.6 
 59.1 
 23.5 
 26.1 
 17.0 
 23.7 
 2296.5 
 6.0 
 3.272 

 Filter 
 33.2 
 48.3 
 24.0 
 38.4 
 54.8 
 68.7 
 53.7 
 60.7 
 24.6 
 27.3 
 17.8 
 24.8 
 3345.1 
 31.3 
 4.140 

 Gated Deliberation 

 Majority Voting 
 31.6 
 48.2 
 22.2 
 37.5 
 53.2 
 69.6 
 53.7 
 60.4 
 22.6 
 27.0 
 17.3 
 23.7 
 8738.5 
 55.2 
 5.404 

 Consensus 
 34.4 
 49.1 
 22.8 
 39.1 
 57.5 
 69.6 
 54.6 
 62.4 
 24.4 
 28.2 
 17.3 
 25.0 
 21563.9 
 385.2 
 15.446 

 Quality Gating (ours) 
 33.6 
 50.6 
 22.7 
 39.4 
 55.2 
 70.9 
 58.3 
 62.5 
 24.3 
 29.0 
 17.7 
 25.4 
 16555.2 
 231.1 
 13.003 

 Full Deliberation 
 36.4 
 50.1 
 24.4 
 40.6 
 59.5 
 68.0 
 56.5 
 62.8 
 27.9 
 30.0 
 18.3 
 27.4 
 47955.0 
 816.5 
 27.951 

 Table 5: Overall Performance Comparison (LoCoMo, Qwen3-235B-Instruct) 

 Method 
 F1 Score 
 LLM-as-a-Judge 
 BLEU 
 Efficiency 

 S-H 
 M-H 
 Temp 
 O-D 
 Avg 
 S-H 
 M-H 
 Temp 
 O-D 
 Avg 
 S-H 
 M-H 
 Temp 
 O-D 
 Avg 
 In 
 Out 
 Time 

 Mem0 (Baseline) 
 38.0 
 29.5 
 42.5 
 16.3 
 36.0 
 58.0 
 52.5 
 49.8 
 37.5 
 54.0 
 31.7 
 20.1 
 35.1 
 13.1 
 29.1 
 1977.9 
 5.7 
 0.702 

 Basic Methods 

 Mem0 ∗ 

 51.7 
 41.5 
 51.8 
 22.6 
 48.1 
 79.9 
 74.8 
 65.7 
 59.4 
 74.7 
 45.4 
 32.1 
 38.1 
 18.0 
 39.7 
 2431.2 
 11.6 
 1.518 

 Filter 
 52.8 
 41.6 
 59.1 
 24.5 
 50.3 
 79.8 
 74.5 
 77.0 
 57.3 
 76.8 
 46.7 
 32.5 
 44.6 
 20.3 
 42.0 
 3521.8 
 32.5 
 2.713 

 Gated Deliberation 

 Majority Voting 
 52.6 
 41.3 
 54.9 
 23.8 
 49.2 
 80.5 
 75.9 
 67.0 
 57.3 
 75.4 
 46.2 
 32.4 
 40.6 
 18.2 
 40.8 
 9059.9 
 89.0 
 4.407 

 Consensus 
 54.6 
 43.4 
 56.8 
 23.4 
 51.1 
 81.9 
 75.9 
 67.9 
 58.3 
 76.4 
 48.0 
 33.8 
 42.6 
 17.3 
 42.4 
 15187.2 
 219.3 
 7.840 

 Quality Gating (ours) 
 54.2 
 44.5 
 55.9 
 25.8 
 51.0 
 83.7 
 78.7 
 70.1 
 61.5 
 78.6 
 47.8 
 34.6 
 42.4 
 21.7 
 42.6 
 15319.4 
 254.7 
 8.560 

 Full Deliberation 
 56.6 
 47.7 
 58.8 
 28.6 
 53.7 
 83.6 
 78.7 
 71.7 
 57.3 
 78.6 
 49.6 
 38.2 
 45.3 
 25.0 
 45.1 
 38488.9 
 611.6 
 17.032 

 Table 6: Overall Performance Comparison (RealTalk, Qwen3-235B-Instruct) 

 Method 
 F1 Score 
 LLM-as-a-Judge 
 BLEU 
 Efficiency 

 M-H 
 Temp 
 O-D 
 Avg 
 M-H 
 Temp 
 O-D 
 Avg 
 M-H 
 Temp 
 O-D 
 Avg 
 In 
 Out 
 Time 

 Basic Methods 

 Mem0 ∗ 

 32.1 
 44.1 
 18.6 
 35.4 
 59.1 
 68.0 
 55.6 
 62.5 
 26.1 
 18.8 
 15.4 
 21.3 
 2765.5 
 11.0 
 1.995 

 Filter 
 32.1 
 43.3 
 19.8 
 35.2 
 56.8 
 65.8 
 51.8 
 60.0 
 24.9 
 19.7 
 15.4 
 21.2 
 4075.5 
 43.9 
 3.215 

 Gated Deliberation 

 Majority Voting 
 32.8 
 44.8 
 17.9 
 35.8 
 55.8 
 67.7 
 52.8 
 60.6 
 26.5 
 18.9 
 14.8 
 21.4 
 10858.4 
 150.7 
 5.446 

 Consensus 
 33.6 
 44.4 
 20.1 
 36.3 
 59.8 
 68.0 
 52.8 
 62.4 
 26.5 
 19.2 
 16.5 
 21.8 
 23162.0 
 510.5 
 12.353 

 Quality Gating (ours) 
 33.3 
 43.1 
 19.2 
 35.5 
 61.5 
 67.7 
 53.7 
 63.1 
 27.5 
 19.3 
 14.8 
 22.0 
 25716.8 
 700.2 
 16.515 

 Full Deliberation 
 35.4 
 44.6 
 22.6 
 37.5 
 61.8 
 68.7 
 59.3 
 64.4 
 29.1 
 23.4 
 17.3 
 24.8 
 56703.4 
 1253.0 
 27.792 

 Appendix D Computational Resources and Reproducibility

To ensure the reproducibility of our experimental results, we provide details regarding the computational environment and the models utilized in this study:

 • 

 Infrastructure : All experimental orchestration, data pre-processing, and local evaluation scripts were executed on a Lenovo laptop equipped with an NVIDIA GeForce RTX 4070 Laptop GPU (8GB VRAM) , and an Intel Core i9-13900HX CPU.

 • 

 Model Access : We utilized proprietary models via official API endpoints to ensure consistency:

 – 

 GPT-4o-mini : Accessed via the OpenAI API. Its exact parameter count remains proprietary and has not been disclosed by the provider.

 – 

 Qwen-235B-Instruct : Accessed via the Alibaba DashScope API. It is a Mixture-of-Experts (MoE) model with a total of 235 billion parameters and 22 billion active parameters.

 • 

 Computational Budget : The entire evaluation process for D-Mem is highly efficient; all experimental runs were completed within 24 wall-clock hours through parallel API invocations, involving a total consumption of approximately 400 million tokens.

 • 

 Software and Evaluation Packages : Our implementation and evaluation framework was built upon the following technical stack:

 – 

 Orchestration : Python 3.10 with the openai (v2.7.1) library for model inference and API orchestration. We also utilized langchain (v1.2.7) for auxiliary memory management tasks.

 – 

 Tokenization : tiktoken (v0.12.0) with the cl100k_base encoding was employed for precise token counting and to ensure compliance with model-specific context window constraints.

 – 

 Evaluation Metrics : Lexical overlap metrics were computed using nltk (v3.9.2) for F1 and BLEU scores, and rouge-score (v0.1.2) for ROUGE-L. Semantic evaluations (LLM-as-a-Judge) were executed by GPT-4o-mini, following the multi-dimensional rubric detailed in Appendix  A . Statistical analysis and visualization were performed using scikit-learn (v1.7.2), matplotlib (v3.10.7), and pandas (v2.3.3).

 • 

 Statistical Transparency : Due to the substantial computational costs associated with processing the extensive contexts in the LoCoMo and RealTalk benchmarks, all performance metrics reported in this paper are derived from a single, exhaustive execution of the evaluation pipeline. To ensure the reliability and reproducibility of these results, we utilized deterministic decoding (e.g., setting temperature = 0 \texttt{temperature}=0 ) for memory retrieval, except for the Majority Voting and Consensus.

 Appendix E Ethics Statement

In accordance with the ACL Code of Ethics, we acknowledge and discuss the potential risks and broader impacts associated with the deployment of long-term memory systems for LLM agents like D-Mem.

Privacy and Data Security.

The core capability of D-Mem involves persistently storing and retrieving extensive user interaction histories. This inherently introduces risks related to data privacy in real-world applications, especially if the conversational context contains Personally Identifiable Information (PII) or sensitive operational data. To mitigate these concerns during our research phase, we strictly evaluated our framework on publicly available benchmark datasets (e.g., LoCoMo and RealTalk). We verified that these standard benchmarks have been appropriately pre-processed and anonymized by their creators to remove PII and mitigate offensive content. However, for future real-world deployment, practitioners must implement strict data encryption and allow users to actively manage or delete their memory states.

Environmental and Computational Impact.

While our Quality Gating mechanism successfully mitigates redundant compute for simple queries (System 1), the Full Deliberation module (System 2) requires exhaustive context processing. As demonstrated in our efficiency metrics, this exhaustive nature increases token consumption and inference latency. Large-scale deployment of such dual-process systems could lead to a substantial carbon footprint. Future work should explore more eco-friendly deliberation alternatives, such as deploying smaller, specialized language models for the gating functions and Full Deliberation.

Memory-Induced Bias and Safety.

A highly retentive memory system runs the risk of perpetuating or amplifying historical biases. If an agent ingests toxic or factually incorrect statements from a user, these “poisoned” memories could be retrieved during future multi-hop reasoning, leading to unsafe or hallucinated outputs over time. We urge developers to pair D-Mem with robust safety guardrails and memory-sanitization protocols before user-facing deployment.

 Appendix F Artifact Licenses and Terms of Use

To ensure responsible NLP research and compliance with intellectual property guidelines, we outline the licenses of the scientific artifacts used and created in this work:

 • 

 Utilized Datasets : The LoCoMo and RealTalk datasets are used strictly for academic evaluation purposes, adhering to their respective open-source distribution terms (e.g., CC BY 4.0).

 • 

 Utilized Models and Frameworks : We accessed GPT-4o-mini via the official OpenAI API under their terms of service. The Qwen3-235B-Instruct model via the official Qwen API under their terms of service. The baseline memory framework, Mem0, is distributed under the Apache License 2.0.

 • 

 Created Artifacts : The source code for our D-Mem framework, along with all evaluation scripts, is distributed under the MIT License. The intended use of our created artifacts is to facilitate reproducibility and future academic research, which is entirely compatible with the original licenses of the utilized data and frameworks.

 Experimental support, please
 view the build logs 
 for errors. Generated by

 L
 A 
 T
 E 

 xml 

 .

Instructions for reporting errors

We are continuing to improve HTML versions of papers, and your feedback helps enhance accessibility and mobile
 support. To report errors in the HTML that will help us improve conversion and rendering, choose any of the
 methods listed below:

Click the "Report Issue" ( 

 ) button, located in the page header.

 Tip: You can select the relevant text first, to include it in your report.

Our team has already identified the following issues . We appreciate your time reviewing and reporting rendering errors we
 may not have found yet. Your efforts will help us improve the HTML versions for all readers, because disability
 should not be a barrier to accessing research. Thank you for your continued support in championing open access for
 all.

Have a free development cycle? Help support accessibility at arXiv! Our collaborators at LaTeXML maintain a list of packages that need conversion , and welcome developer contributions .

BETA