Source-linked AI summary
Mnemis: Dual-Route Retrieval on Hierarchical Graphs for Long-Term LLM Memory
Zihao Tang, Xin Yu, Ziyu Xiao, Zengxuan Wen, Zelin Li, Jiaxi Zhou, Hualei Wang, Haohua Wang, Haizhen Huang, Weiwei Deng, Feng Sun, Qi Zhang
TL;DR
Similarity-based memory retrieval can be limited when questions require global reasoning or comprehensive coverage. Mnemis combines similarity search over a base graph with top-down Global Selection over a hierarchical graph, and reports state-of-the-art results across compared long-term memory benchmarks.
Problem
Similarity-driven RAG and Graph-RAG can fall short on queries requiring global reasoning or comprehensive coverage, including when relevant information is weakly related to the query.
Source: §1 · p. 2Method
Mnemis pairs a base graph for similarity search with a hierarchical graph that supports top-down Global Selection over memory.
Source: §1 · p. 2Results
93.9 on LoCoMo and 91.6 on LongMemEval-S using GPT-4.1-mini, with state-of-the-art performance across all compared long-term memory benchmark methods.
Source: §1 · p. 3, §5 · p. 10Takeaways & Limitations
Combining semantic similarity retrieval with hierarchical traversal retrieves memory items that are both semantically and structurally relevant.
Source: §1 · pp. 2–3The hierarchical graph is currently periodically rebuilt when the base graph changes, with optimization left for future work.
Source: §2.2 · p. 4
Abstract
from arXiv · showhide
AI Memory, specifically how models organizes and retrieves historical messages, becomes increasingly valuable to Large Language Models (LLMs), yet existing methods (RAG and Graph-RAG) primarily retrieve memory through similarity-based mechanisms. While efficient, such System-1-style retrieval struggles with scenarios that require global reasoning or comprehensive coverage of all relevant information. In this work, We propose Mnemis, a novel memory framework that integrates System-1 similarity search with a complementary System-2 mechanism, termed Global Selection. Mnemis organizes memory into a base graph for similarity retrieval and a hierarchical graph that enables top-down, deliberate traversal over semantic hierarchies. By combining the complementary strength from both retrieval routes, Mnemis retrieves memory items that are both semantically and structurally relevant. Mnemis achieves state-of-the-art performance across all compared methods on long-term memory benchmarks, scoring 93.9 on LoCoMo and 91.6 on LongMemEval-S using GPT-4.1-mini.
1. Introduction
Similarity-driven RAG and Graph-RAG retrieve relevant memory efficiently, but can fall short on global reasoning or comprehensive coverage. Mnemis combines similarity search with hierarchical Global Selection to retrieve semantically and structurally relevant information.
1. Introduction
- Similarity-driven Graph-RAG is fast and effective, but can fall short on global reasoning or comprehensive coverage, especially when relevant facts are weakly related to a query.The example is a travel query where a mention of attending a conference in Detroit is buried in a long message.Source: §1 · pp. 1–2
- Global Selection builds a structured view of memory and scans its semantic hierarchy top-down, as in moving from Geography to Geographical Locations to Detroit.The paper describes this route as a System-2-style process that can avoid sub-query generation.Source: §1 · p. 2
- Mnemis pairs a base graph for similarity search with a hierarchical graph for Global Selection, combining retrieval patterns that the paper says real-world queries often benefit from.The base graph extracts Entities and Edges from historical Episodes; the hierarchy categorizes Entities bottom-up.Source: §1 · pp. 2–3
- 93.9 on LoCoMo and 91.6 on LongMemEval-S using GPT-4.1-mini; Mnemis reports state-of-the-art performance across all compared methods on long-term memory benchmarks.The introduction attributes this result to combining similarity search with Global Selection.Source: §1 · p. 3
2. Mnemis Methodology
Mnemis organizes memory in a base graph and a hierarchical graph, with similarity search and top-down Global Selection as corresponding retrieval routes. Its graph construction and retrieval procedures combine detailed memory records with structured abstraction and traversal.
2. Mnemis Methodology
- Mnemis uses a base graph and hierarchical graph to support System-1 Similarity Search and System-2 Global Selection.The framework is implemented based on Graphiti.Source: §2 · p. 3
2.1. Base Graph
- The base graph stores raw Episodes, descriptive Entities, and time-scoped Edges, while Episodic Edges link entities to their Episodes.Episode timestamps are recorded at valid_at; entity name and summary embeddings support flexible search.Source: §2.1 · p. 3
- Base-graph ingestion incrementally formats Episodes, extracts and deduplicates Entities and Edges using contextual Episodes, and rule-extracts the speaker as an Entity.Recent Episodes supply additional context during extraction, and reflection steps help capture omitted entity names and edges.Source: §2.1 · p. 3
2.2. Hierarchical Graph
- The hierarchy groups lower-layer nodes into Categories, balancing specific abstraction, multi-category membership, minimum child counts, and non-growing upper layers.Construction proceeds layer by layer and stops if compression constraints are violated or the maximum layer limit is reached.Source: §2.2 · p. 4
- The hierarchy is periodically rebuilt when the base graph changes; incremental update optimization is left for future work.A Speaker branch provides additional retrieval paths and may reduce sensitivity to local categorization errors.Source: §2.2 · p. 4
2.3. Memory Retrieval Mechanisms
- System-1 retrieves top-k Episodes, Entities, and Edges using embedding search and BM25, merges results with reciprocal rank fusion, then truncates to the search budget.Episodes, Entities, and Edges are re-ranked separately.Source: §2.3 · p. 5
- System-2 selects relevant Categories from the top layer downward, then retrieves all Episodes and Edges connected to selected lowest-level Entities.It has no strict top-k constraint because selection at each layer is determined by the LLM.Source: §2.3 · p. 5
- After both routes, a re-ranking model separately re-ranks Episodes, Entities or Categories, and Edges before they are formatted as context for the answer model.Early stopping can end Global Selection when all child nodes under a branch are deemed relevant.Source: §2.3 · p. 5
3. Experiments
Experiments on LoCoMo and LongMemEval-S compare Mnemis with memory-system baselines and examine its retrieval routes, top-k setting, and backend models. Mnemis outperforms the compared baselines, while route and top-k analyses show complementary strengths and retrieval-budget effects.
3.1. Experiment Setups
- The evaluation uses LoCoMo and LongMemEval-S, compares Mnemis with memory-system baselines, and scores answers with an LLM-as-a-Judge while excluding LoCoMo Category 5.The main setup uses top-k = 10 episodes and top-2k = 20 entities and edges; the grader is GPT-4.1-mini.Source: §3.1 · pp. 5–6
3.2. Experiment Results
- Mnemis consistently outperforms all baselines across LoCoMo and LongMemEval-S with a limited context budget of 10 episodes, 20 entities, and 20 edges.It reaches near-saturated scores on easier tasks and larger margins on challenging multi-hop, temporal, or event-reasoning categories.Source: Table 1 · p. 6, §3.2 · pp. 6–7, Table 2 · p. 7
3.3. Ablation Study
- The ablation study examines retrieval-route contributions, backend models, and top-k settings using LoCoMo with GPT-4.1-mini.Its listed backend dimensions are the re-ranker, embedding model, and LLM.Source: §3.3 · p. 7
3.3.1. Influence of System-1 and System-2 Routing
- Combining System-1 and System-2 improves all reported categories; System-1 RAG + Graph scores higher than either alone, and re-ranking does not primarily explain the joint-route gain.System-2 is expected to suit enumerative queries better than temporal ones, where an unchanged query may miss the full event sequence; the LoCoMo example contrasts retrieving gastritis with tracing overweight as its root cause.Source: Table 4 · p. 8, §3.3.1 · pp. 8–9, Figure 3 · p. 8
3.3.2. Impact of top-k
- Reducing top-k from 10 to 5 lowers performance in most settings; System-1 RAG is especially sensitive, while RAG + Graph is more stable.Applying the re-ranker in System-2 Only or System-1 + System-2 further minimizes fluctuations.Source: Figure 4 · p. 9, §3.3.2 · p. 9
3.3.3. Effect of Backend Models
- Switching the backend LLM from GPT-4o-mini to GPT-4.1-mini improves results across datasets and question types, while smaller re-rankers cause only minor regressions.The paper reports that the LLM trend also appears in baseline methods and recommends GPT-4.1-mini for its cost-performance trade-off.Source: §3.3.3 · p. 9, Table 5 · p. 10
4. Related Work
Memory research includes context-window expansion and retrieval-based approaches. Graph-RAG structures memory as a graph, while Mnemis differs from GraphRAG in how it builds and searches its hierarchy.
4. Related Work
- Context-window expansion can make full-history input costly and inefficient, while irrelevant historical messages may dilute the context.The passage attributes the cost to transformers’ quadratic scaling with input length.Source: §4 · p. 10
- GraphRAG assigns each lower-level node to one parent through community detection, whereas Mnemis permits many-to-many category mappings.GraphRAG queries communities independently and aggregates their answers; Mnemis browses its hierarchy top-down and answers from aggregated memory context.Source: §4 · p. 10
- Retrieval-based approaches store messages as Episodes and retrieve relevant items, while Graph-RAG also extracts Entities and Edges into a structured graph.The passage distinguishes episodic-memory RAG from Graph-RAG’s use of semantic-memory concepts.Source: §4 · p. 10
5. Conclusion
Mnemis combines a refined base graph for System-1 similarity search with a hierarchical graph for System-2 Global Selection. It reports higher accuracy than existing RAG and Graph-RAG approaches on memory benchmarks, while identifying broader modality support and more flexible traversal and planning as future directions.
5. Conclusion
- 93.9 in LoCoMo and 91.6 on LongMemEval-S are Mnemis’s reported benchmark scores.The conclusion presents these results alongside its claim of more accurate retrieval than existing RAG and Graph-RAG approaches.Source: §5 · p. 10
- Mnemis combines a refined base graph for System-1 Similarity Search with a hierarchical graph for System-2 Global Selection.The conclusion describes this as a unified framework for organizing and retrieving AI memory.Source: §5 · p. 10
- Future work aims to support more data modalities and enhance Global Selection with more flexible graph traversal and planning mechanisms.Source: §5 · p. 11
A. Case Study
The case study illustrates how Mnemis uses hierarchical browsing to retrieve multiple sports-event memories for a question that similarity-based retrieval may not cover completely. Category summaries and connected edges can support the answer even when some ground-truth entities are filtered from the final context.
A. Case Study
- Figure 5 depicts a LongMemEval-S win in which Mnemis retrieves “Company’s Annual Charity Soccer Tournament” from “Sports Events.”Source: Figure 5 · p. 14
- Similarity-based retrieval may miss some relevant sports events when a limited top-k is used, while Mnemis browses from “Sports” through “Sports Events” and “Sporting Events.”The question asks the model to order three sports events the user participated in during June 2026.Source: A. Case Study · p. 14
- Although “Midsummer 5K Run” and “charity soccer tournament” are filtered from the final context, their related edges remain retrieved at ranks 9 and 2, respectively.Source: A. Case Study · p. 14
- Category nodes such as “Sports Events” summarize their children and provide enough content for the model to answer correctly.Source: A. Case Study · p. 14
B.1. Evaluation Metrics
The evaluation primarily uses LLM-as-a-Judge with the official prompt and includes a small human check. Mnemis is reported to outperform all baselines on both benchmarks, but several systems are excluded from comparable main evaluation because implementation details are incomplete.
B.1. Evaluation Metrics
- LLM-as-a-Judge is the primary comparison metric, using the official judging prompt; the authors also conduct a small-scale human evaluation.Source: §B.1 · p. 14
- Table 8 reports LoCoMo LLM-as-a-Judge scores by question type and excludes Category 5 (Adversarial).Source: Table 8 · p. 15
- Human evaluation sampled 60 questions from 1,540 LoCoMo evaluation instances, and the authors observed no misalignment with the LLM judge.The sample included three outputs labeled correct and three labeled incorrect per user; Table 7 lists sampled question IDs.Source: §B.1 · pp. 14–15, Table 7 · p. 15
- MIRIX, MemU, and Emergence-Mem are excluded from comparable main evaluation because implementation details are incomplete; their best public results are reported despite configuration differences.Source: §B.1 · p. 15
- Mnemis consistently outperforms all baseline methods across both benchmarks.The full results are reported in tables 8 and 9.Source: §B.1 · p. 15
C. Detailed Performance Impact of top-k
Performance varies with top-k by retrieval strategy, while combining System-1 and System-2 yields the highest and most stable overall performance in the reported comparison.
C. Detailed Performance Impact of top-k
- 49.6→81.6: increasing top-k improves RAG across question categories, with particularly large gains on Multi-Hop, though its Multi-Hop performance peaks at 81.6.The passage notes RAG remains relatively weak on Multi-Hop even at high top-k.Source: C. Detailed Performance Impact of top-k · p. 15
- 86.7: System-1 Graph reaches this Single-Hop score at top-k = 5, while its improvement curve is flatter than RAG’s on Temporal and Open-Domain questions.The passage says graph structure surfaces salient relational information, but cannot fully compensate for missing richer semantic context.Source: C. Detailed Performance Impact of top-k · pp. 15–16
- 83.2 vs. 61.4/70.1 at top-k = 5: combining RAG and Graph benefits Multi-Hop and Temporal queries most.The hybrid’s performance improves steadily and remains stable under lower top-k settings.Source: C. Detailed Performance Impact of top-k · p. 16
- 92.2–93.9 Overall: System-1 + System-2 consistently delivers the highest and most stable performance, further reducing sensitivity to top-k.The passage attributes noise filtering and evidence prioritization to the re-ranker.Source: C. Detailed Performance Impact of top-k · p. 16
D. Prompts
The prompts guide an LLM to build a layered semantic categorization of nodes and then select potentially useful nodes from the hierarchy for a query.
D. Prompts
- The categorization prompt groups nodes by shared attributes using names and descriptions, allows multiple category assignments, and requires indexed output with category names that do not use “and.”It also specifies concise node tags and directs the model to reuse existing categories when applicable.Source: D. Prompts · pp. 16–17
- Hierarchical examples progress from specific entities to broader abstractions, permit multiple parent categories, and disallow leftover or ungrouped nodes.The instructions also require first-person references and “user” to be categorized as “Speaker.”Source: D. Prompts · pp. 18–19
- The Global Selection prompt asks for nodes directly related to the query or useful as context, including nodes likely to have helpful children.It cautions against being overly strict about partially redundant nodes.Source: D. Prompts · p. 20
- For each selected node, the prompt requests its name, UUID, and a get_all_children Boolean that is true only when all sub-nodes are confidently helpful.Source: D. Prompts · p. 20