Title: 2604.08256
ArXiv: 2604.08256

HyperMem: Hypergraph Memory for Long-Term Conversations

Title:

Content selection saved. Describe the issue below:

Description:

License: arXiv.org perpetual non-exclusive license

arXiv:2604.08256v2 [cs.CL] 10 Apr 2026

HyperMem: Hypergraph Memory for Long-Term Conversations

Juwei Yue

1,2,3

,

Chuanrui Hu

1

1

footnotemark:

1

3

,

Jiawei Sheng

1,2

,

Zuyi Zhou

3

,

Wenyuan Zhang

1,2

,

Tingwen Liu

1,2

,

Li Guo

1,2

,

Yafeng Deng

2

2

footnotemark:

2

3

1

Institute of Information Engineering, Chinese Academy of Sciences

2

School of Cyber Security, University of Chinese Academy of Sciences

3

EverMind AI

{yuejuwei, shengjiawei}@iie.ac.cn, {chuanrui.hu, dengyafeng}@shanda.com

Equal contribution.

Corresponding author.

Abstract

Long-term memory is essential for conversational agents to maintain coherence, track persistent tasks, and provide personalized interactions across extended dialogues.
However, existing approaches as Retrieval-Augmented Generation (RAG) and graph-based memory mostly rely on pairwise relations, which can hardly capture high-order associations, i.e., joint dependencies among multiple elements, causing fragmented retrieval.
To this end, we propose

HyperMem

, a hypergraph-based hierarchical memory architecture that explicitly models such associations using hyperedges.
Particularly, HyperMem structures memory into three levels:

topics

,

episodes

, and

facts

, and groups related episodes and their facts via hyperedges, unifying scattered content into coherent units.
Leveraging this structure, we design a hybrid lexical-semantic index and a coarse-to-fine retrieval strategy, supporting accurate and efficient retrieval of high-order associations.
Experiments on the LoCoMo benchmark show that HyperMem achieves state-of-the-art performance with 92.73% LLM-as-a-judge accuracy, demonstrating the effectiveness of HyperMem for long-term conversations.

HyperMem: Hypergraph Memory for Long-Term Conversations

Juwei Yue

†

†

thanks:

Equal contribution.

1,2,3

,
Chuanrui Hu

1

1

footnotemark:

1

3

,
Jiawei Sheng

†

†

thanks:

Corresponding author.

1,2

,
Zuyi Zhou

3

,
Wenyuan Zhang

1,2

,

Tingwen Liu

1,2

,

Li Guo

1,2

,

Yafeng Deng

2

2

footnotemark:

2

3

1

Institute of Information Engineering, Chinese Academy of Sciences

2

School of Cyber Security, University of Chinese Academy of Sciences

3

EverMind AI

{yuejuwei, shengjiawei}@iie.ac.cn, {chuanrui.hu, dengyafeng}@shanda.com

1

Introduction

Conversational agents

Zhang

et al.

(

2025e

)

increasingly serve as long-term companions, requiring coherent multi-hop reasoning, persistent task tracking, and personalized interactions across extended dialogues.
However, their fixed context windows render historical experiences inaccessible as conversations grow, necessitating effective and efficient long-term memory management

Li

et al.

(

2025b

); Hu

et al.

(

2026

); Zhang

et al.

(

2026

)

.

Figure 1:

Memory structure comparison across Chunk-based RAG, Graph-based RAG, and our HyperMem.

Existing approaches such as Retrieval-Augmented Generation (RAG)

Gao

et al.

(

2023

); Fan

et al.

(

2024

)

and graph-based memory

Zhang

et al.

(

2025a

); Rasmussen

et al.

(

2025

)

retrieve external stored related information to enrich the context in response to user queries.
However, both paradigms fundamentally rely on pairwise relationships, which inherently fail to capture

high-order associations

, i.e., joint dependencies among three or more related content elements.
As shown in Figure

1

(a), a conversation may cover multiple topics such as

sport

and

work

.
Episodes 1, 3, and 4 are jointly associated under the

sport

topic and involve multiple facts scattered throughout the dialogue.
Conventional methods, as shown in Figure

1

(b) and (c), can hardly model the holistic coherence among episodes and facts, leading to fragmented retrieval.

To explicitly capture the above high-order associations, we model long-term memory as a hypergraph (Figure

1

(d)).
Unlike conventional graphs with pairwise edges, hypergraphs support

hyperedges

that connect arbitrary node sets, making them uniquely capable of modeling joint dependencies in dialogue.
Our architecture, namely

HyperMem

, organizes a three-level memory hierarchy:
(i)

Topic

nodes, representing key conversation themes;
(ii)

Episode

nodes, denoting temporally contiguous dialogue segments centered on a single topic; and (iii)

Fact

nodes, encoding fine-grained details extracted from episodes.
Thereafter, we use hyperedges to explicitly group all episodes sharing the same topic, as well as all facts belonging to the same episode.
These hyperedges may naturally overlap across episodes and facts, reflecting the multifaceted nature of conversational content while preserving semantic coherence within each group.
As a result, semantically scattered information is unified into coherent units, enabling complete and efficient retrieval of high-order associations.

To construct HyperMem, we first detect episode boundaries from the dialogue stream, then aggregate topically related episodes into shared topics using hyperedges, and finally extract fine-grained facts from each episode content.
For indexing, we leverage lexical cues and exploit dense semantics with hypergraph embedding propagation.
This enables semantically related memories, even if temporally distant, to derive aligned embeddings, thereby facilitating the retrieval of high-order associations.
At retrieval time, HyperMem performs a coarse-to-fine search:
it first identifies relevant topics, then expands to their constituent episodes, and finally selects the most pertinent facts to construct a focused context for response generation.
Our contributions are summarized as follows:

•

We propose HyperMem, a pioneering three-level hypergraph memory architecture that explicitly models high-order associations via hyperedges, overcoming the limitations of pairwise relation methods to capture holistic coherence.

•

We leverage the HyperMem structure to derive accurate lexical and semantical indexing, and design a coarse-to-fine retrieval strategy to enable efficient early pruning of irrelevant context.

•

Experiments on the LoCoMo benchmark achieve state-of-the-art performance with 92.73% LLM-as-a-judge accuracy, demonstrating the effectiveness of HyperMem for long-term conversations.

2

Related works

2.1

Retrieval-Augmented Generation

RAG has proven effective in mitigating hallucinations

Ayala and Béchard (

2024

)

and improving reliability

Xia

et al.

(

2025

); Asai

et al.

(

2024

)

, and also serve as a foundation for long-term memory in LLM-powered agents

Gutierrez

et al.

(

2024

); Gutiérrez

et al.

(

2025

); Lin

et al.

(

2025

)

.

Vanilla methods retrieve relevant fragments from external sources and use them as context for more grounded responses

Lewis

et al.

(

2020

); Kulkarni

et al.

(

2024

)

.
To enrich relational structures, GraphRAG

Edge

et al.

(

2024

)

pioneered knowledge graph construction, inspiring works

He

et al.

(

2024

); Hu

et al.

(

2025b

); Luo

et al.

(

2024

); Dong

et al.

(

2024

); Chen

et al.

(

2025

); Guo

et al.

(

2025

); Fan

et al.

(

2025

); Li

et al.

(

2025a

)

that leverage graph topology for structure-aware reasoning and multi-hop retrieval.
For hierarchical modeling, RAPTOR

Sarthi

et al.

(

2024

)

, SiReRAG

Zhang

et al.

(

2025c

)

, and HiRAG

Huang

et al.

(

2025

)

build tree-structured indices for multi-granular evidence integration.
However, these methods rely on pairwise edges that cannot explicitly group multiple scattered yet semantically related memories.

Recent works

Luo

et al.

(

2025

); Feng

et al.

(

2025

); Sharma

et al.

(

2024

); Hu

et al.

(

2025a

)

preliminarily explore hypergraphs to model multi-entity relations with hyperedges.
However, these approaches are designed for static knowledge bases with determinate corpora, where agentic memory continuously evolves with ongoing dialogues.
Besides, they lack a hierarchical retrieval mechanism capable of preserving semantic coherence across extended dialogues.
Our work pioneers the hypergraph in structuring agentic memory, which has quite different problem settings and technical designs.

2.2

Memory System of Agents

Recent agents have used RAG to model long-term memory, where MemoryBank

Zhong

et al.

(

2024

)

, A-Mem

Xu

et al.

(

2025

)

, Mem0

Chhikara

et al.

(

2025

)

, and Zep

Rasmussen

et al.

(

2025

)

build structured or graph-based representations for persistence between sessions and tracking of the evolution of facts.
G-Memory

Zhang

et al.

(

2025a

)

and LightMem

Fang

et al.

(

2025

)

further explore hierarchical structures and compression for efficiency.

Figure 2:

Framework of HyperMem. The indexing detects episode boundaries, aggregates topics via hyperedges, and extracts facts. The retrieval performs coarse-to-fine search from topics to episodes to facts.

In parallel, several approaches eschew explicit retrieval.
MemGPT

Packer

et al.

(

2023

)

and MemOS

Li

et al.

(

2025b

)

draw on abstractions from operating systems with hierarchical memory and modular scheduling.
MIRIX

Wang and Chen (

2025

)

coordinates multi-agent states via shared memory spaces, while Nemori

Nan

et al.

(

2025

)

and MemGen

Zhang

et al.

(

2025b

)

form compressible or generative latent representations.
MemInsight

Salama

et al.

(

2025

)

, Mem1

Zhou

et al.

(

2025

)

, Memory-R1

Yan

et al.

(

2025

)

, and Mem-

α

\alpha

Wang

et al.

(

2025

)

employ reinforcement learning to autonomously optimize memory storage and retrieval policies.
In contrast, HyperMem explicitly groups topically related memories via hyperedges and employs topic-guided hierarchical retrieval to ensure relevance across temporal gaps.

3

Approach

In this section, we present the HyperMem architecture for long-term conversational agents, including hypergraph memory structure, hypergraph construction from dialogue streams, and hypergraph-guided retrieval for response generation.

3.1

Hypergraph Memory Structure

To capture higher-order associations among related elements, we model memories with hypergraphs.
Unlike conventional graphs limited to pairwise relations, hypergraphs connect multiple nodes via a single hyperedge.
This enables richer relational modeling and naturally reflects the associative nature of human memory

Anderson and Bower (

2014

)

.

To effectively organize this memory, we design a three-level hypergraph architecture, where hyperedges link nodes within each level:

•

Topic-level

: Captures dialogues sharing a common theme across long-term interactions, facilitating long-range topical associations.

•

Episode-level

: Represents temporally contiguous dialogue segments that describe a coherent event or sub-conversation.

•

Fact-level

: Encodes atomic facts extracted from episodes, serving as precise retrieval targets for query-based access.

Formally, given an input dialogue stream

X

=

{

x

t

}

t

=

1

T

X=\{x_{t}\}_{t=1}^{T}

, we construct the memory hypergraph as:

ℋ

=

(

𝒱

T

∪

𝒱

E

∪

𝒱

F

,

ℰ

E

∪

ℰ

F

)

,

\mathcal{H}=(\mathcal{V}^{T}\cup\mathcal{V}^{E}\cup\mathcal{V}^{F},\ \mathcal{E}^{E}\cup\mathcal{E}^{F}),

(1)

where

𝒱

T

,

𝒱

E

,

𝒱

F

\mathcal{V}^{T},\mathcal{V}^{E},\mathcal{V}^{F}

denote the topic, episode, and fact nodes, respectively.
Here, hyperedges

ℰ

E

\mathcal{E}^{E}

connect all episode nodes within the same topic along with each node weight

w

E

∈

[

0

,

1

]

{w}^{E}\in[0,1]

, while hyperedges

ℰ

F

\mathcal{E}^{F}

connect all fact nodes belonging to the same episode with the node weight

w

F

∈

[

0

,

1

]

{w}^{F}\in[0,1]

.

3.2

Hypergraph Memory Construction

To construct the hypergraph memory, we employ a three-stage process.
We first detect

episodes

by segmenting the raw dialogue stream into atomic sequences, then aggregate topically related episodes into

topics

, and finally extract queryable informative

facts

grounded in their context.

3.2.1

Episode Detection

A dialogue stream often interweaves multiple events and shifts topics over time.
Storing it as a monolithic block would obscure event boundaries and entangle events of interest with irrelevant context.
To address this, we introduce

Episode

to enable precise event boundary preservation and isolate irrelevant content from dialogue context.

Method.

To derive episodes, we design an LLM-driven streaming boundary detection mechanism.
Consider an incoming dialogue stream

X

=

{

x

t

}

t

=

1

T

X=\{x_{t}\}_{t=1}^{T}

.
We employ a buffer

ℋ

\mathcal{H}

to pend the history, and determine if the incoming dialogue completes a coherent episode.
Specifically, for each incoming

x

t

x_{t}

, we add it to

ℋ

<

t

\mathcal{H}_{<t}

and invoke an LLM-based boundary detector that evaluates:
(1)

semantic completeness

of current buffer

ℋ

≤

t

\mathcal{H}_{\leq t}

, (2) the

time gap

between consecutive dialogues, and (3)

linguistic signals

indicating topic transition or completion.

The detector outputs two signals:

should_end

, i.e., the buffer forms a semantically complete event, and

should_wait

, i.e., the event is still unfolding and requires further input.
If

should_end

is triggered, we create an informative

Episode node

, i.e.,

v

E

=

(

v

dialogue

E

,

v

title

E

,

v

episode

E

)

v^{E}=(v^{E}_{\textrm{dialogue}},v^{E}_{\textrm{title}},v^{E}_{\textrm{episode}})

, where

v

dialogue

E

v^{E}_{\textrm{dialogue}}

stores the raw conversation turns,

v

title

E

v^{E}_{\textrm{title}}

abstracts a concise subject, and

v

episode

E

v^{E}_{\textrm{episode}}

offers a brief narrative summary.
The buffer is then cleared, and processing continues with subsequent dialogues.
For the algorithm and prompt, see Algo.

1

and Figure

6

.

Remark.

In this way, we process dialogue streams incrementally and segment them into semantically coherent memory units.
This reduces irrelevant context and also improves the convenience of topic organization and retrieval.

3.2.2

Topic Aggregation

Episodes capture event-level fragments within contiguous temporal windows.
However, as shown in Figure

1

, real-world narratives about a specific topic can also be temporally dispersed.
Existing designs

Chhikara

et al.

(

2025

); Luo

et al.

(

2025

)

usually isolate such correlated associations, making it difficult to retrieve the full narrative.
To address this, we devise

Topic

to aggregate scattered episodes, and leverage hyperedges to connect multiple episodes that belong to the same topic.

Method.

Practically, we design an LLM-driven streaming topic aggregation mechanism.
Given the current target episode

v

cur

E

v^{E}_{\text{cur}}

, we retrieve historical similar episodes

𝒞

E

\mathcal{C}^{E}

using lexical and semantic similarity (detailed in §

3.3.1

).
By comparing

v

cur

E

v^{E}_{\text{cur}}

with

𝒞

E

\mathcal{C}^{E}

, there are three cases to handle:

1.

Topic Initialization.

If

𝒞

E

=

∅

\mathcal{C}^{E}=\emptyset

, we create a new topic

v

T

=

(

v

title

T

,

v

summary

T

)

v^{T}=(v^{T}_{\textrm{title}},v^{T}_{\textrm{summary}})

for

v

cur

E

v^{E}_{\text{cur}}

.
Here,

v

title

T

v^{T}_{\textrm{title}}

and

v

summary

T

v^{T}_{\textrm{summary}}

are the title and summary according to

v

cur

E

v^{E}_{\text{cur}}

generated by the LLM.

2.

Topic Creation.

If

𝒞

E

≠

∅

\mathcal{C}^{E}\neq\emptyset

but the potential topic of

v

cur

E

v^{E}_{\text{cur}}

is different from the existing topics of episodes in

𝒞

E

\mathcal{C}^{E}

, we create a new topic

v

T

=

(

v

title

T

,

v

summary

T

)

v^{T}=(v^{T}_{\textrm{title}},v^{T}_{\textrm{summary}})

for

v

cur

E

v^{E}_{\text{cur}}

, by comparing

v

cur

E

v^{E}_{\text{cur}}

with all episodes in

𝒞

E

\mathcal{C}^{E}

by the LLM.

3.

Topic Update.

If

𝒞

E

≠

∅

\mathcal{C}^{E}\neq\emptyset

and the potential topic of

v

cur

E

v^{E}_{\text{cur}}

existed in

𝒞

E

\mathcal{C}^{E}

, we update each matched topic incorporating

v

cur

E

v^{E}_{\text{cur}}

and regenerating its metadata

v

T

=

(

v

title

T

,

v

summary

T

)

v^{T}=(v^{T}_{\textrm{title}},v^{T}_{\textrm{summary}})

.

After this process, we construct a hyperedge

e

t

E

∈

ℰ

E

e^{E}_{t}\in\mathcal{E}^{E}

linking the topic to all its constituent episodes, and the LLM assigns an importance weight

w

e

,

v

E

∈

[

0

,

1

]

w^{E}_{e,v}\in[0,1]

to each episode based on its contribution to the topic.
For the algorithm and prompt, see Algo.

1

and Figure

7

.

Remark.

In this way, the resulting topic nodes act as semantic anchors of episodes potentially spanning weeks or months.
This also enables comprehensive retrieval of entire narratives by query matching, regardless of temporal fragmentation.

3.2.3

Fact Extraction

Episodes preserve rich narrative context but often contain verbose dialogue that is inefficient for direct query answering.
To enable query-oriented retrieval, we extract

Facts

with language expressions, the compact assertion grounded in episode context, as fine-grained memory units.

Method.

Given a topic

t

t

and its associated episodes

𝒱

t

E

\mathcal{V}^{E}_{t}

, we use an LLM to identify salient factual assertions, using the full topical context to avoid redundant or trivial extractions.
Here, each fact node is formed as

v

F

=

(

v

content

F

,

v

potential

F

,

v

keywords

F

)

v^{F}=(v^{F}_{\textrm{content}},v^{F}_{\textrm{potential}},v^{F}_{\textrm{keywords}})

, where

v

content

F

v^{F}_{\textrm{content}}

records the factual assertion,

v

potential

F

v^{F}_{\textrm{potential}}

lists query patterns this fact is likely to answer, enabling proactive alignment with user’s potential intents, and

v

keywords

F

v^{F}_{\textrm{keywords}}

captures representative terms to facilitate keyword-based retrieval.
To maintain provenance, each fact is explicitly anchored to the original episode(s).
For each episode

v

E

v^{E}

, we construct a fact hyperedge

e

F

∈

ℰ

F

e^{F}\in\mathcal{E}^{F}

that connects all the facts involved, with the LLM assigning an importance weight

w

e

,

v

F

∈

[

0

,

1

]

w^{F}_{e,v}\in[0,1]

to reflect the relative importance of each fact.
For the algorithm and prompt, see Algo.

1

and Figure

8

.

Remark.

In this way, the resulting fact nodes serve as atomic query-targeted units.
Unlike raw dialogue for retrieval,

v

potential

F

v^{F}_{\textrm{potential}}

anticipates relevant queries while

v

keywords

F

v^{F}_{\textrm{keywords}}

supports lexical search, allowing retrieval with concise, directly answerable evidence rather than verbose transcripts.

3.3

Hypergraph Memory Retrieval

To respond to the user’s query, the agent retrieves relevant memories through a coarse-to-fine process that traverses from

topic

to

episode

to

fact

.
This combines an offline indexing phase with an online retrieval strategy for practical usage.

3.3.1

Offline Index Construction

User queries often exhibit both lexical cues and semantic intent, which are crucial to accurately retrieve relevant memories.
To fully leverage both signals, we construct dual indices for all node types, including topic, episode and fact:
a sparse keyword-based index using BM25

(Robertson and Zaragoza,

2009

)

, and a dense semantic index powered by Qwen3-Embedding-4B

(Zhang

et al.

,

2025d

)

.
Specifically, each node is first converted into a textual document for BM25 indexing to support exact keyword matching, and then encoded into a dense vector via the embedding model to capture deeper semantic similarity.

Hypergraph Embedding Propagation.

The nodes linked by the same hyperedge share a common topical context, and are expected to acquire similar representations.
To this end, we propose a lightweight embedding propagation process that enriches node embeddings by aggregating information from their incident hyperedges.
First, we compute a hyperedge embedding as a weighted aggregation of its constituent node embeddings:

𝒉

e

=

∑

v

∈

𝒱

​

(

e

)

α

e

,

v

​

𝒉

v

,

α

e

,

v

=

exp

⁡

(

w

e

,

v

)

∑

u

∈

𝒱

​

(

e

)

exp

⁡

(

w

e

,

u

)

,

\begin{split}\bm{h}_{e}&=\sum_{v\in\mathcal{V}(e)}\alpha_{e,v}\,\bm{h}_{v},\\
\alpha_{e,v}&=\frac{\exp(w_{e,v})}{\sum_{u\in\mathcal{V}(e)}\exp(w_{e,u})},\end{split}

(2)

where

𝒉

v

\bm{h}_{v}

denotes the initial (dense) embedding of node

v

v

, and

w

e

,

v

∈

[

0

,

1

]

w_{e,v}\in[0,1]

is the importance weight assigned during topic aggregation, e.g., by an LLM based on narrative contribution.

Next, we refine the representation of each node by aggregating the embeddings of all hyperedges in which it participates:

𝒉

v

′

=

𝒉

v

+

λ

⋅

Agg

e

∈

𝒩

​

(

v

)

⁡

(

𝒉

e

)

,

\bm{h}^{\prime}_{v}=\bm{h}_{v}+\lambda\cdot\operatorname{Agg}_{e\in\mathcal{N}(v)}(\bm{h}_{e}),

(3)

where

𝒩

​

(

v

)

\mathcal{N}(v)

denotes the set of hyperedges incident to

v

v

,

λ

≥

0

\lambda\geq 0

is a hyperparameter to control the strength of propagation, and

Agg

\operatorname{Agg}

is an aggregation function, e.g., summation.
See Algo.

2

for the algorithm.

Remark.

This propagation mechanism is inspired by hypergraph neural networks

Feng

et al.

(

2019

)

, yet remains lightweight without large-scale fine-tuning.
Empirical studies demonstrate its effectiveness.
Besides, it enables semantically related memories to acquire aligned embeddings, which derive more informative embeddings and also facilitate high-order associations during retrieval.

3.3.2

Online Retrieval Strategy

Given a user query

q

q

, retrieval proceeds as a structured coarse-to-fine traversal with progressive top-

k

k

selection at each level.

Stage 1: Topic Retrieval.

We retrieve from the topic-level to establish the topical context.
All topic nodes

𝒱

T

\mathcal{V}^{T}

are scored using both keyword and vector indices, with rankings fused via Reciprocal Rank Fusion (RRF):

RRF

​

(

d

)

=

∑

m

=

1

M

1

k

+

rank

m

​

(

d

)

\mathrm{RRF}(d)=\sum^{M}_{m=1}\frac{1}{k+\mathrm{rank}_{m}(d)}

(4)

where

m

m

indexes individual rankers and

k

k

is a smoothing constant.
The RRF-ranked candidates are then refined by a reranker model, which computes fine-grained query-document relevance scores to improve ranking precision.
We select the top-

k

T

k^{T}

topic nodes as candidates, which filters out most irrelevant topical contexts.

Stage 2: Episode Retrieval.

For each selected topic

t

t

, we expand to its constituent episodes

𝒱

t

E

\mathcal{V}^{E}_{t}

via the episode-hyperedge

e

t

E

e^{E}_{t}

.
Following Stage 1, the expanded episodes are scored via RRF and then refined by the reranker.
We retain the top-

k

E

k^{E}

episodes as the results.
This stage ensures that only the query-relevant temporal segments within each topic are preserved.

Stage 3: Fact Retrieval.

Finally, each retained episode

e

e

is expanded to its supporting facts

𝒱

e

F

\mathcal{V}^{F}_{e}

through the fact hyperedge

e

e

F

e^{F}_{e}

.
Following the same RRF-then-rerank pipeline, we select the top-

k

F

k^{F}

facts as the final retrieval result.

Final Response Generation.

Instead of using verbose raw dialogue text, we construct the

response context

from the

content

fields of retrieved

facts

, optionally augmented with the

summary

fields of their sourced upper-level

episodes

for narrative context.
This design significantly reduces token consumption while preserving answerable information.
The constructed response context is input into the conversational agent, and the response is returned as the answer to the user query.
See Algo.

3

for the algorithm.

4

Experiments

In this section, we conduct experiments to evaluate the effectiveness of our HyperMem.

Methods

Single-hop

Multi-hop

Temporal

Open Domain

Overall

GraphRAG

Edge

et al.

(

2024

)

79.55

54.96

50.16

58.33

67.60

LightRAG

Guo

et al.

(

2025

)

86.68

84.04

60.75

71.88

79.87

HippoRAG 2

Gutiérrez

et al.

(

2025

)

86.44

75.89

78.50

66.67

81.62

HyperGraphRAG

Luo

et al.

(

2025

)

90.61

80.85

85.36

70.83

86.49

OpenAI

1

63.79

42.92

21.71

62.29

52.90

LangMem

2

62.23

47.92

23.43

71.12

58.10

Zep

Rasmussen

et al.

(

2025

)

61.70

41.35

49.31

76.60

65.99

A-Mem

Xu

et al.

(

2025

)

39.79

18.85

49.91

54.05

48.38

Mem0

Chhikara

et al.

(

2025

)

67.13

51.15

55.51

72.93

66.88

Mem0

g

Chhikara

et al.

(

2025

)

65.71

47.19

58.13

75.71

68.44

MIRIX

Wang and Chen (

2025

)

†

85.11

83.70

88.39

65.62

85.38

Memobase

3

73.12

64.65

81.20

53.12

72.01

MemU

4

66.34

63.12

27.10

50.01

56.55

MemOS

Li

et al.

(

2025b

)

81.09

67.49

75.18

55.90

75.80

HyperMem (Ours)

96.08

93.62

89.72

70.83

92.73

Table 1:

Comparison of HyperMem with RAG-based and memory system methods on the LoCoMo benchmark. Evaluation metric is LLM-as-a-judge accuracy (%) scored by GPT-4o-mini.

†

\dagger

indicates results obtained using GPT-4.1-mini. Results for RAG-based methods are reproduced using their official implementations. Results for memory systems are primarily sourced from

Chhikara

et al.

(

2025

); Wang and Chen (

2025

); Li

et al.

(

2025b

)

.

4.1

Experimental Setup

Benchmark.

LoCoMo

Maharana

et al.

(

2024

)

is a benchmark dataset designed to evaluate long-term memory capabilities in conversational AI systems.
It contains multi-session dialogues spanning several months, with four categories of questions: single-hop (direct fact retrieval), multi-hop (reasoning across multiple dialogue turns), temporal reasoning (time-related queries), and Open Domain (open-ended questions requiring broader context understanding).

Baselines.

We compare our approach against representative methods from RAG and memory system.
(1)

RAG

methods: RAG, GraphRAG

Edge

et al.

(

2024

)

, LightRAG

Guo

et al.

(

2025

)

, HippoRAG 2

Gutiérrez

et al.

(

2025

)

, and HyperGraphRAG

Luo

et al.

(

2025

)

.
(2)

Memory system

methods:
OpenAI

1

1

1

https://openai.com/zh-Hans-CN/index/memory-and-new-controls-for-chatgpt/

,
LangMen

2

2

2

https://langchain-ai.github.io/langmem/

,
Zep

Rasmussen

et al.

(

2025

)

, A-Mem

Xu

et al.

(

2025

)

, Mem0

Chhikara

et al.

(

2025

)

, Mem-Graph

Chhikara

et al.

(

2025

)

, MIRIX

Wang and Chen (

2025

)

,
Memobase

3

3

3

https://www.memobase.io/blog/ai-memory-benchmark

,
MemU

4

4

4

https://memu.pro/

, MemOS

Li

et al.

(

2025b

)

.

Implementation Details.

We implement HyperMem using

Qwen3-Embedding-4B

for semantic encoding and

Qwen3-Reranker-4B

for reranking.
For answer generation, we employ

GPT-4.1-mini

with chain-of-thought prompting.
In hierarchical retrieval, we first retrieve

100

initial candidates, then select top-

10

Topics, top-

10

Episodes, and top-

30

Facts as the final context.
Node embeddings are updated with a propagation weight

λ

=

0.5

\lambda=0.5

to incorporate hyperedge information.
For evaluation, we use

GPT-4o-mini

as the LLM judge and report the average scores across

3

independent runs.

Configuration

Overall (%)

Δ

\Delta

HyperMem

92.66

–

w/o FC

91.75

0.91

↓

\downarrow

w/o EC

88.90

3.76

↓

\downarrow

w/o TR

91.94

0.72

↓

\downarrow

w/o TR & FC

91.75

0.91

↓

\downarrow

w/o TR & EC

88.83

3.83

↓

\downarrow

w/o TR & ER

90.19

2.47

↓

\downarrow

Table 2:

Ablation study. FC: Fact Context, EC: Episode Context, TR: Topic Retrieval, ER: Episode Retrieval.

Figure 3:

Ablation study across four question categories. FC: Fact context. EC: Episode context. TR: Topic-level retrieval. ER: Episode-level retrieval. The shaded region highlights the full HyperMem configuration.

4.2

Main Results

Table

1

presents the main results.
HyperMem achieves the best overall accuracy of 92.73%, outperforming the strongest RAG method HyperGraphRAG (86.49%) by 6.24% and the best memory system MIRIX (85.38%) by 7.35%.

Regarding category-wise performance, HyperMem excels on reasoning-intensive tasks.
On Single-hop questions, HyperMem achieves 96.08%, surpassing HyperGraphRAG by 5.47%, as the structured fact layer enables precise retrieval of atomic information.
On Multi-hop questions requiring evidence aggregation across multiple dialogue segments, HyperMem reaches 93.62%, outperforming LightRAG by 9.58%, demonstrating that hyperedges effectively bind topically related episodes scattered across time for comprehensive evidence collection.
On Temporal questions requiring cross-session reasoning, HyperMem attains 89.72%, benefiting from the episode layer’s preservation of temporal anchors and the hierarchical structure’s ability to trace event progression.
Open Domain remains challenging for all methods due to broader knowledge requirements beyond the conversation history.

These improvements stem from two key designs.
Hyperedges explicitly group topically related episodes, ensuring complete evidence retrieval for multi-hop reasoning.
Meanwhile, topic-guided hierarchical retrieval progressively narrows the candidate pool, filtering irrelevant context while preserving temporal coherence.

4.3

Ablation Study

As shown in Table

2

and Figure

3

, we conduct ablation study to evaluate the contribution of each component in HyperMem.
The results reveal that Episode context is the most critical component, as removing it (w/o EC) causes the largest performance drop (-3.76% overall), particularly affecting Temporal reasoning (-5.61%).
The hierarchical retrieval mechanism also proves essential.
Bypassing Topic retrieval (w/o TR) shows moderate impact, but completely flattening the hierarchy to Fact-only retrieval (w/o TR & ER) significantly degrades Multi-Hop performance (-5.68%), demonstrating that the hierarchical structure effectively maintains coherent information flow across granularity levels.
Fact context primarily benefits Multi-Hop reasoning (-2.84% when removed).
These findings validate that our three-level memory architecture and hierarchical retrieval strategy work synergistically to achieve optimal performance across diverse question types.

4.4

Hyperparameter Analysis

Figure 4:

Hyperparameter sensitivity analysis on LoCoMo. We evaluate the impact of embedding fusion weight

α

\alpha

and Top-k selection at each hierarchical level (Topic, Episode, Fact) on retrieval performance.

We investigate the sensitivity of HyperMem to key hyperparameters across four dimensions.
First, the fusion coefficient

α

=

0.5

\alpha=0.5

achieves optimal performance (92.66%), indicating that balanced integration of semantic similarity and structural retrieval yields the best results.
Second, topic top-k exhibits the most significant impact: increasing from k=1 to k=10 improves accuracy from 76.88% to 92.66% (+15.78%), demonstrating that adequate topical coverage is crucial for capturing relevant context.
In contrast, episode top-k shows minimal sensitivity (92.73% at k=10 vs. 92.47% at k=20), suggesting the system is robust to this parameter.
Fact top-k peaks at k=30 (92.66%) with slight degradation at higher values, indicating potential noise introduction from excessive fact retrieval.
Notably, the “Fact + Episode” configuration consistently outperforms “Fact Only” by 3-4% across all settings, further validating the importance of episode-level context in our framework.

4.5

Efficient Analysis

Figure 5:

Token usage vs. accuracy comparison. The x-axis shows relative token usage (Mem0 as 1.0

×

\times

baseline), and the y-axis shows LLM-as-a-judge accuracy.

Figure

5

shows the efficiency-accuracy trade-off.
HyperMem achieves optimal 92.73% accuracy at 7.5x tokens with the “Episode + Fact” configuration, while the “Fact Only” configuration already reaches 89.48% at merely 2.5x tokens, both substantially outperforming RAG-based methods that require 25-35x tokens for lower accuracy (GraphRAG: 67.60% at 35.3x, HyperGraphRAG: 86.49% at 26.3x).
The “Episode + Fact” configuration consistently outperforms “Fact Only” by 3-4%, demonstrating that episode summaries provide crucial semantic guidance that cannot be compensated by retrieving more facts.

5

Conclusion

In this paper, we propose a hypergraph-based agentic memory architecture, namely HyperMem.
It explicitly models high-order associations among topics, episodes, and facts, overcoming the pairwise limitations of existing RAG and graph-based methods.
By organizing memory hierarchically and linking related elements via hyperedges, HyperMem unifies scattered dialogue content into coherent units.
This enables effective lexical-semantic indexing with hypergraph embedding propagation and efficient coarse-to-fine retrieval.
On the LoCoMo benchmark, HyperMem achieves state-of-the-art 92.73% LLM-as-a-judge accuracy, demonstrating its strength in long-term conversations.

5

5

5

Our source code is about to be released.

Limitations

The current design assumes a single-user scenario, and extending to multi-user or multi-agent settings presents challenges in access control and memory isolation.
Additionally, Open Domain questions remain challenging as they often require external knowledge beyond the conversation history, suggesting opportunities for integrating external knowledge bases.

References

J. R. Anderson and G. H. Bower (2014)

Human associative memory

.

Psychology press

.

Cited by:

§3.1

.

A. Asai, Z. Wu, Y. Wang, A. Sil, and H. Hajishirzi (2024)

Self-rag: learning to retrieve, generate, and critique through self-reflection

.

In

The Twelfth International Conference on Learning Representations,
ICLR 2024, Vienna, Austria, May 7-11, 2024

,

External Links:

Link

Cited by:

§2.1

.

O. Ayala and P. Béchard (2024)

Reducing hallucination in structured outputs via retrieval-augmented generation

.

In

Proceedings of the 2024 Conference of the North American Chapter of
the Association for Computational Linguistics: Human Language Technologies:
Industry Track, NAACL 2024, Mexico City, Mexico, June 16-21, 2024

,

Y. Yang, A. Davani, A. Sil, and A. Kumar (Eds.)

,

pp. 228–238

.

External Links:

Link

,

Document

Cited by:

§2.1

.

B. Chen, Z. Guo, Z. Yang, Y. Chen, J. Chen, Z. Liu, C. Shi, and C. Yang (2025)

PathRAG: pruning graph-based retrieval augmented generation with relational paths

.

CoRR

abs/2502.14902

.

External Links:

Link

,

Document

,

2502.14902

Cited by:

§2.1

.

P. Chhikara, D. Khant, S. Aryan, T. Singh, and D. Yadav (2025)

Mem0: building production-ready AI agents with scalable long-term memory

.

CoRR

abs/2504.19413

.

External Links:

Link

,

Document

,

2504.19413

Cited by:

§2.2

,

§3.2.2

,

§4.1

,

Table 1

,

Table 1

,

Table 1

.

J. Dong, B. Fatemi, B. Perozzi, L. F. Yang, and A. Tsitsulin (2024)

Don’t forget to connect! improving RAG with graph-based reranking

.

CoRR

abs/2405.18414

.

External Links:

Link

,

Document

,

2405.18414

Cited by:

§2.1

.

D. Edge, H. Trinh, N. Cheng, J. Bradley, A. Chao, A. Mody, S. Truitt, and J. Larson (2024)

From local to global: A graph RAG approach to query-focused summarization

.

CoRR

abs/2404.16130

.

External Links:

Link

,

Document

,

2404.16130

Cited by:

§2.1

,

§4.1

,

Table 1

.

T. Fan, J. Wang, X. Ren, and C. Huang (2025)

MiniRAG: towards extremely simple retrieval-augmented generation

.

CoRR

abs/2501.06713

.

External Links:

Link

,

Document

,

2501.06713

Cited by:

§2.1

.

W. Fan, Y. Ding, L. Ning, S. Wang, H. Li, D. Yin, T. Chua, and Q. Li (2024)

A survey on RAG meeting llms: towards retrieval-augmented large language models

.

In

Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery
and Data Mining, KDD 2024, Barcelona, Spain, August 25-29, 2024

,

R. Baeza-Yates and F. Bonchi (Eds.)

,

pp. 6491–6501

.

External Links:

Link

,

Document

Cited by:

§1

.

J. Fang, X. Deng, H. Xu, Z. Jiang, Y. Tang, Z. Xu, S. Deng, Y. Yao, M. Wang, S. Qiao, H. Chen, and N. Zhang (2025)

LightMem: lightweight and efficient memory-augmented generation

.

CoRR

abs/2510.18866

.

External Links:

Link

,

Document

,

2510.18866

Cited by:

§2.2

.

Y. Feng, H. Hu, X. Hou, S. Liu, S. Ying, S. Du, H. Hu, and Y. Gao (2025)

Hyper-rag: combating LLM hallucinations using hypergraph-driven retrieval-augmented generation

.

CoRR

abs/2504.08758

.

External Links:

Link

,

Document

,

2504.08758

Cited by:

§2.1

.

Y. Feng, H. You, Z. Zhang, R. Ji, and Y. Gao (2019)

Hypergraph neural networks

.

In

Proceedings of the AAAI conference on artificial intelligence

,

Vol.

33

,

pp. 3558–3565

.

Cited by:

§3.3.1

.

Y. Gao, Y. Xiong, X. Gao, K. Jia, J. Pan, Y. Bi, Y. Dai, J. Sun, Q. Guo, M. Wang, and H. Wang (2023)

Retrieval-augmented generation for large language models: A survey

.

CoRR

abs/2312.10997

.

External Links:

Link

,

Document

,

2312.10997

Cited by:

§1

.

Z. Guo, L. Xia, Y. Yu, T. Ao, and C. Huang (2025)

LightRAG: simple and fast retrieval-augmented generation

.

In

Findings of the Association for Computational Linguistics: EMNLP 2025

,

C. Christodoulopoulos, T. Chakraborty, C. Rose, and V. Peng (Eds.)

,

Suzhou, China

,

pp. 10746–10761

.

External Links:

Link

,

Document

,

ISBN 979-8-89176-335-7

Cited by:

§2.1

,

§4.1

,

Table 1

.

B. J. Gutierrez, Y. Shu, Y. Gu, M. Yasunaga, and Y. Su (2024)

HippoRAG: neurobiologically inspired long-term memory for large language models

.

In

Advances in Neural Information Processing Systems 38: Annual Conference
on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver,
BC, Canada, December 10 - 15, 2024

,

A. Globersons, L. Mackey, D. Belgrave, A. Fan, U. Paquet, J. M. Tomczak, and C. Zhang (Eds.)

,

External Links:

Link

Cited by:

§2.1

.

B. J. Gutiérrez, Y. Shu, W. Qi, S. Zhou, and Y. Su (2025)

From RAG to memory: non-parametric continual learning for large language models

.

In

Forty-second International Conference on Machine Learning, ICML
2025, Vancouver, BC, Canada, July 13-19, 2025

,

External Links:

Link

Cited by:

§2.1

,

§4.1

,

Table 1

.

X. He, Y. Tian, Y. Sun, N. V. Chawla, T. Laurent, Y. LeCun, X. Bresson, and B. Hooi (2024)

G-retriever: retrieval-augmented generation for textual graph understanding and question answering

.

In

Advances in Neural Information Processing Systems 38: Annual Conference
on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver,
BC, Canada, December 10 - 15, 2024

,

A. Globersons, L. Mackey, D. Belgrave, A. Fan, U. Paquet, J. M. Tomczak, and C. Zhang (Eds.)

,

External Links:

Link

Cited by:

§2.1

.

C. Hu, X. Gao, Z. Zhou, D. Xu, Y. Bai, X. Li, H. Zhang, T. Li, C. Zhang, L. Bing, and Y. Deng (2026)

EverMemOS: A self-organizing memory operating system for structured long-horizon reasoning

.

CoRR

abs/2601.02163

.

External Links:

Link

,

Document

,

2601.02163

Cited by:

§1

.

H. Hu, Y. Feng, R. Li, R. Xue, X. Hou, Z. Tian, Y. Gao, and S. Du (2025a)

Cog-rag: cognitive-inspired dual-hypergraph with theme alignment retrieval-augmented generation

.

CoRR

abs/2511.13201

.

External Links:

Link

,

2511.13201

Cited by:

§2.1

.

Y. Hu, Z. Lei, Z. Zhang, B. Pan, C. Ling, and L. Zhao (2025b)

GRAG: graph retrieval-augmented generation

.

In

Findings of the Association for Computational Linguistics: NAACL
2025, Albuquerque, New Mexico, USA, April 29 - May 4, 2025

,

L. Chiruzzo, A. Ritter, and L. Wang (Eds.)

,

pp. 4145–4157

.

External Links:

Link

,

Document

Cited by:

§2.1

.

H. Huang, Y. Huang, J. Yang, Z. Pan, Y. Chen, K. Ma, H. Chen, and J. Cheng (2025)

Retrieval-augmented generation with hierarchical knowledge

.

CoRR

abs/2503.10150

.

External Links:

Link

,

Document

,

2503.10150

Cited by:

§2.1

.

M. Kulkarni, P. Tangarajan, K. Kim, and A. Trivedi (2024)

Reinforcement learning for optimizing RAG for domain chatbots

.

CoRR

abs/2401.06800

.

External Links:

Link

,

Document

,

2401.06800

Cited by:

§2.1

.

P. Lewis, E. Perez, A. Piktus, F. Petroni, V. Karpukhin, N. Goyal, H. Küttler, M. Lewis, W. Yih, T. Rocktäschel, S. Riedel, and D. Kiela (2020)

Retrieval-augmented generation for knowledge-intensive NLP tasks

.

In

Advances in Neural Information Processing Systems 33: Annual Conference
on Neural Information Processing Systems 2020, NeurIPS 2020, December
6-12, 2020, virtual

,

H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin (Eds.)

,

External Links:

Link

Cited by:

§2.1

.

M. Li, S. Miao, and P. Li (2025a)

Simple is effective: the roles of graphs and large language models in knowledge-graph-based retrieval-augmented generation

.

In

The Thirteenth International Conference on Learning Representations,
ICLR 2025, Singapore, April 24-28, 2025

,

External Links:

Link

Cited by:

§2.1

.

Z. Li, S. Song, C. Xi, H. Wang, C. Tang, S. Niu, D. Chen, J. Yang, C. Li, Q. Yu, J. Zhao, Y. Wang, P. Liu, Z. Lin, P. Wang, J. Huo, T. Chen, K. Chen, K. Li, Z. Tao, J. Ren, H. Lai, H. Wu, B. Tang, Z. Wang, Z. Fan, N. Zhang, L. Zhang, J. Yan, M. Yang, T. Xu, W. Xu, H. Chen, H. Wang, H. Yang, W. Zhang, Z. J. Xu, S. Chen, and F. Xiong (2025b)

MemOS: A memory OS for AI system

.

CoRR

abs/2507.03724

.

External Links:

Link

,

Document

,

2507.03724

Cited by:

§1

,

§2.2

,

§4.1

,

Table 1

,

Table 1

.

X. Lin, A. Ghosh, B. K. H. Low, A. Shrivastava, and V. Mohan (2025)

REFRAG: rethinking RAG based decoding

.

CoRR

abs/2509.01092

.

External Links:

Link

,

Document

,

2509.01092

Cited by:

§2.1

.

H. Luo, H. E, G. Chen, Y. Zheng, X. Wu, Y. Guo, Q. Lin, Y. Feng, Z. Kuang, M. Song, Y. Zhu, and L. A. Tuan (2025)

HyperGraphRAG: retrieval-augmented generation with hypergraph-structured knowledge representation

.

CoRR

abs/2503.21322

.

External Links:

Link

,

Document

,

2503.21322

Cited by:

§2.1

,

§3.2.2

,

§4.1

,

Table 1

.

L. Luo, Y. Li, G. Haffari, and S. Pan (2024)

Reasoning on graphs: faithful and interpretable large language model reasoning

.

In

The Twelfth International Conference on Learning Representations,
ICLR 2024, Vienna, Austria, May 7-11, 2024

,

External Links:

Link

Cited by:

§2.1

.

A. Maharana, D. Lee, S. Tulyakov, M. Bansal, F. Barbieri, and Y. Fang (2024)

Evaluating very long-term conversational memory of LLM agents

.

In

Proceedings of the 62nd Annual Meeting of the Association for Computational
Linguistics (Volume 1: Long Papers), ACL 2024, Bangkok, Thailand,
August 11-16, 2024

,

L. Ku, A. Martins, and V. Srikumar (Eds.)

,

pp. 13851–13870

.

External Links:

Link

,

Document

Cited by:

§4.1

.

J. Nan, W. Ma, W. Wu, and Y. Chen (2025)

Nemori: self-organizing agent memory inspired by cognitive science

.

CoRR

abs/2508.03341

.

External Links:

Link

,

Document

,

2508.03341

Cited by:

§2.2

.

C. Packer, V. Fang, S. G. Patil, K. Lin, S. Wooders, and J. E. Gonzalez (2023)

MemGPT: towards llms as operating systems

.

CoRR

abs/2310.08560

.

External Links:

Link

,

Document

,

2310.08560

Cited by:

§2.2

.

P. Rasmussen, P. Paliychuk, T. Beauvais, J. Ryan, and D. Chalef (2025)

Zep: A temporal knowledge graph architecture for agent memory

.

CoRR

abs/2501.13956

.

External Links:

Link

,

Document

,

2501.13956

Cited by:

§1

,

§2.2

,

§4.1

,

Table 1

.

S. E. Robertson and H. Zaragoza (2009)

The probabilistic relevance framework: BM25 and beyond

.

Found. Trends Inf. Retr.

3

(

4

),

pp. 333–389

.

External Links:

Link

,

Document

Cited by:

§3.3.1

.

R. Salama, J. Cai, M. Yuan, A. Currey, M. Sunkara, Y. Zhang, and Y. Benajiba (2025)

MemInsight: autonomous memory augmentation for LLM agents

.

CoRR

abs/2503.21760

.

External Links:

Link

,

Document

,

2503.21760

Cited by:

§2.2

.

P. Sarthi, S. Abdullah, A. Tuli, S. Khanna, A. Goldie, and C. D. Manning (2024)

RAPTOR: recursive abstractive processing for tree-organized retrieval

.

In

The Twelfth International Conference on Learning Representations,
ICLR 2024, Vienna, Austria, May 7-11, 2024

,

External Links:

Link

Cited by:

§2.1

.

K. Sharma, P. Kumar, and Y. Li (2024)

OG-RAG: ontology-grounded retrieval-augmented generation for large language models

.

CoRR

abs/2412.15235

.

External Links:

Link

,

Document

,

2412.15235

Cited by:

§2.1

.

Y. Wang and X. Chen (2025)

MIRIX: multi-agent memory system for llm-based agents

.

CoRR

abs/2507.07957

.

External Links:

Link

,

Document

,

2507.07957

Cited by:

§2.2

,

§4.1

,

Table 1

,

Table 1

.

Y. Wang, R. Takanobu, Z. Liang, Y. Mao, Y. Hu, J. J. McAuley, and X. Wu (2025)

Mem-

α

\alpha

: learning memory construction via reinforcement learning

.

CoRR

abs/2509.25911

.

External Links:

Link

,

Document

,

2509.25911

Cited by:

§2.2

.

Y. Xia, J. Zhou, Z. Shi, J. Chen, and H. Huang (2025)

Improving retrieval augmented language model with self-reasoning

.

In

AAAI-25, Sponsored by the Association for the Advancement of Artificial
Intelligence, February 25 - March 4, 2025, Philadelphia, PA, USA

,

T. Walsh, J. Shah, and Z. Kolter (Eds.)

,

pp. 25534–25542

.

External Links:

Link

,

Document

Cited by:

§2.1

.

W. Xu, Z. Liang, K. Mei, H. Gao, J. Tan, and Y. Zhang (2025)

A-MEM: agentic memory for LLM agents

.

CoRR

abs/2502.12110

.

External Links:

Link

,

Document

,

2502.12110

Cited by:

§2.2

,

§4.1

,

Table 1

.

S. Yan, X. Yang, Z. Huang, E. Nie, Z. Ding, Z. Li, X. Ma, H. Schütze, V. Tresp, and Y. Ma (2025)

Memory-r1: enhancing large language model agents to manage and utilize memories via reinforcement learning

.

CoRR

abs/2508.19828

.

External Links:

Link

,

Document

,

2508.19828

Cited by:

§2.2

.

G. Zhang, M. Fu, G. Wan, M. Yu, K. Wang, and S. Yan (2025a)

G-memory: tracing hierarchical memory for multi-agent systems

.

CoRR

abs/2506.07398

.

External Links:

Link

,

Document

,

2506.07398

Cited by:

§1

,

§2.2

.

G. Zhang, M. Fu, and S. Yan (2025b)

MemGen: weaving generative latent memory for self-evolving agents

.

CoRR

abs/2509.24704

.

External Links:

Link

,

Document

,

2509.24704

Cited by:

§2.2

.

N. Zhang, P. K. Choubey, A. R. Fabbri, G. Bernadett-Shapiro, R. Zhang, P. Mitra, C. Xiong, and C. Wu (2025c)

SiReRAG: indexing similar and related information for multihop reasoning

.

In

The Thirteenth International Conference on Learning Representations,
ICLR 2025, Singapore, April 24-28, 2025

,

External Links:

Link

Cited by:

§2.1

.

W. Zhang, X. Zhang, H. Yu, S. Nie, B. Wu, J. Yue, T. Liu, and Y. Li (2026)

ExpSeek: self-triggered experience seeking for web agents

.

External Links:

2601.08605

,

Link

Cited by:

§1

.

Y. Zhang, M. Li, D. Long, X. Zhang, H. Lin, B. Yang, P. Xie, A. Yang, D. Liu, J. Lin, F. Huang, and J. Zhou (2025d)

Qwen3 embedding: advancing text embedding and reranking through foundation models

.

CoRR

abs/2506.05176

.

External Links:

Link

,

Document

,

2506.05176

Cited by:

§3.3.1

.

Z. Zhang, Q. Dai, X. Bo, C. Ma, R. Li, X. Chen, J. Zhu, Z. Dong, and J. Wen (2025e)

A survey on the memory mechanism of large language model-based agents

.

ACM Trans. Inf. Syst.

43

(

6

),

pp. 155:1–155:47

.

External Links:

Link

,

Document

Cited by:

§1

.

W. Zhong, L. Guo, Q. Gao, H. Ye, and Y. Wang (2024)

MemoryBank: enhancing large language models with long-term memory

.

In

Thirty-Eighth AAAI Conference on Artificial Intelligence, AAAI
2024, Thirty-Sixth Conference on Innovative Applications of Artificial
Intelligence, IAAI 2024, Fourteenth Symposium on Educational Advances
in Artificial Intelligence, EAAI 2014, February 20-27, 2024, Vancouver,
Canada

,

M. J. Wooldridge, J. G. Dy, and S. Natarajan (Eds.)

,

pp. 19724–19731

.

External Links:

Link

,

Document

Cited by:

§2.2

.

Z. Zhou, A. Qu, Z. Wu, S. Kim, A. Prakash, D. Rus, J. Zhao, B. K. H. Low, and P. P. Liang (2025)

MEM1: learning to synergize memory and reasoning for efficient long-horizon agents

.

CoRR

abs/2506.15841

.

External Links:

Link

,

Document

,

2506.15841

Cited by:

§2.2

.

Appendix A

Algorithm

As shown in Algorithm

1

,

2

, and

3

, we provide detailed pseudocode for HyperMem’s core procedures.

Algorithm 1

Hypergraph Memory Construction

1:

Input:

Dialogue stream

X

=

{

x

t

}

t

=

1

T

X=\{x_{t}\}_{t=1}^{T}

2:

Output:

Hypergraph

ℋ

\mathcal{H}

3:

Initialize

𝒱

T

,

𝒱

E

,

𝒱

F

,

ℰ

E

,

ℰ

F

←

∅

\mathcal{V}^{T},\mathcal{V}^{E},\mathcal{V}^{F},\mathcal{E}^{E},\mathcal{E}^{F}\leftarrow\emptyset

, buffer

ℬ

←

∅

\mathcal{B}\leftarrow\emptyset

4:

5:

⊳

\triangleright

Stage 1: Episode Detection

6:

for

each incoming dialogue

x

t

∈

X

x_{t}\in X

do

7:

ℬ

←

ℬ

∪

{

x

t

}

\mathcal{B}\leftarrow\mathcal{B}\cup\{x_{t}\}

8:

Boundary detection:

(

end

,

wait

)

←

LLM

​

(

ℬ

)

(\texttt{end},\!\texttt{wait})\!\!\leftarrow\!\!\textsc{LLM}(\mathcal{B})

9:

if

end

=

True

then

10:

v

E

←

CreateEpisode

​

(

ℬ

)

v^{E}\leftarrow\textsc{CreateEpisode}(\mathcal{B})

11:

𝒱

E

←

𝒱

E

∪

{

v

E

}

\mathcal{V}^{E}\leftarrow\mathcal{V}^{E}\cup\{v^{E}\}

,

ℬ

←

∅

\mathcal{B}\leftarrow\emptyset

12:

end

if

13:

end

for

14:

15:

⊳

\triangleright

Stage 2: Topic Aggregation

16:

for

each new episode

v

cur

E

∈

𝒱

E

v^{E}_{\mathrm{cur}}\in\mathcal{V}^{E}

do

17:

Episode Matching:

𝒞

E

←

LLM

​

(

v

cur

E

)

\mathcal{C}^{E}\leftarrow\textsc{LLM}(v^{E}_{\mathrm{cur}})

18:

if

𝒞

E

=

∅

\mathcal{C}^{E}=\emptyset

(Case 1: Topic Initialization)

then

19:

v

T

←

CreateTopic

​

(

v

cur

E

)

v^{T}\leftarrow\textsc{CreateTopic}(v^{E}_{\mathrm{cur}})

20:

𝒱

T

←

𝒱

T

∪

{

v

T

}

\mathcal{V}^{T}\leftarrow\mathcal{V}^{T}\cup\{v^{T}\}

21:

else

22:

Topic Matching:

𝒞

T

←

LLM

​

(

𝒞

E

,

v

cur

E

)

\mathcal{C}^{T}\leftarrow\textsc{LLM}(\mathcal{C}^{E},v^{E}_{\mathrm{cur}})

23:

if

𝒞

T

=

∅

\mathcal{C}^{T}=\emptyset

(Case 2: New Topic)

then

24:

v

T

←

CreateTopic

​

(

𝒞

E

,

v

cur

E

)

v^{T}\leftarrow\textsc{CreateTopic}(\mathcal{C}^{E},v^{E}_{\mathrm{cur}})

25:

𝒱

T

←

𝒱

T

∪

{

v

T

}

\mathcal{V}^{T}\leftarrow\mathcal{V}^{T}\cup\{v^{T}\}

26:

else

(Case 3: Topic Update)

27:

UpdateTopics

(

𝒞

T

,

v

cur

E

\mathcal{C}^{T},v^{E}_{\mathrm{cur}}

)

28:

end

if

29:

end

if

30:

e

t

E

←

(

v

T

,

GetEpisodes

​

(

v

T

)

,

𝒘

E

)

e^{E}_{t}\leftarrow(v^{T},\textsc{GetEpisodes}(v^{T}),\bm{w}^{E})

31:

ℰ

E

←

ℰ

E

∪

{

e

t

E

}

\mathcal{E}^{E}\leftarrow\mathcal{E}^{E}\cup\{e^{E}_{t}\}

32:

end

for

33:

34:

⊳

\triangleright

Stage 3: Fact Extraction

35:

for

each topic

v

T

∈

𝒱

T

v^{T}\in\mathcal{V}^{T}

do

36:

𝒱

t

E

←

GetEpisodes

​

(

v

T

)

\mathcal{V}^{E}_{t}\leftarrow\textsc{GetEpisodes}(v^{T})

37:

Fact Extraction:

ℱ

t

←

LLM

​

(

v

T

,

𝒱

t

E

)

\mathcal{F}_{t}\leftarrow\textsc{LLM}(v^{T},\mathcal{V}^{E}_{t})

38:

for

each fact

v

t

F

∈

ℱ

t

v^{F}_{t}\in\mathcal{F}_{t}

do

39:

𝒱

t

F

←

𝒱

t

F

∪

{

v

t

F

}

\mathcal{V}^{F}_{t}\leftarrow\mathcal{V}^{F}_{t}\cup\{v^{F}_{t}\}

40:

Anchor

v

t

F

v^{F}_{t}

to its source episode(s)

41:

end

for

42:

for

each episode

v

t

E

∈

𝒱

t

E

v^{E}_{t}\in\mathcal{V}^{E}_{t}

do

43:

e

t

F

←

(

v

t

E

,

GetFacts

​

(

v

t

E

)

,

𝒘

F

)

e^{F}_{t}\leftarrow(v^{E}_{t},\textsc{GetFacts}(v^{E}_{t}),\bm{w}^{F})

44:

ℰ

t

F

←

ℰ

t

F

∪

{

e

t

F

}

\mathcal{E}^{F}_{t}\leftarrow\mathcal{E}^{F}_{t}\cup\{e^{F}_{t}\}

45:

end

for

46:

end

for

47:

48:

return

ℋ

=

(

𝒱

T

∪

𝒱

E

∪

𝒱

F

,

ℰ

E

∪

ℰ

F

)

\mathcal{H}=(\mathcal{V}^{T}\cup\mathcal{V}^{E}\cup\mathcal{V}^{F},\mathcal{E}^{E}\cup\mathcal{E}^{F})

Algorithm 2

Offline Index Construction

1:

Input:

Hypergraph

ℋ

\mathcal{H}

2:

Output:

Indexed hypergraph with propagated embeddings

3:

4:

⊳

\triangleright

Node Indexing

5:

for

each node

v

∈

𝒱

T

∪

𝒱

E

∪

𝒱

F

v\in\mathcal{V}^{T}\cup\mathcal{V}^{E}\cup\mathcal{V}^{F}

do

6:

Build BM25 and vector index for

v

v

7:

𝒉

v

←

Encode

​

(

v

)

\bm{h}_{v}\leftarrow\textsc{Encode}(v)

8:

end

for

9:

10:

⊳

\triangleright

Hyperedge Embedding

11:

for

each hyperedge

e

∈

ℰ

E

∪

ℰ

F

e\in\mathcal{E}^{E}\cup\mathcal{E}^{F}

do

12:

𝒉

e

←

∑

v

∈

e

α

e

,

v

​

𝒉

v

\bm{h}_{e}\leftarrow\sum_{v\in e}\alpha_{e,v}\bm{h}_{v}

13:

end

for

14:

15:

⊳

\triangleright

Embedding Propagation

16:

for

each node

v

v

do

17:

𝒉

v

′

←

𝒉

v

+

λ

⋅

Agg

e

∈

𝒩

​

(

v

)

​

(

𝒉

e

)

\bm{h}^{\prime}_{v}\leftarrow\bm{h}_{v}+\lambda\cdot\textsc{Agg}_{e\in\mathcal{N}(v)}(\bm{h}_{e})

18:

end

for

Algorithm 3

Online Retrieval Strategy

1:

Input:

Query

q

q

, Indexed

ℋ

\mathcal{H}

, Top-

k

k

:

(

k

T

,

k

E

,

k

F

)

(k^{T},k^{E},k^{F})

2:

Output:

Retrieved context

ℛ

\mathcal{R}

3:

𝒒

←

Encode

​

(

q

)

\bm{q}\leftarrow\textsc{Encode}(q)

4:

5:

⊳

\triangleright

Stage 1: Topic Retrieval

6:

for

each

v

T

∈

𝒱

T

v^{T}\in\mathcal{V}^{T}

do

7:

s

T

←

RRF

​

(

BM25

​

(

q

,

v

T

)

,

Cos

​

(

𝒒

,

𝒉

v

T

′

)

)

s^{T}\leftarrow\textsc{RRF}(\textsc{BM25}(q,v^{T}),\textsc{Cos}(\bm{q},\bm{h}^{\prime}_{v^{T}}))

8:

end

for

9:

𝒯

top

←

TopK

​

(

𝒱

T

,

s

T

,

k

T

)

\mathcal{T}_{\mathrm{top}}\leftarrow\textsc{TopK}(\mathcal{V}^{T},s^{T},k^{T})

10:

11:

⊳

\triangleright

Stage 2: Episode Retrieval

12:

𝒱

t

E

←

⋃

t

∈

𝒯

top

GetEpisodes

​

(

t

)

\mathcal{V}^{E}_{t}\leftarrow\bigcup_{t\in\mathcal{T}_{\mathrm{top}}}\textsc{GetEpisodes}(t)

13:

for

each

v

t

E

∈

𝒱

t

E

v^{E}_{t}\in\mathcal{V}^{E}_{t}

do

14:

s

t

E

←

RRF

​

(

BM25

​

(

q

,

v

t

E

)

,

Cos

​

(

𝒒

,

𝒉

v

t

E

′

)

)

s^{E}_{t}\leftarrow\textsc{RRF}(\textsc{BM25}(q,v^{E}_{t}),\textsc{Cos}(\bm{q},\bm{h}^{\prime}_{v^{E}_{t}}))

15:

end

for

16:

ℰ

top

←

TopK

​

(

𝒱

t

E

,

s

t

E

,

k

E

)

\mathcal{E}_{\mathrm{top}}\leftarrow\textsc{TopK}(\mathcal{V}^{E}_{t},s^{E}_{t},k^{E})

17:

18:

⊳

\triangleright

Stage 3: Fact Retrieval

19:

𝒱

t

,

e

F

←

⋃

e

∈

ℰ

top

GetFacts

​

(

e

)

\mathcal{V}^{F}_{t,e}\leftarrow\bigcup_{e\in\mathcal{E}_{\mathrm{top}}}\textsc{GetFacts}(e)

20:

for

each

v

t

,

e

F

∈

𝒱

t

,

e

F

v^{F}_{t,e}\in\mathcal{V}^{F}_{t,e}

do

21:

s

t

,

e

F

←

RRF

​

(

BM25

​

(

q

,

v

t

,

e

F

)

,

Cos

​

(

𝒒

,

𝒉

v

t

,

e

F

′

)

)

s^{F}_{t,e}\leftarrow\textsc{RRF}(\textsc{BM25}(q,v^{F}_{t,e}),\textsc{Cos}(\bm{q},\bm{h}^{\prime}_{v^{F}_{t,e}}))

22:

end

for

23:

ℱ

top

←

TopK

​

(

𝒱

t

,

e

F

,

s

t

,

e

F

,

k

F

)

\mathcal{F}_{\mathrm{top}}\leftarrow\textsc{TopK}(\mathcal{V}^{F}_{t,e},s^{F}_{t,e},k^{F})

24:

25:

return

ℛ

←

Compose

​

(

ℰ

top

,

ℱ

top

)

\mathcal{R}\leftarrow\textsc{Compose}(\mathcal{E}_{\mathrm{top}},\mathcal{F}_{\mathrm{top}})

Appendix B

Prompt Templates

We present the key prompt templates used in HyperMem.
Figure

6

shows the episode boundary detection prompt.
Figure

7

describes the topic aggregation prompt for linking related episodes.
Figure

8

presents the fact extraction prompt for distilling key information from episodes.

Episode Detection

You are an episodic memory boundary detection expert. Determine if the newly added dialogue should end the current episode and start a new one.

Input:

Conversation history:

{history}

Time gap info:

{time_gap}

New messages:

{new_messages}

Decision Criteria:

1.

Substantive Topic Change

(Highest Priority): Do new messages introduce a completely different substantive topic? Is there a shift from one specific event to another distinct event?

2.

Intent and Purpose Transition

: Has the fundamental purpose of the conversation changed significantly? Has the core question been fully resolved and a new substantial topic begun?

3.

Temporal Signals

: Significant time gap between messages (hours or days)? Long gaps strongly suggest new episodes.

4.

Structural Signals

: Clear concluding statements followed by genuinely new topics? Explicit topic transition phrases?

Special Rules:

Greetings + Topic = ONE episode; Ignore social formalities and pleasantries; Closures (“Thanks!”, “Take care!”) stay with current episode.

Output:

{should_end: bool, should_wait: bool, confidence: float, topic_summary: str}

Figure 6:

Prompt template of episode boundary detection.

Topic Aggregation

You are an expert in identifying whether Episodes describe the SAME situation/event/theme. Your task: identify which historical Episodes describe the SAME situation as the new Episode.

Input:

New Episode:

{new_episode}

Historical Episodes:

{history_episodes}

Existing Topics:

{existing_topics}

Same Situation Criteria

(ALL must be met):

1.

Same Specific Event/Theme

: E.g., “Jon’s career transition” at different stages. NOT just related topics—“Jon’s business” and “Gina’s business” are DIFFERENT situations.

2.

Narrative Continuity

: Later Episode continues/develops the earlier event. E.g., “Started X”

→

\rightarrow

“X encountered problem”

→

\rightarrow

“X succeeded” = SAME situation.

3.

Identity of Core Subject

: Same specific person’s journey, same specific project/initiative, same specific relationship. NOT just same people or same topic category.

4.

Temporal Tolerance

: Same situation CAN span multiple time points (weeks or months). Look for recurring discussions or multi-stage developments across time.

Aggregation Cases:

𝒞

E

=

∅

\mathcal{C}^{E}=\emptyset

⇒

\Rightarrow

Create new Topic;

𝒞

E

≠

∅

,

𝒞

T

=

∅

\mathcal{C}^{E}\neq\emptyset,\mathcal{C}^{T}=\emptyset

⇒

\Rightarrow

Aggregate into new Topic;

𝒞

T

≠

∅

\mathcal{C}^{T}\neq\emptyset

⇒

\Rightarrow

Update existing Topic.

Output:

{title: str, summary: str, keywords: list, episode_weights: dict}

Figure 7:

Prompt templates of topic aggregation.

Fact Extraction

You are an expert in extracting queryable facts from Episodes within a Topic context. Extract atomic, structured facts designed to directly surface answerable evidence.

Input:

Topic:

{topic}

Episodes in this Topic:

{episodes}

Extraction Guidelines:

1.

Answerable Facts

: Focus on facts that directly answer queries, not narrative context. Each Fact should be a standalone, queryable assertion.

2.

Provenance

: Maintain explicit links to source Episodes for traceability. Every Fact is anchored to the Episodes from which it originates.

3.

Query Anticipation

: Predict potential queries this fact can answer. Store query patterns in the

potential

field for proactive retrieval alignment.

4.

Importance Weights

: Assign salience scores

w

∈

[

0

,

1

]

w\in[0,1]

based on relevance to the Topic, reflecting each Fact’s contribution.

Output:

{content: str, potential: str, keywords: list, importance_weight: float}

Figure 8:

Prompt templates of fact extraction.

Appendix C

Case Study

We present four representative cases from the LoCoMo benchmark to illustrate how HyperMem addresses different query types where baselines fail.

Single-Hop Task (Figure

9

).

This case asks “What new activity did Maria start recently, as mentioned on 3 June, 2023?”
GraphRAG confuses “dog shelter” with “homeless shelter,” while HyperGraphRAG retrieves “aerial yoga” from a different time period.
HyperMem’s hierarchical retrieval navigates through Topic and Episode layers to retrieve the exact Fact containing “volunteering at a local dog shelter,” directly matching the golden answer.

Multi-Hop Task (Figure

10

).

Answering “How many tournaments has Nate won?” requires aggregating evidence from 7 sessions spanning 10 months.
GraphRAG only identifies “at least two” due to its pairwise edge structure fragmenting related memories across time.
HyperMem’s Topic hyperedge groups all tournament-related Episodes under a unified thematic anchor, correctly answering “seven tournaments” with precise dates for each.

Temporal Reasoning Task (Figure

11

).

For the query “How many pets did Andrew have, as of September 2023?”
GraphRAG claims Andrew had no pets by confusing him with another person, while HyperGraphRAG overcounts with “four pets.”
HyperMem correctly answers “one pet dog named Toby” because its Episode layer preserves temporal anchors and enables accurate state reconstruction at the queried time point.

Open Domain Task (Figure

12

).

For “Would John be open to moving to another country?”
HyperGraphRAG incorrectly answers “Yes” based on superficial travel mentions.
HyperMem correctly infers “No” by synthesizing evidence about John’s military aspirations and political campaign goals that anchor him to the U.S.
The

potential

field in Fact nodes anticipates such inference patterns.

Figure 9:

Single-Hop Task. HyperMem precisely retrieves “dog shelter” while GraphRAG confuses it with “homeless shelter.”

Figure 10:

Multi-Hop Task. HyperMem aggregates all 7 tournament mentions across 10 months via Topic hyperedges, while baselines fragment evidence.

Figure 11:

Temporal Reasoning Task. HyperMem correctly identifies one pet at the queried time point, while baselines confuse subjects or miscount.

Figure 12:

Open Domain Task. HyperMem infers John’s commitment to U.S.-based goals, while HyperGraphRAG incorrectly concludes he would relocate.

BETA