Selective Forgetting: A Graph-Based Memory Framework for Long-Term LLM Agents
Summary
This paper evaluates a graph-based memory framework for long-term LLM agents, finding that it does not outperform flat vector retrieval on recall metrics, but a selective forgetting module effectively reduces storage with minimal performance loss.
View Cached Full Text
Cached at: 09/01/26, 12:45 PM
# Selective Forgetting: A Graph-Based Memory Framework for Long-Term LLM Agents
Source: [https://arxiv.org/html/2608.28978](https://arxiv.org/html/2608.28978)
Theo RusuAffiliation:Department of Computer ScienceAffiliation:Toronto Metropolitan UniversityAffiliation:Toronto, Ontario, CanadaEmail:[trusu@torontomu\.ca](mailto:)Sourena Khanzadeh††thanks:This work was conducted prior to the author’s affiliations with Flybits and The Creative School\. The author was previously affiliated with the Department of Computer Science at Toronto Metropolitan University\.Affiliation:The Creative SchoolAffiliation:Toronto Metropolitan UniversityAffiliation:Toronto, Ontario, CanadaAffiliation:Flybits, Creative AI HubAffiliation:Toronto, Ontario, CanadaEmail:[sourena\.khanzadeh@torontomu\.ca](mailto:)Manar AlalfiAffiliation:Department of Computer ScienceAffiliation:Toronto Metropolitan UniversityAffiliation:Toronto, Ontario, CanadaEmail:[manar\.alalfi@torontomu\.ca](mailto:)
###### Abstract
Knowledge graphs have been proposed as a structured alternative to flat retrieval\-augmented generation for long\-term agent memory, on the assumption that representing conversations as entities and relations improves recall\. We evaluate that assumption directly\. Our framework extracts each conversational turn into typed nodes and attributed edges, answers questions from a two\-hop subgraph, and periodically prunes nodes that score low on a weighted combination of recency, access frequency, degree centrality, and age\. On LongMemEval, the graph does not outperform a flat vector baseline at a matched candidate\-generation budget of five retrieval roots: token F1 is0\.4170\.417against0\.4680\.468, and a paired bootstrap over 500 questions givesΔ=−0\.050\\Delta=\-0\.050\(95% CI\[−0\.085,−0\.016\]\[\-0\.085,\-0\.016\]\)\. The gap is widest on questions that require recalling a specific prior assistant turn, where judged correctness falls from0\.9110\.911to0\.6070\.607, suggesting that decomposing a turn into entities discards the surface form these questions depend on\. The forgetting module is more successful\. Applied once to a persistent 27,021\-node graph, it removes 9\.8% of nodes and 9\.5% of stored bytes; token F1 is unchanged \(\+0\.001\+0\.001, 95% CI\[−0\.015,\+0\.016\]\[\-0\.015,\+0\.016\]\) and judged correctness falls by1\.61\.6points, with the 95% interval bounding any loss at3\.83\.8points \(\[−0\.038,\+0\.006\]\[\-0\.038,\+0\.006\]\)\. Because our extractor is a single small model evaluated on one benchmark, these results characterise this extraction\-based pipeline rather than graph\-structured memory in general\.
Code:https://github\.com/skhanzad/Selective\-Amnesia
## 1Introduction
Large Language Models have rapidly evolved from standalone text generators into the foundation of complex, agentic systems that are able to reason, plan, and use external tools\. These systems are increasingly being adopted as personal AI assistants that interact with users over prolonged periods of time\. The quality of these interactions is reliant not only on the model’s immediate reasoning ability, but also on the model’s capacity to incorporate information from past exchanges\. As such, memory becomes a critical component of these systems and is typically classified into two subcategories: short\-term memory and long\-term memory\.
The current widely adopted long\-term memory approach is retrieval\-augmented generation[Lewis et al\. \(2020\)](https://arxiv.org/html/2608.28978#bib.bib5), where dense vector stores are indexed and queried at inference time to retrieve relevant entries that augment the model’s output\. This method models memory as a flat, similarity\-based retrieval system, which has been shown to be sensitive to noise, prone to retrieving irrelevant or redundant context, and is limited in its ability to support multi\-hop reasoning or maintain coherent long\-term knowledge[Gao et al\. \(2023\)](https://arxiv.org/html/2608.28978#bib.bib32)\.
To address these limitations, recent work has explored structured memory representations based on knowledge graphs, where information is organized as entities and their relationships rather than independent embeddings\. In these systems, memories are encoded as nodes and edges, allowing more complex semantic and relational representations to be stored[Ji et al\. \(2021\)](https://arxiv.org/html/2608.28978#bib.bib7);[Peng et al\. \(2023\)](https://arxiv.org/html/2608.28978#bib.bib34)\.
However, existing graph\-based approaches mainly focus on how information is added and maintained for consistency[Chhikara et al\. \(2025\)](https://arxiv.org/html/2608.28978#bib.bib33)\. This does not address a fundamental challenge of long\-term memory systems: unbounded growth\. As interactions accumulate over time, memory stores become increasingly large, creating a range of downstream negative effects, including degraded retrieval quality, higher computational cost, and the retention of low\-utility information\.
As memory accumulates over prolonged interactions, the system must integrate new information and manage the relevance of existing knowledge\. Prior work in continual learning and neural memory systems has shown that effective memory requires mechanisms for selective retention and forgetting, as retaining all information leads to performance degradation[Kirkpatrick et al\. \(2017\)](https://arxiv.org/html/2608.28978#bib.bib15);[Wei et al\. \(2026\)](https://arxiv.org/html/2608.28978#bib.bib35)\.
In this work, we investigate whether structuring long\-term conversational memory as a knowledge graph meaningfully improves retrieval and reasoning in LLM agents, and whether systems can remain efficient over extended interactions\. We introduce a graph\-based memory framework with an explicit forgetting module that controls the lifecycle of stored information\. Rather than assuming structural representations are uniformly beneficial, our study empirically characterizes where graph\-based memory helps and where it degrades performance\. In addition, we show that selective forgetting based on recency, frequency, and structural importance can reduce memory size without materially affecting retrieval quality\. These findings highlight that effective long\-term memory requires structured representation and careful design of update and retention mechanisms\.
## 2Related Work
### 2\.1Memory in LLM\-based Agents
Equipping neural systems with explicit memory predates the current generation of language models\. Early differentiable architectures such as Neural Turing Machines[Graves et al\. \(2014\)](https://arxiv.org/html/2608.28978#bib.bib12)and End\-to\-End Memory Networks[Sukhbaatar et al\. \(2015\)](https://arxiv.org/html/2608.28978#bib.bib11)coupled a controller with an addressable external store, establishing the read/write abstraction that later memory systems inherit\. As LLMs became the backbone of agentic systems, memory was repurposed to persist information between turns and sessions rather than within a single forward pass[Zhang et al\. \(2025\)](https://arxiv.org/html/2608.28978#bib.bib1)\. A common design is the memory stream of Generative Agents[Park et al\. \(2023\)](https://arxiv.org/html/2608.28978#bib.bib4), which logs observations and retrieves them using a combination of recency, importance, and relevance, and periodically synthesizes higher\-level reflections\. Subsequent systems extend this idea along different axes: MemoryBank[Zhong et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib3)introduces an updating scheme inspired by the Ebbinghaus forgetting curve[Ebbinghaus \(1913\)](https://arxiv.org/html/2608.28978#bib.bib13); MemGPT[Packer et al\. \(2023\)](https://arxiv.org/html/2608.28978#bib.bib28)treats memory as an operating\-system\-style hierarchy that pages information between a bounded context window and external storage; ReadAgent[Lee et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib6)compresses very long contexts into gist memories; and Think\-in\-Memory[Liu et al\. \(2023\)](https://arxiv.org/html/2608.28978#bib.bib29), Self\-Controlled Memory[Wang et al\. \(2025\)](https://arxiv.org/html/2608.28978#bib.bib30), and MemLLM[Modarressi et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib31)give the model explicit control over what is stored and recalled\. These approaches also enable long\-term dialogue settings studied by[Xu et al\. \(2022\)](https://arxiv.org/html/2608.28978#bib.bib2)\. Most of this line of work, however, organizes memory as a flat collection of entries and emphasizes writing and reading rather than principled removal\.
### 2\.2Retrieval\-Augmented Generation
The dominant strategy for grounding LLM outputs in external knowledge is retrieval\-augmented generation[Lewis et al\. \(2020\)](https://arxiv.org/html/2608.28978#bib.bib5), which retrieves relevant passages from a non\-parametric store and conditions generation on them\. Dense retrieval[Karpukhin et al\. \(2020\)](https://arxiv.org/html/2608.28978#bib.bib17)and jointly pre\-trained retrieval\-reading models such as REALM[Guu et al\. \(2020\)](https://arxiv.org/html/2608.28978#bib.bib18)and RETRO[Borgeaud et al\. \(2022\)](https://arxiv.org/html/2608.28978#bib.bib19)improved retrieval quality on scale, while retrieval has been shown to reduce hallucinations in dialogue[Shuster et al\. \(2021\)](https://arxiv.org/html/2608.28978#bib.bib20)\. More recent variants add self\-reflective control over when and what to retrieve[Asai et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib21)and specialize models for conversational settings[Liu et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib22)\. However, as surveyed by[Gao et al\. \(2023\)](https://arxiv.org/html/2608.28978#bib.bib32), RAG fundamentally models memory as a flat, similarity\-based lookup over independent embeddings\. This makes it sensitive to retrieval noise and redundancy and limits its capacity for multi\-hop reasoning or maintaining coherent long\-term knowledge, motivating more structured representations of memory\.
### 2\.3Graph\-Structured Memory
Knowledge graphs offer a structured alternative in which information is represented as entities and the relations between them[Ji et al\. \(2021\)](https://arxiv.org/html/2608.28978#bib.bib7);[Peng et al\. \(2023\)](https://arxiv.org/html/2608.28978#bib.bib34)\. A growing body of work integrates such structure with LLMs[Pan et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib23), ranging from prompting with retrieved triples[Baek et al\. \(2023\)](https://arxiv.org/html/2608.28978#bib.bib24)to letting the model reason by traversing a graph[Sun et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib25)\. For retrieval specifically, GraphRAG[Edge et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib26)constructs an entity graph and community summaries to support query\-focused summarization, and HippoRAG[Gutiérrez et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib27)draws on hippocampal indexing theory to combine a knowledge graph with graph\-based retrieval for long\-term recall\. In the agent\-memory setting, systems such as Mem0[Chhikara et al\. \(2025\)](https://arxiv.org/html/2608.28978#bib.bib33)adopt graph representations to store and consolidate user information across sessions\. These methods demonstrate the benefits of relational structure for retrieval and reasoning, but they concentrate on how information is added and kept consistent and largely leave unbounded growth of the memory store unaddressed\.
### 2\.4Forgetting and Memory Retention
The need to forget is well established outside of agent memory\. In human cognition, retention decays predictably over time[Ebbinghaus \(1913\)](https://arxiv.org/html/2608.28978#bib.bib13)\. In neural networks, naive sequential learning induces catastrophic forgetting[McCloskey and Cohen \(1989\)](https://arxiv.org/html/2608.28978#bib.bib14), prompting mechanisms that protect important parameters[Kirkpatrick et al\. \(2017\)](https://arxiv.org/html/2608.28978#bib.bib15); the broader phenomenon of forgetting in deep learning is surveyed by[Wang et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib8), and machine unlearning studies the deliberate removal of specific information[Bourtoule et al\. \(2020\)](https://arxiv.org/html/2608.28978#bib.bib16)\. A consistent finding across these areas is that effective memory requires selective retention rather than indefinite accumulation\. This principle has only recently been applied to agent memory: FadeMem[Wei et al\. \(2026\)](https://arxiv.org/html/2608.28978#bib.bib35)introduces biologically inspired forgetting to keep agent memory efficient\. Our work is closest in spirit to this direction, but couples forgetting with a graph\-structured store: rather than treating retention as a post\-hoc filter over flat entries, we integrate a forgetting module into the life cycle of nodes and edges, so that obsolete or low\-utility memories are removed while relational structure is preserved\.
### 2\.5Evaluating Long\-Term Memory
Assessing memory over extended interactions requires dedicated benchmarks\. LoCoMo[Maharana et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib9)evaluates very long\-term conversational memory, and LongMemEval[Wu et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib10)probes chat assistants on long\-term interactive memory abilities such as multi\-session reasoning and knowledge updates\. We adopt LongMemEval to evaluate whether structured memory with forgetting sustains high\-quality recall as interactions accumulate\.
## 3Methodology
This study proposes a graph\-based conversational memory framework that models interactions as a structured, evolving knowledge graph\. Rather than storing past exchanges as independent embeddings, the system maintains entities and their relationships as nodes and edges, continuously updates this graph as new conversational turns arrive, and periodically prunes low\-importance nodes to bound graph growth over long interactions\.
### 3\.1Architecture
The framework is organized as a three\-stage pipeline:*retrieval*,*update*, and*retention*\. In the*retrieval*stage, the subgraph most relevant to the current question is selected and serialized as context for answer generation\. In the*update*stage, an LLM extracts entities and relationships from the current conversational turn and integrates them into the knowledge graph\. In the*retention*stage, a forgetting module scores every stored node and removes those whose importance falls below a threshold, bounding graph growth and discarding low\-utility information\. Figure[1](https://arxiv.org/html/2608.28978#S3.F1)gives an overview of the full pipeline and how the three stages interact with the persistent knowledge graph\.
User questionEntity extractionDescriptor embeddingTop\-5 node searchcosine\>0\.75\>0\.752\-hop subgraph traversal≤15\\leq 15nodesLLM answer1\. RetrievalConversational turnLLM node & edgeextractionDescriptor embeddingDe\-duplicationtitle index, cosine\>0\.92\>0\.92Write new /merge existing2\. UpdateEvery 400 turnsImportance scoringrecency⋅\\cdotfrequency⋅\\cdotcentrality⋅\\cdotturn ageThreshold checkPrune nodes &incident edgess<0\.10s<0\.103\. RetentionPersistent knowledge graphtyped nodes⋅\\cdotattributed edges⋅\\cdotvector indexread: nodes & subgraphswrite / mergeprunegraph statistics
Figure 1:Overview of the proposed memory framework\. Each conversational turn is processed by the*update*stage, which extracts, embeds, de\-duplicates, and writes nodes and edges into the persistent knowledge graph\. At question time, the*retrieval*stage embeds the referenced entities, selects the top\-5 matching nodes ranked by cosine similarity, and expands them via a 2\-hop subgraph traversal to build the answer\-generation context\. Every 400 turns, the*retention*stage scores each node by recency, access frequency, centrality, and turn age, pruning nodes whose importance falls below the threshold together with their incident edges\.
### 3\.2Knowledge Graph Schema
The graph consists of typed nodes and edges with both types and attributes\. Each node carries alabel, a shorttitle, a natural\-languagecontentdescription, a flatattributesdictionary, and system fields for temporal, access, and retention tracking \(created\_at,access\_count,last\_accessed\_at,turns\_at\_creation,importance\_score\)\.
Nine node labels are defined in a fixed ontology:Person,Organization,Location,Event,Concept,Artifact,Preference,Goal, andSkill\. Edges connect pairs of nodes via a typedrelationshippredicate and may carry their ownattributesdictionary to capture relational properties such as duration, confidence, or quantity without introducing additional nodes\.
### 3\.3Extraction Pipeline
Each conversational turn is processed by a single LLM extraction call \(GPT\-4o\-mini\) using a structured system prompt that defines the ontology, output schema, and extraction rules\. Turns are prefixed with their speaker role \(\[Role: user\]or\[Role: assistant\]\) so the extractor handles each appropriately\.
User and assistant turns are processed differently during extraction\. For user turns, the system captures facts about the user, including their preferences, goals, skills, and relationships\. Assistant turns are processed in two modes: \(a\) user\-related facts that the assistant references or confirms, and \(b\) factual claims, recommendations, and named\-entity information stated by the assistant, enabling the system to recall information provided in prior turns\.
Turns that contain only superfluous or generic filler words produce empty output\.
The extractor returns strict JSON conforming to the graph schema\. A validation layer rejects any output that fails to parse, references undefined ontology types, or contains structurally invalid node\-edge references\.
### 3\.4Embedding and De\-duplication
Node descriptors are constructed from each node’s label, title, and content and embedded usingnomic\-embed\-textserved locally via Ollama\. The resulting vectors are stored alongside each node in the graph’svector\_indexdictionary and persisted with the graph JSON file\.
Before a new node is written to the graph, two de\-duplication checks are applied in sequence\. The first is title\-based: if an existing node shares the same label and normalized title as the incoming node, it is identified as a match and the embedding check is skipped entirely\. To enable the title\-based check, the system maintains atitle\_index\- a dictionary mapping each node’s normalized title to its node ID — which is updated whenever a new node is created, allowing O\(1\) lookup without any vector computation\. The second is embedding\-based, applied only when the title check finds no match: the incoming node’s vector is compared to all stored vectors via linear cosine scan; if the nearest existing node has a cosine similarity above 0\.92, it is treated as the same entity\. When either check identifies a match, the matched node’saccess\_countandlast\_accessed\_atfields are updated, providing a frequency signal to the importance scoring module before formal retrieval occurs\.
### 3\.5Subgraph Retrieval
At inference time, a lightweight extraction call identifies the entities referenced by the current question and embeds their descriptors\. An exhaustive cosine\-similarity search is performed over all stored node embeddings\. Nodes with a similarity score above 0\.75 are retained and ranked by score\. We use breadth\-first search \(BFS\) starting from the top\-5 retrieved nodes, expanding the graph up to two hops from these root nodes and stopping once a maximum of 15 nodes has been collected\. Justifications for these parameter choices are provided in Appendix[A\.2](https://arxiv.org/html/2608.28978#A1.SS2)\.
The retrieved nodes and edges are serialized as a compact textual representation and included into the answer\-generation prompt as contextual memory\.
Visited nodes in a retrieved subgraph has itsaccess\_countincremented andlast\_accessed\_atupdated to the current session timestamp\.
### 3\.6Importance Scoring and Forgetting
Each node is assigned an importance score that combines four components:
Score=\\displaystyle\\text\{Score\}=\{\}wr⋅recency\(t\)\+wf⋅frequency\(c\)\\displaystyle w\_\{r\}\\cdot\\text\{recency\}\(t\)\+w\_\{f\}\\cdot\\text\{frequency\}\(c\)\+wc⋅centrality\(d\)\+wt⋅turns\_decay\(k\),\\displaystyle\+w\_\{c\}\\cdot\\text\{centrality\}\(d\)\+w\_\{t\}\\cdot\\text\{turns\\\_decay\}\(k\),
where*recency*is an exponential decay from the node’s last access timestamp with a 90\-day half\-life;*frequency*is the log\-normalized access count;*centrality*is the log\-scaled edge degree; and*turns\_decay*is an exponential decay from the node’s creation turn with a 1,000\-turn half\-life\. The weights are set towr=0\.35w\_\{r\}=0\.35,wf=0\.25w\_\{f\}=0\.25,wc=0\.20w\_\{c\}=0\.20,wt=0\.20w\_\{t\}=0\.20\.
The forgetting module is invoked every 400 conversational turns\. All nodes whose importance score falls below 0\.10 are pruned, together with every edge incident to those nodes\. Additional details are provided in Appendix[A\.2](https://arxiv.org/html/2608.28978#A1.SS2)\.
## 4Experiments
This section presents two experiments designed to evaluate \(1\) whether a knowledge graph retrieval mechanism improves answer accuracy over a flat vector baseline, and \(2\) whether the proposed forgetting module can reduce graph storage without degrading retrieval quality\. In all experiments, the underlying language model is held constant and only the retrieval and memory mechanisms are varied\.
### 4\.1Dataset
Both experiments use the LongMemEval benchmark[Wu et al\. \(2024\)](https://arxiv.org/html/2608.28978#bib.bib10), a dataset designed to evaluate long\-term conversational memory in dialogue systems\. The benchmark consists of 500 questions, each paired with a multi\-session conversation history, referred to as the*haystack*, which contains the information required to answer the question\. Haystack sessions span real historical dates covering approximately 33 months \(June 2021 – February 2024\), with each question drawing on between one and several sessions\.
Questions are categorized into six types that probe distinct memory demands\.Single\-session \(user\)questions ask about facts the user stated directly, such as personal attributes or past events\.Single\-session \(assistant\)questions require recalling specific information the assistant provided in a prior turn, such as a recommendation or a factual explanation\.Single\-session \(preference\)questions target implicit or explicit user preferences expressed in conversation\.Knowledge\-updatequestions test whether the system correctly tracks values that changed across sessions, favoring the most recent statement over earlier ones\.Multi\-sessionquestions require aggregating information spread across two or more separate sessions\.Temporal\-reasoningquestions demand ordering events or computing time intervals from information embedded in the haystack\.
### 4\.2Experiment 1: Retrieval Quality and Knowledge Retention
The goal of Experiment 1 is to determine whether structuring conversational memory as a knowledge graph improves retrieval quality over a flat vector baseline\. For each of the 500 questions, a fresh knowledge graph is built from that question’s haystack sessions alone, then used to answer the question\. The baseline stores the same haystack turns as raw text chunks in a flat vector store and retrieves the top\-5 most similar chunks at query time\. Both systems use the same language model for answer generation, and neither has access to information outside the question’s own haystack\.
Performance is measured using token\-level precision and F1\-score, and an LLM\-as\-judge correctness score \(binary, averaged across questions\)\.
Table 1:Experiment 1 results: Graph RAG vs\. Baseline RAG on LongMemEval\. J = LLM\-judge; Single = single\-session\.
### 4\.3Experiment 2: Long\-Term Memory Efficiency Under Forgetting
The goal of Experiment 2 is to determine whether the forgetting module can compress the knowledge graph without degrading its retrieval quality\. A single persistent graph is built by ingesting the haystack sessions for all 500 questions in a sequence, simulating a long\-running deployment in which a system accumulates memory across many independent interactions\. Two variants are compared: ano\-forgettinggraph that retains every node, and aforgettinggraph to which the forgetting module is applied once ingestion is complete\. Both variants then answer all 500 benchmark questions, and their retrieval quality and storage footprints are compared\.
Table 2:Experiment 2 results: storage and retrieval quality for the persistent graph with and without forgetting\.
## 5Discussion and Limitations
The experiments reveal two complementary findings about graph\-based long\-term memory\. First, representing conversational memory as a knowledge graph does not uniformly improve retrieval over a flat vector store\. Second, once memory is represented as a persistent graph, selective forgetting can substantially reduce its size while largely preserving retrieval quality\.
In Experiment 1, the baseline RAG system outperforms Graph RAG overall, achieving a token F1 of 0\.468 compared with 0\.417 and an LLM\-judge accuracy of 0\.536 compared with 0\.454\. However, performance varies across question types, indicating that the usefulness of graph structure depends on the type of information being retrieved\.
Graph RAG achieves its only improvement on the LLM\-judge metric fortemporal\-reasoningquestions \(0\.293 vs\. 0\.278\)\. This task is naturally aligned with a graph representation: events can be represented as typed nodes with temporal attributes and connected to the entities that participate in them, allowing retrieval to preserve relational and temporal structure\. In contrast, flat chunk retrieval does not explicitly represent event participants, ordering, or temporal relationships\.
The largest performance deficit occurs forsingle\-session \(assistant\)questions \(judge: 0\.607 vs\. 0\.911\)\. These questions often require recalling a specific recommendation or factual statement from a previous assistant response\. The flat baseline can retrieve the original assistant turn verbatim, whereas graph extraction decomposes the turn into entities and relationships\. In doing so, it may lose information about which item or statement was specifically emphasized\. This highlights an important limitation of extraction\-based memory representations: structured abstraction can improve relational organization while simultaneously discarding information required for precise or verbatim recall\.
Graph RAG also underperforms onknowledge\-updatequestions \(F1: 0\.456 vs\. 0\.511\)\. Inspection of failures indicates that the current conflict\-resolution policy can retain an earlier attribute value instead of replacing it with a more recent value when no explicit confidence score is available\. A last\-write\-wins policy for appropriate factual and numeric attributes could therefore improve performance on knowledge\-update tasks\. Smaller deficits onmulti\-sessionandsingle\-session \(user\)questions appear to arise from related extraction and retrieval effects\. Although graph structure can support cross\-session entity linking, imperfect extraction and entity merging introduce retrieval noise, while concise facts that are directly preserved in raw text may be abstracted during graph construction\.
Experiment 2 examines a different property of the memory system: whether accumulated graph memory can be reduced without substantially degrading retrieval\. Applying the forgetting mechanism removes 2,653 nodes \(9\.8%\) and 2,560 edges \(5\.5%\), reducing the graph size from 440\.6 MB to 398\.6 MB, a 9\.5% reduction\. Token\-level F1 remains nearly unchanged, increasing from 0\.292 to 0\.293, while LLM\-judge accuracy decreases from 0\.300 to 0\.284\.
Absolute retrieval performance in Experiment 2 is lower than in Experiment 1 because all 500 haystacks are merged into a single persistent graph, introducing cross\-conversation retrieval interference\. The purpose of this experiment is therefore not to maximize retrieval accuracy, but to compare the same persistent\-memory setting with and without forgetting\.
The nodes removed by the forgetting mechanism fall below the importance threshold after the simulated conversation period and are characterized by low re\-reference frequency, limited structural connectivity, and reduced recency\. Their removal has little effect on token\-level F1, suggesting that the importance function preferentially removes peripheral information that contributes relatively little to retrieval\. The reduction in LLM\-judge accuracy, however, indicates that some pruned information can still contribute to correct answers, highlighting a trade\-off between memory efficiency and information retention\.
Taken together, these results suggest that graph structure alone is not sufficient to improve long\-term conversational memory\. Its benefits are strongest when relationships and temporal structure are important, whereas flat text retrieval remains advantageous for precise or verbatim recall\. At the same time, explicit retention mechanisms provide a practical way to control the growth of persistent memory\. Effective long\-term memory systems may therefore benefit from combining structured representations with stronger update policies, selective retention, and mechanisms that preserve access to information for which verbatim context remains important\.
## 6Conclusion
This study demonstrates that structuring conversational memory as a knowledge graph introduces both benefits and limitations\. While relational representations can support reasoning over temporally and semantically connected information, they also incur information loss that negatively impacts tasks requiring precise or verbatim recall\. These results indicate that improvements in memory systems cannot be achieved through representation alone\. Instead, performance depends critically on how information is extracted, updated, and retained over time\.
The proposed forgetting module contributes a retention mechanism whose cost we can bound: pruning the low\-importance tail of a 27,021\-node store removed 9\.8% of nodes and 9\.5% of bytes, and a paired bootstrap over 500 questions detects no significant change in any of the four metrics \(Table[7](https://arxiv.org/html/2608.28978#A1.T7)\)\. Overall, the findings suggest that effective long\-term memory systems should combine structured representations with stronger update mechanisms and selective retention strategies, rather than relying on a single approach in isolation\.
## Author Contributions
Sourena Khanzadeh conceived the research idea and formulated the initial research direction\. Theo Rusu was primarily responsible for the implementation and experimental execution\. Manar Alalfi supervised the research and provided technical and academic guidance\.
## References
- A\. Asai, Z\. Wu, Y\. Wang, A\. Sil, and H\. HajishirziSelf\-rag: learning to retrieve, generate, and critique through self\-reflection\.InInternational conference on learning representations,Vol\.2024,pp\. 9112–9141\.Cited by:[§2\.2](https://arxiv.org/html/2608.28978#S2.SS2.p1.1)\.
- Baeket al\.\(2023\)J\. Baek, A\. F\. Aji, and A\. SaffariKnowledge\-augmented language model prompting for zero\-shot knowledge graph question answering\.InProceedings of the 1st Workshop on Natural Language Reasoning and Structured Explanations \(NLRSE\),pp\. 78–106\.Cited by:[§2\.3](https://arxiv.org/html/2608.28978#S2.SS3.p1.1)\.
- Borgeaudet al\.\(2022\)S\. Borgeaud, A\. Mensch, J\. Hoffmann, T\. Cai, E\. Rutherford, K\. Millican, G\. B\. Van Den Driessche, J\. Lespiau, B\. Damoc, A\. Clark,et al\.Improving language models by retrieving from trillions of tokens\.InInternational conference on machine learning,pp\. 2206–2240\.Cited by:[§2\.2](https://arxiv.org/html/2608.28978#S2.SS2.p1.1)\.
- Bourtouleet al\.\(2020\)L\. Bourtoule, V\. Chandrasekaran, C\. A\. Choquette\-Choo, H\. Jia, A\. Travers, B\. Zhang, D\. Lie, and N\. PapernotMachine unlearning\.External Links:1912\.03817,[Link](https://arxiv.org/abs/1912.03817)Cited by:[§2\.4](https://arxiv.org/html/2608.28978#S2.SS4.p1.1)\.
- Chhikaraet al\.\(2025\)P\. Chhikara, D\. Khant, S\. Aryan, T\. Singh, and D\. YadavMem0: building production\-ready ai agents with scalable long\-term memory\.arXiv preprint arXiv:2504\.19413\.Cited by:[§1](https://arxiv.org/html/2608.28978#S1.p4.1),[§2\.3](https://arxiv.org/html/2608.28978#S2.SS3.p1.1)\.
- Ebbinghaus \(1913\)H\. EbbinghausA contribution to experimental psychology\.Cited by:[§2\.1](https://arxiv.org/html/2608.28978#S2.SS1.p1.1),[§2\.4](https://arxiv.org/html/2608.28978#S2.SS4.p1.1)\.
- Edgeet al\.\(2024\)D\. Edge, H\. Trinh, N\. Cheng, J\. Bradley, A\. Chao, A\. Mody, S\. Truitt, D\. Metropolitansky, R\. O\. Ness, and J\. LarsonFrom local to global: a graph rag approach to query\-focused summarization\.arXiv preprint arXiv:2404\.16130\.Cited by:[§2\.3](https://arxiv.org/html/2608.28978#S2.SS3.p1.1)\.
- Gaoet al\.\(2023\)Y\. Gao, Y\. Xiong, X\. Gao, K\. Jia, J\. Pan, Y\. Bi, Y\. Dai, J\. Sun, M\. Wang, and H\. WangRetrieval\-augmented generation for large language models: a survey\.arXiv preprint arXiv:2312\.10997\.Cited by:[§1](https://arxiv.org/html/2608.28978#S1.p2.1),[§2\.2](https://arxiv.org/html/2608.28978#S2.SS2.p1.1)\.
- Graveset al\.\(2014\)A\. Graves, G\. Wayne, and I\. DanihelkaNeural turing machines\.arXiv preprint arXiv:1410\.5401\.Cited by:[§2\.1](https://arxiv.org/html/2608.28978#S2.SS1.p1.1)\.
- Gutiérrezet al\.\(2024\)B\. J\. Gutiérrez, Y\. Shu, Y\. Gu, M\. Yasunaga, and Y\. SuHipporag: neurobiologically inspired long\-term memory for large language models\.Vol\.37,pp\. 59532–59569\.Cited by:[§2\.3](https://arxiv.org/html/2608.28978#S2.SS3.p1.1)\.
- Guuet al\.\(2020\)K\. Guu, K\. Lee, Z\. Tung, P\. Pasupat, and M\. ChangRetrieval augmented language model pre\-training\.InInternational conference on machine learning,pp\. 3929–3938\.Cited by:[§2\.2](https://arxiv.org/html/2608.28978#S2.SS2.p1.1)\.
- Jiet al\.\(2021\)S\. Ji, S\. Pan, E\. Cambria, P\. Marttinen, and P\. S\. YuA survey on knowledge graphs: representation, acquisition, and applications\.IEEE transactions on neural networks and learning systems33\(2\),pp\. 494–514\.Cited by:[§1](https://arxiv.org/html/2608.28978#S1.p3.1),[§2\.3](https://arxiv.org/html/2608.28978#S2.SS3.p1.1)\.
- Karpukhinet al\.\(2020\)V\. Karpukhin, B\. Oguz, S\. Min, P\. Lewis, L\. Wu, S\. Edunov, D\. Chen, and W\. YihDense passage retrieval for open\-domain question answering\.InProceedings of the 2020 conference on empirical methods in natural language processing \(EMNLP\),pp\. 6769–6781\.Cited by:[§2\.2](https://arxiv.org/html/2608.28978#S2.SS2.p1.1)\.
- Kirkpatricket al\.\(2017\)J\. Kirkpatrick, R\. Pascanu, N\. Rabinowitz, J\. Veness, G\. Desjardins, A\. A\. Rusu, K\. Milan, J\. Quan, T\. Ramalho, A\. Grabska\-Barwinska,et al\.Overcoming catastrophic forgetting in neural networks\.Proceedings of the national academy of sciences114\(13\),pp\. 3521–3526\.Cited by:[§1](https://arxiv.org/html/2608.28978#S1.p5.1),[§2\.4](https://arxiv.org/html/2608.28978#S2.SS4.p1.1)\.
- Leeet al\.\(2024\)K\. Lee, X\. Chen, H\. Furuta, J\. Canny, and I\. FischerA human\-inspired reading agent with gist memory of very long contexts\.Cited by:[§2\.1](https://arxiv.org/html/2608.28978#S2.SS1.p1.1)\.
- Lewiset al\.\(2020\)P\. Lewis, E\. Perez, A\. Piktus, F\. Petroni, V\. Karpukhin, N\. Goyal, H\. Küttler, M\. Lewis, W\. Yih, T\. Rocktäschel,et al\.Retrieval\-augmented generation for knowledge\-intensive nlp tasks\.Vol\.33,pp\. 9459–9474\.Cited by:[§1](https://arxiv.org/html/2608.28978#S1.p2.1),[§2\.2](https://arxiv.org/html/2608.28978#S2.SS2.p1.1)\.
- Liuet al\.\(2023\)L\. Liu, X\. Yang, Y\. Shen, B\. Hu, Z\. Zhang, J\. Gu, and G\. ZhangThink\-in\-memory: recalling and post\-thinking enable llms with long\-term memory\.arXiv preprint arXiv:2311\.08719\.Cited by:[§2\.1](https://arxiv.org/html/2608.28978#S2.SS1.p1.1)\.
- Liuet al\.\(2024\)Z\. Liu, W\. Ping, R\. Roy, P\. Xu, C\. Lee, M\. Shoeybi, and B\. CatanzaroChatqa: surpassing gpt\-4 on conversational qa and rag\.Advances in Neural Information Processing Systems37,pp\. 15416–15459\.Cited by:[§2\.2](https://arxiv.org/html/2608.28978#S2.SS2.p1.1)\.
- Maharanaet al\.\(2024\)A\. Maharana, D\. Lee, S\. Tulyakov, M\. Bansal, F\. Barbieri, and Y\. FangEvaluating very long\-term conversational memory of llm agents\.InProceedings of the 62nd Annual Meeting of the Association for Computational Linguistics \(Volume 1: Long Papers\),pp\. 13851–13870\.Cited by:[§2\.5](https://arxiv.org/html/2608.28978#S2.SS5.p1.1)\.
- McCloskey and Cohen \(1989\)M\. McCloskey and N\. J\. CohenCatastrophic interference in connectionist networks: the sequential learning problem\.24,pp\. 109–165\.Cited by:[§2\.4](https://arxiv.org/html/2608.28978#S2.SS4.p1.1)\.
- Modarressiet al\.\(2024\)A\. Modarressi, A\. Köksal, A\. Imani, M\. Fayyaz, and H\. SchützeMemllm: finetuning llms to use an explicit read\-write memory\.arXiv preprint arXiv:2404\.11672\.Cited by:[§2\.1](https://arxiv.org/html/2608.28978#S2.SS1.p1.1)\.
- Packeret al\.\(2023\)C\. Packer, S\. Wooders, K\. Lin, V\. Fang, S\. G\. Patil, I\. Stoica, and J\. E\. GonzalezMemgpt: towards llms as operating systems\.Cited by:[§2\.1](https://arxiv.org/html/2608.28978#S2.SS1.p1.1)\.
- Panet al\.\(2024\)S\. Pan, L\. Luo, Y\. Wang, C\. Chen, J\. Wang, and X\. WuUnifying large language models and knowledge graphs: a roadmap\.IEEE Transactions on Knowledge and Data Engineering36\(7\),pp\. 3580–3599\.Cited by:[§2\.3](https://arxiv.org/html/2608.28978#S2.SS3.p1.1)\.
- Parket al\.\(2023\)J\. S\. Park, J\. O’Brien, C\. J\. Cai, M\. R\. Morris, P\. Liang, and M\. S\. BernsteinGenerative agents: interactive simulacra of human behavior\.InProceedings of the 36th annual acm symposium on user interface software and technology,pp\. 1–22\.Cited by:[§A\.2](https://arxiv.org/html/2608.28978#A1.SS2.p7.1),[§2\.1](https://arxiv.org/html/2608.28978#S2.SS1.p1.1)\.
- Penget al\.\(2023\)C\. Peng, F\. Xia, M\. Naseriparsa, and F\. OsborneKnowledge graphs: opportunities and challenges\.External Links:2303\.13948,[Link](https://arxiv.org/abs/2303.13948)Cited by:[§1](https://arxiv.org/html/2608.28978#S1.p3.1),[§2\.3](https://arxiv.org/html/2608.28978#S2.SS3.p1.1)\.
- Shusteret al\.\(2021\)K\. Shuster, S\. Poff, M\. Chen, D\. Kiela, and J\. WestonRetrieval augmentation reduces hallucination in conversation\.InFindings of the Association for Computational Linguistics: EMNLP 2021,pp\. 3784–3803\.Cited by:[§2\.2](https://arxiv.org/html/2608.28978#S2.SS2.p1.1)\.
- Sukhbaataret al\.\(2015\)S\. Sukhbaatar, J\. Weston, R\. Fergus,et al\.End\-to\-end memory networks\.Vol\.28\.Cited by:[§2\.1](https://arxiv.org/html/2608.28978#S2.SS1.p1.1)\.
- Sunet al\.\(2024\)J\. Sun, C\. Xu, L\. Tang, S\. Wang, C\. Lin, Y\. Gong, L\. Ni, H\. Shum, and J\. GuoThink\-on\-graph: deep and responsible reasoning of large language model on knowledge graph\.InInternational Conference on Learning Representations,Vol\.2024,pp\. 3868–3898\.Cited by:[§2\.3](https://arxiv.org/html/2608.28978#S2.SS3.p1.1)\.
- Wanget al\.\(2025\)B\. Wang, X\. Liang, J\. Yang, H\. Huang, Z\. Wu, S\. Wu, Z\. Ma, and Z\. LiScm: enhancing large language model with self\-controlled memory framework\.pp\. 188–203\.Cited by:[§2\.1](https://arxiv.org/html/2608.28978#S2.SS1.p1.1)\.
- Wanget al\.\(2024\)Z\. Wang, E\. Yang, L\. Shen, and H\. HuangA comprehensive survey of forgetting in deep learning beyond continual learning\.IEEE Transactions on Pattern Analysis and Machine Intelligence47\(3\),pp\. 1464–1483\.Cited by:[§2\.4](https://arxiv.org/html/2608.28978#S2.SS4.p1.1)\.
- Weiet al\.\(2026\)L\. Wei, X\. Dong, X\. Peng, N\. Xie, and B\. WangFademem: biologically\-inspired forgetting for efficient agent memory\.pp\. 4011–4015\.Cited by:[§1](https://arxiv.org/html/2608.28978#S1.p5.1),[§2\.4](https://arxiv.org/html/2608.28978#S2.SS4.p1.1)\.
- Wuet al\.\(2024\)D\. Wu, H\. Wang, W\. Yu, Y\. Zhang, K\. Chang, and D\. YuLongmemeval: benchmarking chat assistants on long\-term interactive memory\.Cited by:[§2\.5](https://arxiv.org/html/2608.28978#S2.SS5.p1.1),[§4\.1](https://arxiv.org/html/2608.28978#S4.SS1.p1.1)\.
- Xuet al\.\(2022\)J\. Xu, A\. Szlam, and J\. WestonBeyond goldfish memory: long\-term open\-domain conversation\.InProceedings of the 60th annual meeting of the association for computational linguistics \(volume 1: long papers\),pp\. 5180–5197\.Cited by:[§2\.1](https://arxiv.org/html/2608.28978#S2.SS1.p1.1)\.
- Zhanget al\.\(2025\)Z\. Zhang, Q\. Dai, X\. Bo, C\. Ma, R\. Li, X\. Chen, J\. Zhu, Z\. Dong, and J\. WenA survey on the memory mechanism of large language model\-based agents\.ACM Transactions on Information Systems43\(6\),pp\. 1–47\.Cited by:[§2\.1](https://arxiv.org/html/2608.28978#S2.SS1.p1.1)\.
- Zhonget al\.\(2024\)W\. Zhong, L\. Guo, Q\. Gao, H\. Ye, and Y\. WangMemorybank: enhancing large language models with long\-term memory\.InProceedings of the AAAI conference on artificial intelligence,Vol\.38,pp\. 19724–19731\.Cited by:[§A\.2](https://arxiv.org/html/2608.28978#A1.SS2.p7.1),[§2\.1](https://arxiv.org/html/2608.28978#S2.SS1.p1.1)\.
## Appendix AAppendix
### A\.1Note to Reviewers on Experimental Scope and AI Use
#### Budget Constraints\.
This work was carried out under a fixed compute and API budget on the consumer\-grade workstation described above\. We state the resulting scope limits explicitly so that our claims are read at the right granularity\. Every configuration we evaluate requires re\-ingesting the haystack sessions for all 500 LongMemEval questions, which costs one extraction call per conversational turn, plus one generation and one judge call per question\. A single evaluated configuration is therefore expensive, and the budget admitted a small number of complete runs rather than a sweep\. We chose to spend it on four full runs \(Experiment 1 treatment and control, Experiment 2 treatment and control\) atn=500n=500with temperature=0=0, and to report paired bootstrap intervals over those runs, rather than on a larger number of partially evaluated configurations\.
Accordingly, our findings should be read as characterising this extraction\-based graph memory pipeline at this model scale, not graph\-structured memory in general\. Given additional budget, our order of priority would be: a matched\-compression control that prunes the same fraction of nodes at random, to isolate the contribution of the importance function; a second benchmark; and a stronger extraction model\.
#### Use of Generative AI\.
We distinguish two uses of language models in this work\. First, as components of the method itself: GPT\-4o\-mini performs knowledge\-graph extraction and answer generation, and serves as the LLM judge, as described in Sections 3\.3 and 4\.1\. Second, as authoring tools\. In the latter role, we used gpt5\.6 sol to draft prose in the appendix and to assist with literature search, and Opus 4\.8 to assist with implementing the experimental pipeline\. The main technical content, including the experimental design, the analyses, and the interpretation of results, is the authors’ own; model assistance on those sections was limited to grammar and formatting\. All AI\-assisted output was reviewed by the authors, all cited references were checked against their original sources, and the authors take full responsibility for the content of the paper\.
### A\.2Justification for parameter values chosen for the experiments and methodology\.
Table[3](https://arxiv.org/html/2608.28978#A1.T3)lists every free parameter of the system together with its setting and the basis on which it was chosen\. We distinguish three cases: values selected empirically on a small probe set \(E\), values fixed*a priori*from a budget or cost constraint \(B\), and values fixed by convention or by symmetry with the baseline \(C\)\. We did not perform a full sweep over the retention parameters; the consequences of this are discussed at the end of this section\.
Table 3:Parameters, settings, and basis for selection\. E = empirical probe, B = budget or cost constraint, C = convention or symmetry with the baseline\.De\-duplication threshold\.Selected by the probe procedure described in Appendix[A\.5](https://arxiv.org/html/2608.28978#A1.SS5)\. The value is deliberately conservative because the two error modes are not symmetric: a false merge collapses two distinct entities irreversibly and corrupts every edge incident to them, whereas a missed merge only leaves redundant nodes that later de\-duplication passes or the retrieval stage can still surface\. We therefore accepted a higher false\-negative rate in exchange for a low false\-merge rate\.
Retrieval cosine floor\.Descriptor embeddings produced bynomic\-embed\-textare anisotropic, so cosine similarity between unrelated short descriptors does not concentrate near zero\. A floor of 0\.75 admits paraphrases and partial mentions of the same entity while excluding nodes that are merely topically adjacent\. This parameter is not load\-bearing: because candidates are subsequently ranked and truncated to the top 5, the floor only affects queries for which fewer than five nodes clear it, in which case the system correctly retrieves a smaller context rather than padding it with unrelated nodes\.
Number of retrieval roots\.Set to 5 to match the number of chunks retrieved by the flat vector baseline \(Section[4\.2](https://arxiv.org/html/2608.28978#S4.SS2)\), so that the two systems are compared at an equal candidate\-generation budget and any difference in performance is attributable to the representation rather than to the number of retrieval hits\.
Expansion depth and node cap\.One hop from a seed node returns only its immediate neighbours, which for most seeds is the set of attributes attached to a single entity and therefore adds little beyond the seed itself\. Three or more hops expand super\-linearly in a merged graph, and inspection showed that nodes at that distance are typically related to the seed through a hub entity rather than through any relation relevant to the query\. Two hops is thus the smallest depth that supports the relational and multi\-session cases the graph representation is intended to serve\.
Forgetting interval and pruning threshold\.Scoring isO\(N\+M\)O\(N\+M\)in the size of the graph, so invoking it rarely amortizes its cost across many conversational turns; 400 turns is also long enough for the recency and turn\-decay terms to separate nodes that are genuinely dormant from nodes that happen not to have been accessed recently\. The threshold of 0\.10 was set to be conservative, targeting only the tail of the score distribution rather than a fixed compression ratio\. This choice determines the operating point reported in Experiment 2 and is the reason the reported reduction is approximately 10% rather than a larger figure\.
Half\-lives and scoring weights\.The 90\-day recency half\-life is set relative to the temporal span of the LongMemEval haystacks, which cover roughly 33 months of real timestamps; a substantially shorter half\-life would saturate the recency term for nearly all nodes, and a substantially longer one would flatten it\. The 1,000\-turn decay half\-life plays the same role with respect to ingestion order\. The weights were fixed*a priori*and were not tuned: they encode a prior, drawn from the memory\-stream and forgetting\-curve literature\[[Park et al\., 2023](https://arxiv.org/html/2608.28978#bib.bib4),[Zhong et al\., 2024](https://arxiv.org/html/2608.28978#bib.bib3)\], that access\-driven signals \(recency, frequency\) should dominate structural and age\-based ones\.
Limitation\.The retention parameters\(wr,wf,wc,wt\)\(w\_\{r\},w\_\{f\},w\_\{c\},w\_\{t\}\),smins\_\{\\min\}, and the forgetting interval were not swept, so Experiment 2 characterises a single point on the compression–quality trade\-off rather than the curve\. We also do not isolate the contribution of the individual scoring components; establishing that the four\-term importance function outperforms a simpler retention rule at matched compression is left to future work\.
#### Compute Environment\.
All experiments were conducted on a local workstation equipped with an AMD Radeon RX 7800 XT GPU, 16 GB of system RAM, and an Intel Core i5\-9400F CPU\. This configuration was used for local execution of the memory pipeline, graph operations, embedding\-related workloads and we utilized OpenAI model, mainly \(gpt4o\-mini\) for API calls\.
### A\.3Role\-Aware Extraction Prompt
This role\-aware variant explicitly distinguishes user and assistant turns and specifies which assistant\-provided facts should be retained\.
Extractaknowledgegraphfromaconversationturn\.
ReturnstrictJSONonly–nomarkdown,nopreamble\.
Eachturnisprefixedwithitsspeakerrole:
\[Role:user\]–thehumanspeakingdirectly
\[Role:assistant\]–theAIassistantresponding
ROLEHANDLING:
…
### A\.4Sample Knowledge\-Graph Extraction Prompt
The following example illustrates the structure of the extraction prompts used throughout our experiments\.
Youareaknowledgegraphextractionengine\.Givenasingle
conversationalmessage,extractallrelevantnodes,edges,and
attributesandreturntheresultasstrictJSON\.
NODES:
Representdiscreteentitiesmentionedorimpliedinthemessage,
suchaspeople,organizations,locations,skills,goals,events,
preferences,andartifacts\.
EDGES:
Representdirectedrelationshipsbetweennodes\.Useprecise,
domain\-relevantrelationshiplabelswheneverpossible\.
ATTRIBUTES:
Representadditionalpropertiesassociatedwithanodeoredge,
includingquantities,dates,durations,frequencies,orother
qualifyinginformation\.
REQUIREMENTS:
1\.Extracteveryexplicitlystatedfact\.
2\.Donotintroduceinformationthatisnotsupportedbytheinput\.
3\.Useonlythepredefinednodelabels\.
4\.ReturnvalidJSONonly\.
5\.Donotincludeexplanations,markdown,oradditionalcommentary\.
OUTPUTFORMAT:
\{
”nodes”:\{
”<node\_id\>”:\{
”label”:”<node\_label\>”,
”title”:”<short\_title\>”,
”content”:”<description\>”,
”attributes”:\{\}
\}
\},
”edges”:\{
”<edge\_id\>”:\{
”source”:”<source\_node\>”,
”target”:”<target\_node\>”,
”relationship”:”<relationship\>”,
”attributes”:\{\}
\}
\}
\}
USERMESSAGE:
<conversationturn\>
### A\.5Algorithms
Algorithm[1](https://arxiv.org/html/2608.28978#alg1)summarizes the memory ingestion pipeline\. Given a conversational turn, the system first extracts a structured set of nodes and edges and embeds each extracted node\. Candidate nodes are matched against existing memory using exact title matching followed by semantic similarity\. Matches above the deduplication thresholdτdedup\\tau\_\{\\mathrm\{dedup\}\}are mapped to existing nodes, while unmatched entities are assigned new identifiers\. For standard operation, the same message is additionally converted into retrieval entities, which are used to identify and expand a relevant graph subgraph that is serialized as contextual memory\. The extracted nodes and edges are then written to persistent memory, and an optional forgetting pass is triggered according to the configured memory\-maintenance policy\.
Algorithm 1Knowledge\-Graph Ingestion Pipeline1:User message
mm, memory graph
GG
2:Updated graph
GGand retrieved context
𝒞\\mathcal\{C\}
3:
E←Extract\(m\)E\\leftarrow\\textsc\{Extract\}\(m\)⊳\\trianglerightExtract nodes and relations
4:
Z←Embed\(E\.nodes\)Z\\leftarrow\\textsc\{Embed\}\(E\.\\text\{nodes\}\)⊳\\trianglerightEmbed extracted entities
5:for all
n∈E\.nodesn\\in E\.\\text\{nodes\}do
6:
v←Match\(n,Zn,G\)v\\leftarrow\\textsc\{Match\}\(n,Z\_\{n\},G\)
7:if
vvis sufficiently similar to
nnthen
8:
Merge\(n,v,G\)\\textsc\{Merge\}\(n,v,G\)
9:else
10:
AddNode\(n,G\)\\textsc\{AddNode\}\(n,G\)
11:endif
12:endfor
13:
AddRelations\(E\.edges,G\)\\textsc\{AddRelations\}\(E\.\\text\{edges\},G\)
14:
Q←ExtractQueryEntities\(m\)Q\\leftarrow\\textsc\{ExtractQueryEntities\}\(m\)
15:
R←RetrieveRelevantNodes\(Q,G\)R\\leftarrow\\textsc\{RetrieveRelevantNodes\}\(Q,G\)
16:
S←ExpandSubgraph\(R,G\)S\\leftarrow\\textsc\{ExpandSubgraph\}\(R,G\)
17:
𝒞←Serialize\(S\)\\mathcal\{C\}\\leftarrow\\textsc\{Serialize\}\(S\)
18:ifForgettingTriggered\(G\)\(G\)then
19:
G←Forget\(G\)G\\leftarrow\\textsc\{Forget\}\(G\)
20:endif
21:return
\(𝒞,G\)\(\\mathcal\{C\},G\)
#### Deduplication Threshold Selection\.
To identify an appropriate deduplication threshold, we constructed a sequence of prompts containing repeated references to the same underlying entities while varying the wording and contextual phrasing across prompts\. This allowed us to evaluate how consistently semantically equivalent entities were merged as the similarity threshold changed\. We then selected the threshold that provided the best trade\-off between correctly merging duplicate entities and avoiding incorrect merges between distinct entities\.
### A\.6Computational Complexity
LetNNandMMbe the number of nodes and edges in the memory graph,ddthe embedding dimension,kkthe number of entities extracted from an incoming message,ℓ\\ellthe number of relations extracted with them, andqqthe number of entities extracted from a query\. Table[4](https://arxiv.org/html/2608.28978#A1.T4)summarises the cost of each stage; we exclude the internal cost of the LLM and embedding calls, which depends on token lengths rather than on graph size\.
Table 4:Per\-stage complexity under exhaustive vector search\.TTis the forgetting interval \(400 turns\), andVS,ESV\_\{S\},E\_\{S\}are the nodes and edges of the retrieved subgraph\.Two exhaustive vector scans dominate, one at de\-duplication and one at retrieval, giving a worst\-case per\-turn cost of
O\(\(k\+q\)Nd\+N\+M\)=O\(Nd\+M\),O\\big\(\(k\+q\)Nd\+N\+M\\big\)\\;=\\;O\(Nd\+M\),sincekk,qq, and the subgraph size are bounded by construction \(the traversal is capped at 15 nodes\)\. TheN\+MN\+Mterm arises only because the adjacency representation is rebuilt at query time and would vanish if it were persisted alongside the graph\. Space complexity isO\(Nd\+N\+M\)O\(Nd\+N\+M\), whereNdNdaccounts for stored embeddings andN\+MN\+Mfor graph structure and metadata\.
The linear\-scan terms are therefore the only components that grow with memory size, and both are incidental to the design: replacing the exhaustive search with an approximate nearest\-neighbour index would reduce theO\(Nd\)O\(Nd\)factor substantially, leaving the forgetting module as the mechanism that boundsNNitself\.
### A\.7Statistical Significance of Experimental Results
We report the statistical significance of the results underlying our main claim, namely that the forgetting module handles long\-term memory growth efficiently: it substantially reduces graph storage \(Table[2](https://arxiv.org/html/2608.28978#S4.T2)\) without a statistically significant loss in answer quality\. All intervals below are computed post\-hoc over the per\-question results produced by our benchmark runs \(Section[4](https://arxiv.org/html/2608.28978#S4)\); no additional model calls were made to compute them\.
#### Setup\.
The factor of variability captured by every interval below is*which questions were sampled from the fixed LongMemEval evaluation set*, i\.e\. we resample over questions; answer generation used temperature=0=0, so there is no additional decoding\-stochasticity component to capture\. Rows corresponding to a crashed or errored run were dropped before aggregation\. For each condition and metric we report the mean together with the standard error of the mean \(SEM, a 1\-σ\\sigmainterval, stated explicitly as such\) and a 95% confidence interval obtained from a nonparametric bootstrap \(10,000 resamples with replacement over questions, percentile method\), which makes no Normality assumption on the underlying metric distribution\. For the binary judge\-correctness metric, whose sampling distribution is a proportion bounded in\[0,1\]\[0,1\], we additionally report the 95% Wilson score interval, which by construction cannot extend outside\[0,1\]\[0,1\]; we prefer it over a symmetric interval for this metric to avoid the risk of implying out\-of\-range values\.
#### Per\-Condition Results\.
Table[5](https://arxiv.org/html/2608.28978#A1.T5)reports the mean±\\pmSEM and the 95% bootstrap confidence interval for each of the four experimental conditions\.
Table 5:Mean±\\pmSEM \(1σ\\sigma\) and 95% bootstrap CI for each condition,n=500n=500questions per condition\.Table 6:95% bootstrap confidence intervals corresponding to Table[5](https://arxiv.org/html/2608.28978#A1.T5)\. For judge accuracy, the 95% Wilson score interval is shown alongside the bootstrap CI\.
#### Paired Comparisons\.
To assess whether the differences between paired conditions are statistically significant, we compute a paired nonparametric bootstrap over the per\-question difference in each metric, matched by question ID between the two conditions being compared \(10,000 resamples\)\. We report the mean difference, its 95% bootstrap CI, and a two\-sided bootstrappp\-value \(twice the smaller tail fraction of resampled differences crossing zero, capped at 1\)\. A comparison is marked significant at theα=0\.05\\alpha=0\.05level when the 95% CI on the difference excludes zero\. Results are shown in Table[7](https://arxiv.org/html/2608.28978#A1.T7)\.
Table 7:Paired bootstrap comparisons between conditions\. A positive mean difference favors the first\-named condition;∗denotes significance atα=0\.05\\alpha=0\.05\.
#### Interpretation\.
None of the four metrics show a significant difference between the forgetting and no\-forgetting conditions \(Experiment 2\), which is the key evidence for the no\-quality\-loss half of our main claim\. The Graph RAG vs\. Baseline RAG comparison \(Experiment 1\) is included for completeness but is not load\-bearing for our main claim\.Similar Articles
Selective Memory Retention for Long-Horizon LLM Agents
This paper presents TraceRetain, a lightweight framework for bounded external memory in frozen LLM agents, demonstrating that selective retention differentiates from cache heuristics primarily when memory streams contain noise, offering task-success and efficiency benefits.
@neural_avb: Here's the latest paper on Graph Memory on LLM agents
A new paper introduces Graph Memory for LLM agents.
Memory is Reconstructed, Not Retrieved: Graph Memory for LLM Agents
MRAgent introduces a novel graph-based memory framework that dynamically reconstructs memory during reasoning, achieving up to 23% improvement on long-horizon benchmarks while reducing computational costs.
From Recall to Forgetting: Benchmarking Long-Term Memory for Personalized Agents
Researchers introduce Memora, a benchmark that evaluates LLMs’ ability to retain, update, and forget long-term user memories over weeks-to-months conversations, revealing frequent reuse of obsolete memories.
SF-AMS: Strategic Forgetting for Structured Memory in LLM Agent
SF-AMS is a framework for LLM agent memory that uses strategic forgetting to maintain compact high-utility memory, achieving significant gains in multi-hop and temporal reasoning tasks.