arXiv:2606.22844: RaMem solves context collapse in long-term agentic memory
RaMem is a four-phase framework that prevents context collapse in agentic memory systems — a state where compressed fragments lose their surrounding context and are mistakenly retrieved as equally relevant. On long-term memory benchmarks it achieves an average F1 gain exceeding 10% compared to existing baseline systems.
This article was generated using artificial intelligence from primary sources.
Why agents forget — and misremember
Long-term memory in language agents hides a trap: when a system compresses past interactions into short fragments, those fragments lose their original episodic context — who was in the conversation, when it happened, and in which session. The result is context collapse — a state in which the retrieval module sees equally relevant fragments from completely different situations and returns the wrong memories. A team from USC and affiliated institutions proposes RaMem as a systematic solution to this problem.
Four steps to reliable recall
RaMem operates as a four-phase relevance-checking pipeline.
Evidence anchoring is the first step: each memory receives an episodic anchor at storage time — capturing time, participants, and a session identifier. Without this anchor, retrieval cannot compare the storage context with the query context.
Recall condition induction extracts the conditions that a query implicitly assumes. If an agent asks, “What did Mark and I agree on last week?”, the system automatically derives a temporal and participant dimension as search conditions.
Validity-aware retrieval then prioritizes fragments whose episodic anchor matches the derived conditions — rather than ranking by semantic similarity alone.
Context-preserved synthesis finally assembles the response while retaining the structured context, preventing secondary collapse during generation.
More than 10% F1 above strong baselines
On standard long-term memory benchmarks, RaMem achieves an average F1 gain exceeding 10% compared to existing memory systems. A key advantage: the framework is model-agnostic — it works with different underlying language models without architectural modifications. The paper was submitted to arXiv on June 22, 2026 (cs.AI, cs.MA), by Wei Yang, Bryce Kan, and collaborators at the University of Southern California.
Frequently Asked Questions
- What is context collapse and why does it harm agents?
- Context collapse occurs when a memory system compresses fragments from different situations such that they lose their temporal, session, and participant surroundings — retrieval then cannot assess true relevance and returns wrong memories.
- By how much does RaMem improve accuracy compared to existing systems?
- On several long-term memory benchmarks RaMem achieves an average F1 gain exceeding 10% compared to strong baseline systems, regardless of the specific underlying language model.