Papers
Topics
Authors
Recent
Search
2000 character limit reached

Choosing How to Remember: Adaptive Memory Structures for LLM Agents

Published 15 Feb 2026 in cs.AI and cs.LG | (2602.14038v1)

Abstract: Memory is critical for enabling LLM based agents to maintain coherent behavior over long-horizon interactions. However, existing agent memory systems suffer from two key gaps: they rely on a one-size-fits-all memory structure and do not model memory structure selection as a context-adaptive decision, limiting their ability to handle heterogeneous interaction patterns and resulting in suboptimal performance. We propose a unified framework, FluxMem, that enables adaptive memory organization for LLM agents. Our framework equips agents with multiple complementary memory structures. It explicitly learns to select among these structures based on interaction-level features, using offline supervision derived from downstream response quality and memory utilization. To support robust long-horizon memory evolution, we further introduce a three-level memory hierarchy and a Beta Mixture Model-based probabilistic gate for distribution-aware memory fusion, replacing brittle similarity thresholds. Experiments on two long-horizon benchmarks, PERSONAMEM and LoCoMo, demonstrate that our method achieves average improvements of 9.18% and 6.14%.

Summary

  • The paper introduces FluxMem, a three-layer memory system that selects linear, graph, or hierarchical episodic structures using twelve interaction features and offline reward-based supervision.
  • FluxMem combines adaptive structure selection with a Beta Mixture Model fusion gate, improving average accuracy to 72.43% on PersonaMem and F1 to 51.16% on LoCoMo.
  • Ablations show that each memory structure supports distinct reasoning patterns, while results also reveal limitations from offline labels, benchmark scope, and occasional specialist-baseline advantages.

Motivation and problem statement

Long-horizon LLM agents must accumulate, retain, and retrieve information across many conversational turns while user goals evolve. The paper argues that existing agent memory systems share a structural blind spot: memory organization is treated as a fixed design decision rather than a context-dependent choice. The authors formalize this as two gaps. Gap 1 is the single-structure assumption: most systems (e.g., ZEP's temporal knowledge graph, graph-based O-Mem) commit to one organizational form for all episodic content, even though long conversations mix temporal progression, relational dependencies, and topic hierarchies. Gap 2 is the absence of conversation-adaptive structure selection: even systems that use different structures across memory layers fix each layer's structure, so the choice is never optimized against downstream performance.

The proposed framework, FluxMem, addresses both gaps by maintaining multiple complementary memory structures within a three-layer hierarchy and learning to select among them from interaction-derived feedback. A secondary contribution replaces hand-tuned similarity thresholds for memory fusion with a Beta Mixture Model (BMM) gate that models the score distribution directly.

Framework architecture

FluxMem organizes memory at three scales. Short-term interaction memory (STIM) buffers recent dialogue pages with a fixed capacity of four pages—an explicit nod to working-memory capacity findings in cognitive psychology—and evicts via an LRU policy into mid-term memory. Mid-term episodic memory (MTEM) groups pages into episodic sessions, each carrying page sequences with timestamps and continuity links, session-level summaries, and indexing structures corresponding to its assigned memory structure. Sessions are scored by a lightweight utility function combining access frequency, interaction intensity, and recency; high-utility units are consolidated upward. Long-term semantic memory (LTSM) stores abstracted, durable knowledge (user profiles, facts, reusable strategies), pruned by eligibility criteria over usage, recency, and optional confidence rather than scalar heuristics.

The central design decision is that each episodic unit in MTEM is assigned one of three structures—linear (chronological, recency-biased retrieval), graph (entity-centric retrieval via neighborhood expansion plus semantic matching), or hierarchical (coarse-to-fine topical retrieval). The authors justify restricting the design space to these three primitives by appeal to classical data-structure theory, arguing that other organizations reduce to or compose from sequential, networked, and hierarchical forms.

Context-aware structure selection

Structure selection is cast as supervised classification. At each turn, a compact feature vector of twelve interpretable interaction-level signals—page count, entity density, relation indicators, topic diversity and transition frequency, Q&A and decision-tree pattern indicators, time span, temporal density, and semantic complexity—feeds a shallow two-layer MLP that outputs a softmax over the three structures.

Because ground-truth labels for optimal structures do not exist, supervision is constructed offline: for each training interaction drawn from the Multi-Session Chat dataset, the agent is run under each candidate structure, and a scalar reward rt(s)=λqrtjudge(s)+λmrtmem(s)r_t(s) = \lambda_q r_t^{\text{judge}}(s) + \lambda_m r_t^{\text{mem}}(s) combines response quality (LLM judge) with memory utilization effectiveness (weights 0.7/0.3). The reward-argmax structure becomes the label, and the selector trains with cross-entropy. The authors explicitly reject online RL for this decision, citing instability and interaction cost—a reasonable trade-off, though it means the selector can only be as good as the offline reward proxy and cannot adapt to distribution shift beyond what the MSC-derived labels cover.

BMM-gated memory fusion

When pages transfer from STIM to MTEM, the system must decide whether to merge them into an existing session. Fixed similarity thresholds assume stable score distributions, which fails across conversation types and interaction stages. FluxMem instead min–max normalizes matching scores against candidate sessions, fits a two-component Beta mixture via EM (quantile-based initialization at the 30th/70th percentiles, log-space responsibilities, responsibility-weighted moment updates for the Beta parameters), identifies the high-compatibility component as the one with larger Beta mean, and gates on its posterior probability. Candidates above a posterior threshold are retained, with a minimum-keep fallback of one to prevent over-filtering; the incoming item merges into the most compatible retained session or starts a new one. Per-candidate cost is linear in the number of candidates, so gating overhead is negligible relative to decoding.

Experimental results

Experiments use GPT-4.1 (temperature 0) on two A100 GPUs, with hybrid dense (all-MiniLM-L6-v2) plus BM25 retrieval fused by reciprocal rank fusion. Nine baselines are compared, including Mem0, Zep, MemoryOS, A-Mem, O-Mem, MEMOS, MemR³, HippoRAG 2, and LangMem.

On PersonaMem, FluxMem reaches 72.43% average accuracy versus 63.25% for the best baseline (O-Mem), a +9.18% relative improvement, with the largest per-category gains in recalling user-shared facts (+8.53 points) and generalizing to new scenarios (+8.78). On LoCoMo, FluxMem leads on average F1 (51.16 vs. 46.40 for O-Mem), BLEU-1, and ROUGE-L, with single-hop ROUGE-L improving by +12.49 points. Notably, FluxMem does not win every category: on LoCoMo temporal reasoning it trails O-Mem on BLEU-1 (−7.68 relative), and on PersonaMem preference-aligned recommendations it underperforms A-Mem by 1.81 points. The authors acknowledge this openly, attributing it to a trade-off between specialization for individual scenarios and robustness across heterogeneous patterns—consistent with their thesis that no single structure dominates everywhere.

Ablations support component complementarity. Removing any single structure degrades the task categories aligned with it (linear → temporally dependent tasks such as tracking preference evolution; graph → relational alignment; hierarchical → abstraction-oriented tasks), and removing the BMM gate causes consistent drops, most visibly on LoCoMo's open-domain category, where weak temporal cues and sparse relational signals make flexible selection and cross-structure fusion most critical. Hyperparameter analysis shows moderate sensitivity: performance peaks at a BMM posterior threshold of 0.5 and degrades monotonically as the minimum-keep parameter rises from 1 to 3, indicating that forced retention admits redundant memories. Case studies illustrate correct behavior on a timestamp-alignment query (linear selected), a relocation-history query requiring cross-session entity linking (graph), and a topic-drift query (hierarchical).

Limitations and open questions

Several caveats bear directly on the results. First, the structure selector's supervision depends entirely on offline rewards computed with an LLM judge and a heuristic memory-utilization term; the paper does not measure how sensitive learned selection is to judge noise or to the 0.7/0.3 weighting, nor how well the selector transfers beyond the MSC-derived training distribution. Second, the BMM gate assumes normalized matching scores separate into two Beta-distributed regimes; conversations where scores are unimodal may not admit this decomposition, and the paper does not test this failure mode explicitly. Third, evaluation covers only two benchmarks with GPT-4.1 as the backbone; generalization to other models, agentic tool-use settings, or non-conversational memory workloads remains unexamined. Fourth, the structural design space is restricted to three primitives on theoretical grounds, but the framework offers no mechanism for discovering whether additional or composite structures would help. Finally, the concession that FluxMem loses some categories to specialized baselines raises the open question of when adaptive selection should itself defer to a fixed specialist rather than always choosing among its own repertoire.

Conclusion

FluxMem reframes memory organization in LLM agents as a learnable, per-interaction decision rather than a static architectural commitment. Combining a three-layer hierarchy, three complementary episodic structures, offline reward-supervised structure selection, and distribution-aware BMM gating, it delivers consistent gains—+9.18% on PersonaMem and +6.14% on LoCoMo—over strong fixed-structure baselines, at negligible computational overhead. The results substantiate the central claim that matching memory structure to interaction content matters, while leaving the robustness of the learned selector and the generality of the two-component gating assumption as questions for further study.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Tweets

Sign up for free to view the 1 tweet with 0 likes about this paper.