Research
Memora: A Harmonic Memory Representation Balancing Abstraction and Specificity
Memora: A Harmonic Memory Representation Balancing Abstraction and Specificity Overview Research area: AI agent memory systems and long-context retrieval-augmented generation (RAG), with connections t
- arXiv
- 2602.03315
- Published
- 2026-02-03
- Authors
- Menglin Xia, Xuchao Zhang, Shantanu Dixit, Paramaguru Harimurugan, Rujia Wang, Victor Ruhle, Robert Sim, Chetan Bansal, Saravan Rajmohan
AI summary
Memora: A Harmonic Memory Representation Balancing Abstraction and SpecificityOverview
Research area: AI agent memory systems and long-context retrieval-augmented generation (RAG), with connections to knowledge-graph retrieval, reinforcement learning for sequential decision-making, and LLM-based long-horizon reasoning.
Technical level: Advanced. The paper combines an architectural proposal with a formal MDP formulation of retrieval, a theoretical claim about expressive power, and a policy-optimization method (group-relative policy updates) with an explicit loss function.
Scope: The paper proposes Memora, a memory architecture that separates what is stored from how it is retrieved using "primary abstractions" and "cue anchors," and evaluates it on two long-context memory benchmarks, LoCoMo and LongMemEval.
What This Paper Is About
LLM agents are effectively stateless: they re-derive plans and repeat reasoning steps because they lack a principled way to organize accumulated experience. Existing memory designs fall into two failure modes — storing raw text or atomic facts (which is detailed but fragmented) or compressing history into high-level summaries (which is efficient but strips out task-critical nuances). Memora's goal is to structurally balance abstraction and specificity so that an agent can retrieve both high-level concepts and fine-grained details without processing an entire interaction history.
Key Contributions
-
A harmonic memory representation. Memory entries pair a primary abstraction (the stable canonical identity of what a memory is about) with a memory value (the concrete stored information). Related and evolving information is consolidated into a single entry via a create-or-update rule rather than fragmenting into disjoint records.
-
Cue anchors as a second retrieval layer. Lightweight, fine-grained semantic hooks extracted from memory values form a many-to-many mapping across memory entries. Combined with shared abstraction-level relationships, these give rise to an implicit memory graph without explicit edge construction, and they double as flexible metadata filters (source, timestamp, entity) without a pre-defined ontology.
-
A policy-guided retriever formulated as an MDP. Retrieval is treated as an active reasoning process over three atomic actions — Refine, Expand, and Stop — executed under a finite budget. The policy can be a prompt-based LLM (zero-shot) or trained with group-relative policy updates using a trajectory judge that scores correctness, information redundancy, and retrieval cost.
-
A theoretical claim of generality. The paper provides a formal analysis (proof in Appendix D) arguing that standard RAG and knowledge-graph-based memory systems emerge as special cases of the Memora framework under restricted configurations, while Memora supports richer mixed-key retrieval behaviors.
Main Findings
-
LoCoMo state-of-the-art. The best configuration, Memora with the Policy Retriever, reaches an overall LLM-as-a-Judge score of 0.863, ahead of the Semantic Retriever variant at 0.849, full-context inference at 0.825, Nemori at 0.794, LangMem at 0.734, Mem0 at 0.653, RAG at 0.633, Zep at 0.616, and HippoRAG at 0.471.
-
Per-category LoCoMo results (Policy Retriever). Multi-hop 0.787, Temporal 0.866, Open-domain 0.594, Single-hop 0.918. The Semantic Retriever variant scores 0.784, 0.851, 0.594, and 0.900 respectively.
-
LongMemEval state-of-the-art. Memora (Policy) averages 87.4%, versus Memora (Semantic) 83.8%, Nemori 74.6%, and full context 65.6%. The corresponding context lengths are 2.9k, 2.1k, 3.7-4.8k, and 115k tokens.
-
Not every LongMemEval category is won. Memora (Policy) scores 83.3% on single-sn-preference (Nemori 86.7%) and 78.6% on single-sn-assistant (Nemori 92.9%, full context 98.2%). It leads on temporal-reasoning (89.5% vs 72.2% / 60.2%), multi-session (78.2% vs 55.6% / 51.1%), knowledge-update (97.4% vs 79.5% / 76.9%), and single-sn-user (98.6% vs 90.0% / 85.7%).
-
The abstraction layer, not extra compute, drives the gain. Removing the primary-abstraction layer reduces Memora to essentially Mem0 (both extract factual memories); the ablation score rises from 0.653 (no abstraction) to 0.795 (primary abstraction, no update) to 0.801 (with update) to 0.849 (semantic retriever) to 0.863 (policy retriever) — with cue anchors and policy retrieval disabled in the earliest steps.
-
Fewer, less fragmented memory entries. Memora produces 344 memory entries per conversation on average versus 651 for Mem0.
-
The policy retriever's advantage comes from cue anchors. Removing cue anchors makes the policy retriever comparable to the semantic approach, indicating the gain stems from traversing the memory graph rather than policy-network complexity.
-
Richer episodic context helps. With the Policy Retriever: Episodic (Segment) + Factual scores 0.863 at 8499 average tokens; Episodic (Segment) only scores 0.851 at 6624 tokens; Episodic (Segment) + Factual without cue anchors scores 0.851 at 8425 tokens; Episodic (Extracted) + Factual scores 0.838 at 4467 tokens; Factual only scores 0.833 at 1853 tokens.
-
Latency trade-off. The policy retriever is sequential and slower. For Episodic (S) + Factual: end-to-end mean latency 5.697s (P50 5.004s, P95 10.974s) and search latency mean 4.609s, averaging 3.45 steps. The corresponding semantic configuration is 1.062s end-to-end (P50 1.016s, P95 1.487s) with search latency mean 0.235s and 1 step.
-
Token reduction. The introduction states Memora reduces token consumption by up to 98% compared to full-context processing.
-
Construction cost is comparable to baselines. Mem0 takes 1350.9s per conversation on LoCoMo (score 0.653); Memora takes 1322.0s (score 0.863). An offset-prediction optimization cuts construction to 739.9s (score 0.860), described as a 45% speedup.
-
Gains do not depend on a powerful construction model. Replacing gpt-4.1-mini with gpt-5.4-nano during construction: nano + semantic scores 0.763, nano + policy scores 0.851, versus 0.849 and 0.863 for gpt-4.1-mini. Even the worst nano case outperforms Mem0 (0.653) and RAG (0.633), which are described as using gpt-4.1-mini for construction.
Methodology in Plain English
The system takes a growing stream of documents, logs, code, tables, or agent interaction traces and turns it into a structured memory store. Five steps:
-
Segment the input. Raw data is split into semantically coherent units. For unstructured narratives this uses prompt-based extraction; for formatted files it uses structural hierarchies such as document headers. One segment can produce multiple memory entries.
-
Attach an episodic memory. Each segment gets a narrative grounding — either an extracted high-level summary capturing participants, intent, and temporal scope, or the raw segment text itself. Memory entries sharing the same episodic memory are grouped at retrieval time so the agent recovers surrounding context.
-
Induce primary abstractions. For each segment, the system proposes candidate memory entries, each a pair of a proposed abstraction and its concrete value.
-
Consolidate via create-or-update. Candidates are compared against existing entries by cosine similarity between abstraction embeddings; the top-k above a threshold γ go to an LLM-based selection function that decides whether the candidate refers to the same underlying concept. If it matches, the new content is merged into the existing entry (possibly refining its abstraction); otherwise a new entry is created. Entries stay anchored to a single abstraction.
-
Generate cue anchors. From each memory value, the system extracts salient aspects formatted as a main entity/topic plus a key aspect. These are non-exclusive, so one entry can carry several anchors and one anchor can span many entries. Anchors are existence-checked before linking, and anchors that lose all associations are pruned.
At query time, retrieval is a Markov Decision Process. The state is the current query, the working set of retrieved entries, a "frontier" of candidate memories linked to that working set but not yet retrieved, and a remaining budget. The policy picks one of three actions: Refine (reformulate the query), Expand (pull relevant memories from the frontier), or Stop. Each action costs budget; the process ends on Stop or budget exhaustion.
The policy can be a plain prompt-guided LLM, or trained by sampling a group of retrieval trajectories per query and scoring each with a trajectory-level judge on correctness, redundancy, and cost. Group-relative advantages are computed by subtracting the group mean, and the policy is updated to favor actions from above-average trajectories, optionally with a KL constraint against a reference policy for stability.
Experiments use GPT-4.1-mini as the backbone for memory curation, answer generation, and prompt-based policy retrieval, with generation seed fixed at 42. LoCoMo is used for the main results and ablations; the GRPO variant requires a train/test split of LoCoMo, and the paper states GRPO metrics are reported exclusively on the test partition — the truncated content does not show those values. RAG is configured with chunk size 500 and k = 3.
Why This Matters
Impact on research. The paper argues that the long-standing trade-off between specificity and abstraction is not inherent but a consequence of coupling memory content to memory access. Decoupling them — storing rich, unfragmented content while indexing through a lightweight structural layer — is a design principle that could apply beyond Memora. The formal claim that RAG and KG-based memory are special cases, if it holds, reframes a fragmented literature as points in one space.
Real-world applications:
- Long-horizon enterprise assistants that must remember an evolving project timeline across many sessions without re-reading entire histories.
- Personal AI assistants tracking user preferences, knowledge updates, and multi-session context over months.
- Customer-support agents that need both the general policy (abstraction) and the specific case detail (value) to act correctly.
- Coding or IT-operations agents that accumulate decisions, iterations, and environment-specific constraints over long-running workflows.
Industry relevance. The 98% token reduction claim and the 45% construction-time speedup speak directly to serving cost, which is often the binding constraint on deploying long-memory agents. The finding that a weaker construction model (gpt-5.4-nano) still beats baselines using gpt-4.1-mini matters for cost-sensitive deployments. The honest latency numbers also matter: the policy retriever's 3.45 average steps and ~4.6s search latency versus ~0.24s for semantic search is a real operational trade-off. All authors are affiliated with M365 Research, Microsoft, and code is released at github.com/microsoft/Memora.
Future Directions
-
Closing the category gaps. Memora underperforms Nemori and full context on LongMemEval's single-sn-preference (83.3% vs 86.7% and 16.7%) and single-sn-assistant (78.6% vs 92.9% and 98.2%) categories. Why the harmonic structure loses on these question types is not explained in the available content.
-
Reported GRPO results. The paper describes a GRPO-trained retriever and states that metrics are reported on a held-out test partition of LoCoMo, but the available content does not include those numbers. Quantifying the specific gain from policy optimization over the prompt-based policy retriever is an open question.
-
Reducing policy-retriever latency. The sequential, multi-step, multi-LLM-call search costs roughly ten times the search latency of semantic retrieval. Making the policy cheaper or partial-caching intermediate states would widen applicability.
-
Stress-testing scale and domains. The evaluation covers two conversational memory benchmarks. Whether the abstraction layer's advantages hold for code repositories, tables, and multi-modal streams, and at much larger memory stores, is not addressed in the available content.
Target Audience
Researchers and engineers working on LLM agent memory, long-context reasoning, and retrieval-augmented generation who are already comfortable with embedding-based retrieval. It is also relevant to practitioners building production assistants that must persist state across sessions, and to readers interested in applying reinforcement learning to retrieval control. Readers without background in RAG pipelines, knowledge graphs, or policy optimization will need to consult the related-work section first.
Authors’ abstract
Agent memory systems must accommodate continuously growing information while supporting efficient, context-aware retrieval for downstream tasks. Abstraction is essential for scaling agent memory, yet it often comes at the cost of specificity, obscuring the fine-grained details required for effective reasoning. We introduce Memora, a harmonic memory representation that structurally balances abstraction and specificity. Memora organizes information via its primary abstractions that index concrete memory values and consolidate related updates into unified memory entries, while cue anchors expand retrieval access across diverse aspects of the memory and connect related memories. Building on this structure, we employ a retrieval policy that actively exploits these memory connections to retrieve relevant information beyond direct semantic similarity. Theoretically, we show that standard Retrieval-Augmented Generation (RAG) and Knowledge Graph (KG)-based memory systems emerge as special cases of our framework. Empirically, Memora establishes a new state-of-the-art on the LoCoMo and LongMemEval benchmarks, demonstrating better retrieval relevance and reasoning effectiveness as memory scales.