FlexA-Mem:面向大语言模型智能体的预算自适应智能体记忆

arXiv cs.CL 论文

摘要

FlexA-Mem 提出一种预算自适应的智能体记忆机制,将历史一次性写入不可变存储,并为每次调用动态渲染紧凑的时间线记忆加相关细节,在 AppWorld、LongMemEval 和 LoCoMo 上显著优于 A-Mem 等现有方法。

arXiv:2610.33274v1 Announce Type: new Abstract: Large language model (LLM) agents work in scenarios with very different memory needs. A question about past conversations needs the exact facts it names, while a multi-step task needs a trace of the steps already taken together with details that the next step cannot name. Existing memories are each designed and tested for one kind of scenario. Retrieval memories such as A-Mem miss steps that the current query does not express, summaries drop exact strings, and pairing the two fixes the split of the budget in advance. We propose FlexA-Mem, a general memory that writes each unit of history once into an immutable store and renders a fresh memory for every call. The rendered memory is a compact timeline of records plus detail that a fixed rule fits into the remaining room without an LLM call. The detail is either relevant units as raw text or excerpts or the verbatim pieces that best match the query. With one store, FlexA-Mem serves both kinds of scenario. On AppWorld challenge tasks at 4k, it outperforms the second-best method by 11.5%, and on 147 unused tasks with predictions fixed in advance it outperforms A-Mem with a summary by 12.2%. On LongMemEval and LoCoMo, it matches a dedicated keyword retriever that writes no memory, while memories built on text written by an LLM fall far behind at tight budgets. Ablations show that the timeline carries AppWorld completion, whereas recovery mainly saves steps there and decides accuracy on exact facts. Code is available at https://github.com/WujiangXu/Flex-Amem
查看原文
查看缓存全文

缓存时间: 2026/10/28 02:01

# FlexA-Mem: Budget-Adaptive Agentic Memory for LLM Agents
Source: [https://arxiv.org/html/2610.33274](https://arxiv.org/html/2610.33274)
Jiaojiao HanAffiliation:Independent ResearcherXi ZhuAffiliation:Rutgers UniversityQizheng ZhangAffiliation:Stanford UniversityKaiqu LiangAffiliation:Pricenton UniversityYutong YinAffiliation:Northwestern UniversityKai MeiAffiliation:Rutgers UniversityDimitris N\. MetaxasAffiliation:Rutgers University

###### Abstract

Large language model \(LLM\) agents work in scenarios with very different memory needs\. A question about past conversations needs the exact facts it names, while a multi\-step task needs a trace of the steps already taken together with details that the next step cannot name\. Existing memories are each designed and tested for one kind of scenario\. Retrieval memories such as A\-Mem miss steps that the current query does not express, summaries drop exact strings, and pairing the two fixes the split of the budget in advance\. We propose FlexA\-Mem, a general memory that writes each unit of history once into an immutable store and renders a fresh memory for every call\. The rendered memory is a compact timeline of records plus detail that a fixed rule fits into the remaining room without an LLM call\. The detail is either relevant units as raw text or excerpts or the verbatim pieces that best match the query\. With one store, FlexA\-Mem serves both kinds of scenario\. On AppWorld challenge tasks at 4k, it outperforms the second\-best method by 11\.5%, and on 147 unused tasks with predictions fixed in advance it outperforms A\-Mem with a summary by 12\.2%\. On LongMemEval and LoCoMo, it matches a dedicated keyword retriever that writes no memory, while memories built on text written by an LLM fall far behind at tight budgets\. Ablations show that the timeline carries AppWorld completion, whereas recovery mainly saves steps there and decides accuracy on exact facts\. Code is available at[https://github\.com/WujiangXu/Flex\-Amem](https://github.com/WujiangXu/Flex-Amem)\.

## 1Introduction

Large language model \(LLM\) agents now work in many settings\. They call the APIs of apps\([Trivedi et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib59)\), resolve software issues by editing and testing code\([Jimenez et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib56);[Yang et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib33)\), and answer questions about conversations held over dozens of sessions\([Wu et al\., 2025a](https://arxiv.org/html/2610.33274#bib.bib54)\)\. In each setting the history soon outgrows a single call, and models use the middle of a long context less reliably\([Liu et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib48)\)\. Therefore, each call works under a fixed token budget, and memory decides what fills it\.

What should fill the budget depends on the scenario\. A question about a past conversation usually names its evidence and depends on a few exact facts, such as a date mentioned weeks before\. A multi\-step task depends first on an overview of what the agent has done\. An AppWorld agent that sends money must log in, list the APIs and read their documentation, and if these steps leave its context it starts them again\. It also needs exact details that change from step to step, such as an API argument or an earlier output\. Some calls need all of a few past units, and others need a little of every past unit\.

Existing memories are each designed for one of these needs and tested on benchmarks of the matching kind\. Retrieval memories such as A\-Mem\([Xu et al\., 2025a](https://arxiv.org/html/2610.33274#bib.bib4)\)return the notes closest to the query, which suits fact recall, but an agent asked to send money has no reason to search for its earlier login\. Compaction replaces old observations with placeholders or an LLM summary\([Wang et al\., 2025c](https://arxiv.org/html/2610.33274#bib.bib34);[Lindenbauer et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib36)\), which keeps an overview of a long trajectory but drops the exact strings a fact question asks for\. Summary\+A\-Mem combines the two with a fixed split of the budget, and MemGPT and Sculptor leave hidden details to tools\([Packer et al\., 2023](https://arxiv.org/html/2610.33274#bib.bib6);[Li et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib28)\)that agents rarely call\([Fan et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib49);[Li et al\., 2026b](https://arxiv.org/html/2610.33274#bib.bib25)\)\. As a result, each method works well in its own scenario but loses much of its strength in the other\.

Figure 1:Retrieval suits fact recall but loses the trace of a multi\-step task, a summary keeps the trace but loses exact facts, and FlexA\-Mem serves both needs within a single token budget\.A memory that generalizes across scenarios is hard to build because the right balance between overview and detail is not known when the history is written \(Figure[1](https://arxiv.org/html/2610.33274#S1.F1)\)\. It depends on the scenario, on the step within a task and on the budget of the call\. Nor can the query alone settle it\. With its task and latest steps as the query, keyword matching finds the details an AppWorld agent needs no better than chance\. For this reason, a memory that commits at write time, by summarizing, by evolving notes or by fixing a split, is tuned to one scenario by construction\. The decision has to be made at every call, and it must stay cheap, because an agent calls the model at every step\.

To this end, we propose FlexA\-Mem, a general memory that writes each unit of history once and renders it anew at every call\. The store keeps the raw text of every unit, and each rendering shows a timeline of short records that does not depend on the query\. It fills the remaining room with recovered detail by a fixed rule, without an LLM call\. Our contributions are summarized as follows\.

- •We introduce a write\-once, render\-per\-call design for agent memory\. It stores every unit of history immutably and decides only at read time how much of each unit a call sees\. Nothing is discarded before the scenario, the query and the budget are known\.
- •We propose fit\-or\-degrade, a budget\-aware renderer that needs no LLM call\. It gives each relevant unit the highest resolution that fits, raw text, an excerpt or its record, and turns more units into excerpts as the budget shrinks\. As a drop\-in renderer it raises the AppWorld completion of A\-Mem’s own notes by 10\.7%\.
- •We show that one store serves both kinds of scenario\. FlexA\-Mem outperforms the second\-best method by 11\.5% on AppWorld challenge tasks and the strongest baseline by 12\.2% on 147 unused tasks, and on fact recall it matches a dedicated keyword retriever\. In our ablations the timeline carries agent completion, while recovery saves steps there and decides accuracy when the answer is an exact fact\.

## 2Related Work

Memory is essential for personalized agents\([Liang et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib62);[Xu et al\., 2025b](https://arxiv.org/html/2610.33274#bib.bib63)\), enabling them to tailor their services to individual users’ needs and preferences\. Most agent memories store past interactions and retrieve a few at each call\([Park et al\., 2023](https://arxiv.org/html/2610.33274#bib.bib1);[Zhong et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib2);[Chhikara et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib3);[Rasmussen et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib5)\)\. A\-Mem links its notes with an LLM and lets new notes rewrite their neighbors\([Xu et al\., 2025a](https://arxiv.org/html/2610.33274#bib.bib4)\), and unretrieved steps are absent from the call\. A second line keeps the history at several levels of detail\([Packer et al\., 2023](https://arxiv.org/html/2610.33274#bib.bib6);[Sarthi et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib11);[Rezazadeh et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib12);[Xu et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib9)\)\. MemGPT, RAPTOR and MemTree fix the level at write time, while MemGAS and SCM choose it with an LLM\([Wang et al\., 2025a](https://arxiv.org/html/2610.33274#bib.bib7)\)and Nemori adds raw messages of top episodes\([Ma et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib13)\)\. The closest designs choose a form per item under a budget\([Liao et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib46);[Kang et al\., 2026b](https://arxiv.org/html/2610.33274#bib.bib47)\)\. ReadAgent lets an LLM swap gists for raw pages\([Lee et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib42)\), and AFM falls back from full to compressed to placeholder forms while packing oldest first\([Cruz, 2025](https://arxiv.org/html/2610.33274#bib.bib45)\)\. A third line lets the agent manage its context through tools\([Hu et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib23);[Li et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib28);[Ehrlich and Blackman, 2026](https://arxiv.org/html/2610.33274#bib.bib24);[Li et al\., 2026b](https://arxiv.org/html/2610.33274#bib.bib25)\)or learns this with reinforcement learning\([Sun et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib29);[Ye et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib30);[Zhou et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib21);[Yan et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib19)\), but agents seldom act on their own\([Fan et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib49);[Li et al\., 2026b](https://arxiv.org/html/2610.33274#bib.bib25)\)\.

FlexA\-Mem builds on the two closest designs, taking degradation within a budget from AFM and in\-place replacement of a gist by raw text from ReadAgent\. Keeping raw text, several resolutions and in\-place replacement are each known\. The new design makes these choices at read time by a fixed rule, without an LLM call or an action of the agent\. Unlike A\-Mem it never rewrites a note, and unlike AFM it keeps a record of every unit and visits units by relevance rather than age\. Our experiments then show that one store serves both kinds of scenario\. Appendix[D](https://arxiv.org/html/2610.33274#A4)covers context compression and other memory systems in more detail\.

## 3FlexA\-Mem

Figure 2:Overview of FlexA\-Mem\. Each unit is written once and keeps its raw text in the store\. Every call shows a compact timeline of records and fills the rest of the budget by unit or piece recovery\.FlexA\-Mem writes each unit once into an immutable store and renders a fresh memory for every call from one timeline and one of two recovery modes \(Figure[2](https://arxiv.org/html/2610.33274#S3.F2)\)\. Callttof an agent or a reader sees a context

Ct=\[Pt;Mt;Wt\],\|Ct\|≤B¯,C\_\{t\}=\[\\,P\_\{t\};\\ M\_\{t\};\\ W\_\{t\}\\,\],\\qquad\|C\_\{t\}\|\\leq\\bar\{B\},\(1\)wherePtP\_\{t\}is the fixed part of the prompt \(instructions and the task or question\) andMtM\_\{t\}is the memory\. The recent windowWtW\_\{t\}holds the newest units shown unchanged\. Lengths are counted in tokens with one shared tokenizer, and the prompt lengthB¯=0\.95​B\\bar\{B\}=0\.95Bfor a budgetBBleaves a small safety margin\. The allowanceAt=B¯−\|Pt\|−\|Wt\|A\_\{t\}=\\bar\{B\}\-\|P\_\{t\}\|\-\|W\_\{t\}\|is the room left for memory\. Memory is kept in units\. For an agent, consecutive steps, each an action with the environment’s output, are packed into one unit until it reaches 1,000 tokens\. For a reader that answers a question about a past conversation, each session is cut at user turns into spans of at most about 2,000 tokens, and there is no recent window\. The units older than the recent window areu1,…,unu\_\{1\},\\dots,u\_\{n\}in time order\.

### 3\.1Writing Memory

When a unituiu\_\{i\}leaves the recent window, FlexA\-Mem writes it once as a notemi=\(ri,si,fi,ei,Li,Πi\)m\_\{i\}=\(r\_\{i\},s\_\{i\},f\_\{i\},e\_\{i\},L\_\{i\},\\Pi\_\{i\}\)\. The raw textrir\_\{i\}is the unit exactly as it occurred and never changes\. One LLM call readsrir\_\{i\}and writes the recordsis\_\{i\}, at most 80 words, with retrieval fieldsfif\_\{i\}made of keywords, tags and a short description\. A small sentence encoderϕ\\phigives the embeddingei=ϕ\(si∥fi\)e\_\{i\}=\\phi\(s\_\{i\}\\\|f\_\{i\}\), where∥\\\|denotes concatenation, and the linksLiL\_\{i\}connectuiu\_\{i\}in both directions to the three earlier notes with the highest cosine similarity toeie\_\{i\}\. Without an LLM call, FlexA\-Mem also cutsrir\_\{i\}at line breaks into piecesΠi=\(πi​1,…,πi​Ki\)\\Pi\_\{i\}=\(\\pi\_\{i1\},\\dots,\\pi\_\{iK\_\{i\}\}\)of at mostκ\\kappatokens\. Each piece stays inside one conversation turn or one block of an agent step\. FlexA\-Mem never rewrites a note, since a later call recovers detail from the exact raw text and a rewritten neighbor would add cost but no detail\.

### 3\.2The Timeline of Records

Every call shows the timelineTtT\_\{t\}, the records of past units in time order, which keeps a compact trace of what the agent has done\. When it grows too long, FlexA\-Mem replaces up to four consecutive records, oldest first, with a merged record that one LLM call writes\. Let‖Tt‖\\\|T\_\{t\}\\\|be the length of the timeline,ρ\\rhothe share of the allowance given to it, andDtD\_\{t\}the total cost of showing every candidate of unit recovery as raw text \(Section[3\.3](https://arxiv.org/html/2610.33274#S3.SS3)\)\. Merging repeats, oldest first, while‖Tt‖\>max⁡\(ρ​At,At−Dt\)\\\|T\_\{t\}\\\|\>\\max\(\\rho A\_\{t\},A\_\{t\}\-D\_\{t\}\)\. A merged record is computed once and reused by later calls\. Merging loses the detail of separate records in the context, but the raw text of every unit stays in the store and can still be recovered\. On agentic tasks the oldest records are also hidden for one call when the newest unit alone takes more than a quarter of the budget \(Appendix[A](https://arxiv.org/html/2610.33274#A1)\)\. The room left for recovery isR0=At−‖Tt‖R\_\{0\}=A\_\{t\}\-\\\|T\_\{t\}\\\|\.

### 3\.3Unit Recovery

Unit recovery shows each unit at one of three resolutions, its record, an excerpt or its raw text, and a recovered unit appears in its place in the timeline\. Candidates come from the query embeddingϕ⁡\(qt\)\\phi\(q\_\{t\}\)\. For a reader it embeds the question, and for an agent it is the normalized sum of the embeddings of the task and of the newest unit \(Table[9](https://arxiv.org/html/2610.33274#A1.T9)in Appendix[A](https://arxiv.org/html/2610.33274#A1)\)\. Letct​\(j\)c\_\{t\}\(j\)be the cosine similarity betweenϕ⁡\(qt\)\\phi\(q\_\{t\}\)andeje\_\{j\}, let the seedsStS\_\{t\}be thekkunits with the highestctc\_\{t\}, and letNiN\_\{i\}hold the two units adjacent touiu\_\{i\}in time\. A unituju\_\{j\}receives the score

gt\(j\)=max\{\\displaystyle g\_\{t\}\(j\)=\\max\\bigl\\\{λ\[i≠j\]ct\(i\):\\displaystyle\\lambda^\{\[i\\neq j\]\}\\,c\_\{t\}\(i\)\\;:\(2\)i∈St,j∈\{i\}∪Li∪Ni\},\\displaystyle i\\in S\_\{t\},\\ j\\in\\\{i\\\}\\cup L\_\{i\}\\cup N\_\{i\}\\bigr\\\},where\[i≠j\]\[i\\neq j\]is 1 whenuju\_\{j\}is reached from another seed and 0 otherwise, andλ<1\\lambda<1discounts units reached through a link or through time\. The candidates are the seeds and the units they reach, visited in decreasing order ofgtg\_\{t\}\. Links recover a unit that is connected to what the query concerns, even if its own text does not resemble the query\.

Letxivx\_\{i\}^\{v\}denote the text ofuiu\_\{i\}at resolutionvv, and letτi=1\\tau\_\{i\}=1if the record ofuiu\_\{i\}still stands alone in the timeline andτi=0\\tau\_\{i\}=0if it has been merged\. Showinguiu\_\{i\}at resolutionvvcosts

costi​\(v\)=\{0if​v=rec,\|xiv\|−τi​\|si\|otherwise\.\\mathrm\{cost\}\_\{i\}\(v\)=\\begin\{cases\}0&\\text\{if \}v=\\mathrm\{rec\},\\\\ \\lvert x\_\{i\}^\{v\}\\rvert\-\\tau\_\{i\}\\lvert s\_\{i\}\\rvert&\\text\{otherwise\}\.\\end\{cases\}\(3\)A recovered unit takes the place of its own record, which keeps each detail where it happened\. After a merge it is placed right after the merged record and pays its full length\. Fit\-or\-degrade visits the candidates in order and gives each the highest resolution that still fits\. For theℓ\\ell\-th candidateu\(ℓ\)u\_\{\(\\ell\)\},

v\(ℓ\)\\displaystyle v\_\{\(\\ell\)\}=maxrec≺exc≺raw⁡\{v:cost\(ℓ\)​\(v\)≤Rℓ−1\},\\displaystyle=\\max\_\{\\mathrm\{rec\}\\prec\\mathrm\{exc\}\\prec\\mathrm\{raw\}\}\\bigl\\\{v:\\mathrm\{cost\}\_\{\(\\ell\)\}\(v\)\\leq R\_\{\\ell\-1\}\\bigr\\\},\(4\)Rℓ\\displaystyle R\_\{\\ell\}=Rℓ−1−cost\(ℓ\)​\(v\(ℓ\)\)\.\\displaystyle=R\_\{\\ell\-1\}\-\\mathrm\{cost\}\_\{\(\\ell\)\}\\bigl\(v\_\{\(\\ell\)\}\\bigr\)\.The record always fits because it costs nothing\. A unit whose raw text does not fit keeps the part of it that matches the query instead of falling back to its record\. A more relevant unit is never degraded to make room for a less relevant one\. The rule has no setting tied to the budget, yet a smaller allowance turns more of the recovered units into excerpts\.

An excerpt is the recordsis\_\{i\}followed, in their original order, by the pieces ofuiu\_\{i\}that best match the query\. FlexA\-Mem ranks the pieces by their Okapi BM25 \(BM25\) score against the query \(Table[9](https://arxiv.org/html/2610.33274#A1.T9)\), with inverse document frequencies over the whole store, and takes them greedily into a setXiX\_\{i\}while∑π∈Xi\|π\|≤E\\sum\_\{\\pi\\in X\_\{i\}\}\|\\pi\|\\leq E\. Excerpts are verbatim because a later call often needs exact strings\.

### 3\.4Piece Recovery

Piece recovery spends the room on pieces from the whole history instead of whole units\. It ranks every piece of every unit,Π=⋃iΠi\\Pi=\\bigcup\_\{i\}\\Pi\_\{i\}, by its BM25 score against the query, which is the question for a reader and the task with the newest unit for an agent\. Pieces enter a setXtX\_\{t\}in rank order while∑π∈Xt\|π\|≤R0\\sum\_\{\\pi\\in X\_\{t\}\}\|\\pi\|\\leq R\_\{0\}\. The chosen pieces follow the timeline, grouped by unit in time order\. Because pieces always want more room than is left, the timeline is merged down to its shareρ​At\\rho A\_\{t\}and lends any unused part of it to the pieces\. One unit can contribute several pieces and many units one each, which suits evidence spread over sessions\.

### 3\.5Choosing a Recovery Mode

A question about a past conversation usually names its evidence, and keyword matching over all pieces finds it while spending the room only on matching text\. The next step of an agent re\-uses a detail that its context cannot name, and whole units keep the context around each detail\. For this reason we use unit recovery for agents and piece recovery for questions over a history\. Within a mode FlexA\-Mem adapts the detail it shows to the budget at every call, but it does not choose the mode at run time \(Section[6\.4](https://arxiv.org/html/2610.33274#S6.SS4)\)\. The only LLM calls at read time write merged records, and Algorithm[1](https://arxiv.org/html/2610.33274#alg1)in Appendix[A](https://arxiv.org/html/2610.33274#A1)gives the full procedure of unit recovery\.

## 4Experimental Setup

Table 1:Main results, completion on AppWorld, resolve rate on SWE\-bench, accuracy on 440 LongMemEval questions and J on LoCoMo\. Blue, orange and green mark the best, second and third method with a budget per column\. Gray numbers, from the mode FlexA\-Mem does not use on that task, and timeline only are not ranked\. Appendix[B](https://arxiv.org/html/2610.33274#A2)lists the results from separate runs\.### 4\.1Benchmarks

AppWorld\([Trivedi et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib59)\)asks agents to complete everyday tasks through the APIs of nine apps\. We report the share of tasks whose unit tests all pass, with 60 steps and budgets of 4k and 6k tokens\. Test\-Normal has 168 tasks, and Test\-Challenge has 417 harder ones on which no setting was chosen\. Without a budget the longest prompt on Test\-Normal has a median of 10\.4k tokens\. The 147 unused tasks of the Train and Dev sets confirm the design, with the method, predictions and tests fixed before any run \(Appendix[E\.1](https://arxiv.org/html/2610.33274#A5.SS1)\)\. SWE\-bench Verified\([Jimenez et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib56);[OpenAI, 2024](https://arxiv.org/html/2610.33274#bib.bib57)\)asks an agent in mini\-swe\-agent\([Lieret and Jimenez, 2025](https://arxiv.org/html/2610.33274#bib.bib58)\)to resolve issues in Python repositories within 250 steps\. We report the resolve rate at 8k on the 480 issues our images can grade, 95 of which were used to choose settings\.

LongMemEval\([Wu et al\., 2025a](https://arxiv.org/html/2610.33274#bib.bib54)\)gives each of 500 questions a history of about 48 sessions and 103k tokens, which a reader answers from 4k to 32k tokens\. We choose settings on 60 development questions and report accuracy on the other 440\. Their aggregate results were inspected while we designed piece recovery and the rule for choosing a mode\. For this reason we treat LongMemEval as comparative evidence and the unused AppWorld tasks as the test of the frozen design\. LoCoMo\([Maharana et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib60)\)has 1,540 questions on 10 conversations in its first four categories, answered from 2k to 8k tokens with the reader and judge prompts of Mem0\([Chhikara et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib3)\), and FlexA\-Mem keeps its LongMemEval settings\.

### 4\.2Baselines and Implementation

All methods share the units, the embedding model, the budget, the token counter and the LLM, GPT\-5\.4 mini\. A\-Mem\([Xu et al\., 2025a](https://arxiv.org/html/2610.33274#bib.bib4)\)fills the allowance with retrieved notes in raw text, and Summary\+A\-Mem adds a running LLM summary\([Wang et al\., 2025c](https://arxiv.org/html/2610.33274#bib.bib34)\)that takes half of the allowance on LongMemEval and 70% on the agentic tasks\. MemGAS\([Xu et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib9)\)filters granularities with an LLM, Sculptor\([Li et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib28)\)manages the context through tools, and ReadAgent\([Lee et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib42)\)replaces gists with pages chosen by an LLM\. AFM\([Cruz, 2025](https://arxiv.org/html/2610.33274#bib.bib45)\), which we reproduce and calibrate, gives each unit a full, compressed or placeholder form \(Appendix[E\.3](https://arxiv.org/html/2610.33274#A5.SS3)\)\. Piece and unit retrieval rank pieces by BM25 or units by embedding and write no memory\. Observation masking\([Lindenbauer et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib36)\)hides old tool outputs, alone or with a rule\-written log of past steps, and truncation keeps the newest units \(Appendix[C](https://arxiv.org/html/2610.33274#A3)\)\. We tuned FlexA\-Mem on the LongMemEval development questions only and kept default values on the agentic tasks \(Appendix[A](https://arxiv.org/html/2610.33274#A1)\)\. Claude Sonnet 4\.6 and GPT\-5\.4 judge the answers, and the exact McNemar test compares paired outcomes\.

## 5Results

### 5\.1Agentic Tasks

Table 2:FlexA\-Mem against the strongest baseline run in further settings\.With unit recovery, FlexA\-Mem completes more AppWorld tasks than every baseline that works under a budget \(Table[1](https://arxiv.org/html/2610.33274#S4.T1)\)\. The margin is widest on Test\-Challenge, where it outperforms the second\-best method, ReadAgent, by 11\.5% at 4k \(p<0\.001p<0\.001\) and 7\.7% at 6k \(p=0\.002p=0\.002\)\. At 6k it also matches the full history, 62\.4% against 62\.1% \(p=1p=1\)\. Test\-Normal separates the methods less clearly\. Its leads of 2\.4% and 6\.0% over ReadAgent are not significant and lie within the 4\.8% that separates two runs of the same arm\. On all 480 SWE\-bench Verified issues the margins are smaller, as FlexA\-Mem outperforms the second\-best method, observation masking, by 2\.3% and Summary\+A\-Mem by 4\.0% with one fifth of the tokens of Summary\+A\-Mem\. Neither a rerun of AppWorld nor a limit of 150 steps removes the significant lead, and on the 385 SWE\-bench issues not used to choose settings the lead is 1\.8% \(Table[2](https://arxiv.org/html/2610.33274#S5.T2)and Appendix[F](https://arxiv.org/html/2610.33274#A6)\)\.

### 5\.2Confirmation on Unused Tasks

Table 3:Confirmation on 147 unused AppWorld tasks, with steps per episode\. Timeline only drops recovery\.The 147 unused tasks confirm the AppWorld results \(Table[3](https://arxiv.org/html/2610.33274#S5.T3)\)\. Before the first episode we froze the code, six arms, two budgets and five predictions\. At 4k FlexA\-Mem outperforms the strongest baseline, Summary\+A\-Mem, by 12\.2% \(Holm\-adjustedp=0\.006p=0\.006\), and it differs from the full history by−\-0\.7% and\+\+4\.1%, neither significant\. Three of the five predictions hold\. The lead over Summary\+A\-Mem at 6k misses after correction \(p=0\.061p=0\.061\), and the lead over the timeline alone at 6k shrinks to 2\.0% \(p=0\.345p=0\.345\)\. This last miss is a first sign that the timeline does most of the work \(Section[6\.2](https://arxiv.org/html/2610.33274#S6.SS2)\)\.

### 5\.3Fact Recall

Keyword retrieval over the raw history is the strongest simple method for fact recall, and piece recovery keeps pace with it \(Table[1](https://arxiv.org/html/2610.33274#S4.T1)\)\. The two stay within 0\.7% of each other at every LongMemEval budget, and at 4k piece recovery outperforms A\-Mem by 25\.9%\. That gap closes as the budget grows, until A\-Mem leads at 32k with 88\.6% against 85\.7%\. LoCoMo favors piece recovery slightly, by 1\.0% to 2\.6% over piece retrieval\. These results do not show that records written by an LLM help fact recall, because removing the timeline changes LongMemEval accuracy by at most 3\.6%\. What they show is that one store serves both kinds of scenario\. The memory whose timeline carries agent completion matches a dedicated retriever on questions that name their evidence, whereas every baseline memory built on text written by an LLM falls behind once the budget is tight\.

### 5\.4Cost and Other Models

Figure 3:Completion or accuracy against tokens per task, memory construction included\. FlexA\-Mem uses unit recovery on AppWorld and piece recovery on LongMemEval, the mode set for each\.Table 4:AppWorld with three agents and LongMemEval with three readers\.Table 5:Change in completion or accuracy \(%\) when one part of FlexA\-Mem with unit recovery is removed or changed\. Appendix[B](https://arxiv.org/html/2610.33274#A2)gives the control of each row\.FlexA\-Mem spends one seventh to one third of the tokens of A\-Mem and Summary\+A\-Mem per task \(Figure[3](https://arxiv.org/html/2610.33274#S5.F3)and Table[14](https://arxiv.org/html/2610.33274#A5.T14)\), although the full history costs fewer tokens in every setting\. On AppWorld only observation masking uses fewer tokens among the methods with a budget, and it completes 28\.6% fewer tasks\. On LongMemEval piece retrieval reaches the accuracy of FlexA\-Mem with 8\.0k instead of 176\.6k tokens, because it writes no memory\. On LongMemEval it stays the most accurate method that writes memory with all three readers \(Table[4](https://arxiv.org/html/2610.33274#S5.T4)\)\. Only on SWE\-bench Verified with Haiku does FlexA\-Mem trail, resolving 2\.1% fewer issues than observation masking \(Appendix[E\.5](https://arxiv.org/html/2610.33274#A5.SS5)\)\.

## 6Analysis

Figure 4:\(a\) Unit minus piece recovery \(%\)\. \(b\) LongMemEval accuracy at 4k, grouped by the BM25 rank of the best evidence piece of each question\.### 6\.1How the Baselines Fail on AppWorld

Figure 5:Test\-Normal episodes that end at the 60\-step limit at 4k \(filled, value printed\) and 6k \(open\)\.In the failure trajectories we analyze, the main failure mode of the baselines on AppWorld is repeating their own setup, not giving wrong answers \(Figure[5](https://arxiv.org/html/2610.33274#S6.F5)\)\. At 4k on Test\-Normal, 23\.8% of the episodes of FlexA\-Mem end at the step limit, against 55\.4% to 85\.7% for every baseline except Summary\+A\-Mem\. The tasks that the baselines declare complete are right about as often as those of FlexA\-Mem\. Of their failures at 4k, 90% are loops of logging in and rereading documentation\. Extra steps do not rescue them\. With 150 steps instead of 60, observation masking, truncation and piece retrieval complete no more tasks, whereas FlexA\-Mem rises from 64\.3% to 80\.4%\. ReadAgent and AFM, the two strongest baselines, keep a gist of every unit or a compressed summary of most units in view\. Unlike ReadAgent, AFM packs units oldest first and drops 2\.3 of the newest units per call at 4k\.

### 6\.2The Timeline Keeps the Trace

Records written byRecovery4k6kGPT\-5\.4 mininone67\.375\.0fixed rules, no LLMnone61\.361\.3fixed rules, with maskingnone58\.366\.7Claude Haiku 4\.5none51\.8–GPT\-5\.4 miniraw text only64\.380\.4Claude Haiku 4\.5raw text only62\.5–Table 6:AppWorld Test\-Normal completion with records from different writers\.Removing the timeline costs the most on AppWorld, lowering completion by 15\.5% at 4k and 10\.1% at 6k \(Table[5](https://arxiv.org/html/2610.33274#S5.T5)\)\. On SWE\-bench Verified the resolve rate barely moves, but the agent needs 56\.9 steps per issue instead of 43\.8\. The unused tasks tell the same story, with the timeline alone within 2\.0% of the full method \(Table[3](https://arxiv.org/html/2610.33274#S5.T3)\)\. Records from an LLM help little at 4k\. A trace written by fixed rules, with no LLM call, still completes 61\.3% of Test\-Normal against 67\.3% for records from GPT\-5\.4 mini \(p=0\.15p=0\.15\), although LLM records matter once there is room at 6k \(Table[6](https://arxiv.org/html/2610.33274#S6.T6)\)\. Such a trace is a strong design on its own\. Observation masking with this trace reaches 58\.3% at 4k, up from 35\.7%, and trails FlexA\-Mem by 6\.0% \(p=0\.12p=0\.12\)\. The gap grows to 11\.3% at 6k \(p=0\.003p=0\.003\) and on Test\-Challenge to 12\.7% at 4k and 19\.7% at 6k \(bothp<10−8p<10^\{\-8\}\)\. Fact recall, in contrast, barely uses the timeline\. Removing it changes LongMemEval accuracy by at most 3\.6%, and on LoCoMo the timeline alone stays below piece recovery at each budget from 2k to 8k\.

### 6\.3Recovery Brings Back the Detail

Figure 6:Share of memory tokens of FlexA\-Mem on records, excerpts and raw text\.Table 7:Questions to the memory at 109 checkpoints of SWE\-bench trajectories at 8k\. Colors mark the best, second and third method with a budget, without the version without excerpts\.Recovery decides accuracy when the answer is an exact detail\. On LongMemEval, removing recovery lowers accuracy by 28\.2% at 4k and random candidates lower it by 47\.5%, whereas showing the same selection after the timeline changes it by at most 1\.4%\. Fit\-or\-degrade is not the best rule there, since giving every candidate an excerpt gains 6\.1% at 4k\. AppWorld uses recovery to save effort rather than to complete more tasks, and on the unused tasks it cuts the steps per episode from 32\.2 to 26\.9 at 4k\. It still adds 5\.0% on Test\-Challenge at 4k through excerpts \(p=0\.031p=0\.031\) and 10\.7% when Claude Haiku 4\.5 writes the records \(Appendix[E\.8](https://arxiv.org/html/2610.33274#A5.SS8)\)\. Without a timeline the rule decides completion, and rendering the notes of A\-Mem with fit\-or\-degrade raises its Test\-Normal completion by 10\.7% at 4k\. The rule also adapts to the budget as designed\. Excerpts take 7\.4% of the LongMemEval memory tokens at 8k and 2\.4% at 32k, while raw text grows from 68\.2% to 73\.5% \(Figure[6](https://arxiv.org/html/2610.33274#S6.F6)\)\. With excerpts, the memory tells whether a SWE\-bench agent displayed a given file with a balanced accuracy of 0\.93 against 0\.83 without them \(Table[7](https://arxiv.org/html/2610.33274#S6.T7)\)\. Observation masking reaches 0\.96, since it keeps every command and hides only old outputs\.

### 6\.4When Each Recovery Mode Wins

Each mode leads on the kind of scenario it was set for \(Figure[4](https://arxiv.org/html/2610.33274#S6.F4)a\)\. Unit recovery outperforms piece recovery in all five agentic settings, by 4\.8% to 10\.1%, and piece recovery leads on LongMemEval up to 16k and on LoCoMo at every budget\. In the questions we test, the gap between the modes is associated with how well the question names its evidence \(Figure[4](https://arxiv.org/html/2610.33274#S6.F4)b\)\. Piece recovery is ahead by 17\.6% at 4k when BM25 ranks the evidence first, and unit recovery is ahead by 26\.5% when the evidence ranks below twentieth\. This rank needs evidence labels\. The runtime signals we tested do not reliably predict the better mode for a single query, and we offer no deployable rule for choosing it\. The two modes also differ in more than the unit of recovery \(Appendix[F](https://arxiv.org/html/2610.33274#A6)\)\.

## 7Conclusion

A single write\-once store, rendered anew at every call as a compact timeline of records plus detail recovered by a fixed rule, lets FlexA\-Mem serve both kinds of scenario\. On agentic tasks the timeline keeps the trace and carries completion, coming within 2\.0% of the full method on tasks unused in design\. On fact recall the recovered text decides accuracy, and keyword retrieval over the kept raw text is already strong\. Choosing the recovery mode for each query without labels is the next step\.

## Limitations

We designed the final FlexA\-Mem after the main experiments, and only the 147 unused AppWorld tasks test it with predictions fixed in advance\. Most configurations ran once, with up to 4\.8% between two runs on AppWorld\. The recovery mode is set per task type rather than per query\. Every history here fits in the context of the model, where the full history costs fewer tokens, and all four benchmarks are in English\. Appendix[B](https://arxiv.org/html/2610.33274#A2)gives further details\.

## References

- Badertdinovet al\.\(2025\)I\. Badertdinov, A\. Golubev, M\. Nekrashevich, A\. Shevtsov, S\. Karasik, A\. Andriushchenko, M\. Trofimova, D\. Litvintseva, and B\. YangelSWE\-rebench: an automated pipeline for task collection and decontaminated evaluation of software engineering agents\.InAdvances in Neural Information Processing Systems,Note:arXiv:2505\.20411Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p5.1)\.
- Chhikaraet al\.\(2025\)P\. Chhikara, D\. Khant, S\. Aryan, T\. Singh, and D\. YadavMem0: building production\-ready AI agents with scalable long\-term memory\.InProceedings of the European Conference on Artificial Intelligence \(ECAI\),Note:arXiv:2504\.19413External Links:[Document](https://dx.doi.org/10.3233/FAIA251160)Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1),[§4\.1](https://arxiv.org/html/2610.33274#S4.SS1.p2.1)\.
- Cruz \(2025\)C\. CruzAdaptive focus memory for language models\.arXiv preprint arXiv:2511\.12712\.Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1),[§4\.2](https://arxiv.org/html/2610.33274#S4.SS2.p1.1),[Table 1](https://arxiv.org/html/2610.33274#S4.T1.2.15.1)\.
- Cuiet al\.\(2026\)Z\. Cui, J\. Cao, Z\. Wen, B\. Yuan, J\. Feng, and S\. ChenEdgeMem: LLM\-free agent memory construction and retrieval via evidence\-preserving multi\-anchor hypergraph\.arXiv preprint arXiv:2609\.05553\.Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p1.1)\.
- Ehrlich and Blackman \(2026\)C\. Ehrlich and T\. BlackmanLCM: lossless context management\.arXiv preprint arXiv:2605\.04050\.Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Fanet al\.\(2026\)R\. Fan, Z\. Zhang, S\. Ma, Y\. Hu, S\. Wang, K\. Song, F\. Liu, H\. Zamani, and X\. WangAn empirical study of harness design for coding agents\.arXiv preprint arXiv:2609\.20804\.Cited by:[§1](https://arxiv.org/html/2610.33274#S1.p3.1),[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Fanget al\.\(2026\)J\. Fang, X\. Deng, H\. Xu, Z\. Jiang, Y\. Tang, Z\. Xu, S\. Deng, Y\. Yao, M\. Wang, S\. Qiao, H\. Chen, and N\. ZhangLightMem: lightweight and efficient memory\-augmented generation\.InProceedings of the International Conference on Learning Representations \(ICLR\),Note:arXiv:2510\.18866Cited by:[Table 16](https://arxiv.org/html/2610.33274#A5.T16.2.5.1)\.
- Huet al\.\(2025\)M\. Hu, T\. Chen, Q\. Chen, Y\. Mu, W\. Shao, and P\. LuoHiAgent: hierarchical working memory management for solving long\-horizon agent tasks with large language model\.InProceedings of the Annual Meeting of the Association for Computational Linguistics \(ACL\),pp\. 32779–32798\.External Links:[Document](https://dx.doi.org/10.18653/v1/2025.acl-long.1575)Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Jianget al\.\(2023\)H\. Jiang, Q\. Wu, C\. Lin, Y\. Yang, and L\. QiuLLMLingua: compressing prompts for accelerated inference of large language models\.InProceedings of the Conference on Empirical Methods in Natural Language Processing \(EMNLP\),pp\. 13358–13376\.External Links:[Document](https://dx.doi.org/10.18653/v1/2023.emnlp-main.825)Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p4.1)\.
- Jianget al\.\(2024\)H\. Jiang, Q\. Wu, X\. Luo, D\. Li, C\. Lin, Y\. Yang, and L\. QiuLongLLMLingua: accelerating and enhancing LLMs in long context scenarios via prompt compression\.InProceedings of the Annual Meeting of the Association for Computational Linguistics \(ACL\),pp\. 1658–1677\.External Links:[Document](https://dx.doi.org/10.18653/v1/2024.acl-long.91)Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p4.1)\.
- Jimenezet al\.\(2024\)C\. E\. Jimenez, J\. Yang, A\. Wettig, S\. Yao, K\. Pei, O\. Press, and K\. NarasimhanSWE\-bench: can language models resolve real\-world GitHub issues?\.InProceedings of the International Conference on Learning Representations \(ICLR\),Note:arXiv:2310\.06770Cited by:[§1](https://arxiv.org/html/2610.33274#S1.p1.1),[§4\.1](https://arxiv.org/html/2610.33274#S4.SS1.p1.1)\.
- Kanget al\.\(2025\)J\. Kang, M\. Ji, Z\. Zhao, and T\. BaiMemory OS of AI agent\.InProceedings of the Conference on Empirical Methods in Natural Language Processing \(EMNLP\),pp\. 25972–25981\.Note:arXiv:2506\.06326External Links:[Document](https://dx.doi.org/10.18653/v1/2025.emnlp-main.1318)Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p1.1)\.
- Kanget al\.\(2026a\)M\. Kang, W\. Chen, D\. Han, H\. A\. Inan, L\. Wutschitz, Y\. Chen, R\. Sim, and S\. RajmohanACON: optimizing context compression for long\-horizon LLM agents\.InProceedings of the International Conference on Machine Learning \(ICML\),Note:arXiv:2510\.00615Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p4.1),[Table 16](https://arxiv.org/html/2610.33274#A5.T16.2.10.1),[Table 16](https://arxiv.org/html/2610.33274#A5.T16.2.11.1)\.
- Kanget al\.\(2026b\)Q\. Kang, M\. Liu, S\. Kai, K\. Liang, Z\. Tang, Y\. Cui, T\. Zhong, and M\. YuanRetain or consolidate? Budget\-dependent operator selection for language agent memory\.arXiv preprint arXiv:2607\.17545\.Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Leeet al\.\(2024\)K\. Lee, X\. Chen, H\. Furuta, J\. Canny, and I\. FischerA human\-inspired reading agent with gist memory of very long contexts\.InProceedings of the International Conference on Machine Learning \(ICML\),PMLR, Vol\.235\.Note:arXiv:2402\.09727Cited by:[Appendix C](https://arxiv.org/html/2610.33274#A3.p2.1),[§2](https://arxiv.org/html/2610.33274#S2.p1.1),[§4\.2](https://arxiv.org/html/2610.33274#S4.SS2.p1.1),[Table 1](https://arxiv.org/html/2610.33274#S4.T1.2.14.1)\.
- Liet al\.\(2026a\)M\. Li, L\. H\. Xu, Q\. Tan, L\. Ma, T\. Cao, and Y\. LiuSculptor: empowering LLMs with cognitive agency via active context management\.InProceedings of the International Conference on Learning Representations \(ICLR\),Note:arXiv:2508\.04664Cited by:[Appendix C](https://arxiv.org/html/2610.33274#A3.p2.1),[§1](https://arxiv.org/html/2610.33274#S1.p3.1),[§2](https://arxiv.org/html/2610.33274#S2.p1.1),[§4\.2](https://arxiv.org/html/2610.33274#S4.SS2.p1.1),[Table 1](https://arxiv.org/html/2610.33274#S4.T1.2.13.1)\.
- Liet al\.\(2026b\)X\. Li, R\. Ming, M\. Chu, S\. Shao, R\. Jin, and C\. XiongACM: agentic context management for long horizon tasks\.arXiv preprint arXiv:2607\.23809\.Cited by:[§1](https://arxiv.org/html/2610.33274#S1.p3.1),[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Lianget al\.\(2026\)K\. Liang, J\. Kruk, S\. Qian, X\. Yang, S\. Bi, Y\. Yao, S\. Nie, M\. Zhang, L\. Liu, J\. F\. Fisac,et al\.Learning personalized agents from human feedback\.arXiv preprint arXiv:2602\.16173\.Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Liaoet al\.\(2026\)N\. Liao, Z\. Long, X\. Wang, X\. Yang, Y\. Wang, Z\. Zhuang, X\. Cai, R\. Weng, and J\. YanACE: pluggable adaptive context elasticizer across agents\.arXiv preprint arXiv:2606\.31564\.Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Lieret and Jimenez \(2025\)K\. A\. Lieret and C\. E\. Jimenezmini\-swe\-agent\.Note:[https://github\.com/SWE\-agent/mini\-swe\-agent](https://github.com/SWE-agent/mini-swe-agent)Software, version 2\.3\.0Cited by:[§4\.1](https://arxiv.org/html/2610.33274#S4.SS1.p1.1)\.
- Lindenbaueret al\.\(2025\)T\. Lindenbauer, I\. Slinko, L\. Felder, E\. Bogomolov, and Y\. ZharovThe complexity trap: simple observation masking is as efficient as LLM summarization for agent context management\.InNeurIPS 2025 Workshop on Deep Learning for Code \(DL4C\),Note:arXiv:2508\.21433Cited by:[Appendix C](https://arxiv.org/html/2610.33274#A3.p3.1),[Appendix D](https://arxiv.org/html/2610.33274#A4.p4.1),[Table 16](https://arxiv.org/html/2610.33274#A5.T16.2.8.1),[§1](https://arxiv.org/html/2610.33274#S1.p3.1),[§4\.2](https://arxiv.org/html/2610.33274#S4.SS2.p1.1),[Table 1](https://arxiv.org/html/2610.33274#S4.T1.2.6.1)\.
- Liuet al\.\(2024\)N\. F\. Liu, K\. Lin, J\. Hewitt, A\. Paranjape, M\. Bevilacqua, F\. Petroni, and P\. LiangLost in the middle: how language models use long contexts\.Transactions of the Association for Computational Linguistics12,pp\. 157–173\.External Links:[Document](https://dx.doi.org/10.1162/tacl%5Fa%5F00638)Cited by:[§1](https://arxiv.org/html/2610.33274#S1.p1.1)\.
- Liuet al\.\(2026\)S\. Liu, B\. Jiang, J\. Yang, Y\. Li, J\. Guo, X\. Liu, and B\. DaiContext as a tool: context management for long\-horizon SWE\-agents\.InFindings of the Association for Computational Linguistics: ACL 2026,pp\. 20604–20617\.Note:arXiv:2512\.22087External Links:[Document](https://dx.doi.org/10.18653/v1/2026.findings-acl.1032)Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p3.1)\.
- Liu \(2026\)S\. LiuWhat does context compression cost an agent? interaction costs unrevealed by task\-completion metrics\.arXiv preprint arXiv:2608\.16370\.Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p2.1)\.
- Maet al\.\(2026\)W\. Ma, J\. Nan, and W\. WuWhat deserves memory: adaptive memory distillation for LLM agents\.InProceedings of the Annual Meeting of the Association for Computational Linguistics \(ACL\),pp\. 34789–34812\.Note:arXiv:2508\.03341External Links:[Document](https://dx.doi.org/10.18653/v1/2026.acl-long.1607)Cited by:[Table 16](https://arxiv.org/html/2610.33274#A5.T16.2.4.1),[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Maharanaet al\.\(2024\)A\. Maharana, D\. Lee, S\. Tulyakov, M\. Bansal, F\. Barbieri, and Y\. FangEvaluating very long\-term conversational memory of LLM agents\.InProceedings of the Annual Meeting of the Association for Computational Linguistics \(ACL\),pp\. 13851–13870\.Note:arXiv:2402\.17753External Links:[Document](https://dx.doi.org/10.18653/v1/2024.acl-long.747)Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p5.1),[§4\.1](https://arxiv.org/html/2610.33274#S4.SS1.p2.1)\.
- Mason \(2026\)T\. MasonThe missing memory hierarchy: demand paging for LLM context windows\.arXiv preprint arXiv:2603\.09023\.Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p3.1)\.
- OpenAI \(2024\)OpenAIIntroducing SWE\-bench Verified\.Note:[https://huggingface\.co/datasets/princeton\-nlp/SWE\-bench\_Verified](https://huggingface.co/datasets/princeton-nlp/SWE-bench_Verified)Blog post and datasetCited by:[§4\.1](https://arxiv.org/html/2610.33274#S4.SS1.p1.1)\.
- Packeret al\.\(2023\)C\. Packer, S\. Wooders, K\. Lin, V\. Fang, S\. G\. Patil, I\. Stoica, and J\. E\. GonzalezMemGPT: towards LLMs as operating systems\.arXiv preprint arXiv:2310\.08560\.Cited by:[§1](https://arxiv.org/html/2610.33274#S1.p3.1),[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Panet al\.\(2025\)Z\. Pan, Q\. Wu, H\. Jiang, X\. Luo, H\. Cheng, D\. Li, Y\. Yang, C\. Lin, H\. V\. Zhao, L\. Qiu, and J\. GaoOn memory construction and retrieval for personalized conversational agents\.InProceedings of the International Conference on Learning Representations \(ICLR\),Note:arXiv:2502\.05589Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p1.1)\.
- Panet al\.\(2024\)Z\. Pan, Q\. Wu, H\. Jiang, M\. Xia, X\. Luo, J\. Zhang, Q\. Lin, V\. Rühle, Y\. Yang, C\. Lin, H\. V\. Zhao, L\. Qiu, and D\. ZhangLLMLingua\-2: data distillation for efficient and faithful task\-agnostic prompt compression\.InFindings of the Association for Computational Linguistics: ACL 2024,Note:arXiv:2403\.12968Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p4.1)\.
- Parket al\.\(2023\)J\. S\. Park, J\. O’Brien, C\. J\. Cai, M\. R\. Morris, P\. Liang, and M\. S\. BernsteinGenerative agents: interactive simulacra of human behavior\.InProceedings of the 36th Annual ACM Symposium on User Interface Software and Technology \(UIST\),pp\. 1–22\.External Links:[Document](https://dx.doi.org/10.1145/3586183.3606763)Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Rasmussenet al\.\(2025\)P\. Rasmussen, P\. Paliychuk, T\. Beauvais, J\. Ryan, and D\. ChalefZep: a temporal knowledge graph architecture for agent memory\.arXiv preprint arXiv:2501\.13956\.Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Rezazadehet al\.\(2025\)A\. Rezazadeh, Z\. Li, W\. Wei, and Y\. BaoFrom isolated conversations to hierarchical schemas: dynamic tree memory representation for LLMs\.InProceedings of the International Conference on Learning Representations \(ICLR\),Note:arXiv:2410\.14052Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Sarthiet al\.\(2024\)P\. Sarthi, S\. Abdullah, A\. Tuli, S\. Khanna, A\. Goldie, and C\. D\. ManningRAPTOR: recursive abstractive processing for tree\-organized retrieval\.InProceedings of the International Conference on Learning Representations \(ICLR\),Note:arXiv:2401\.18059Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Sunet al\.\(2025\)W\. Sun, M\. Lu, Z\. Ling, K\. Liu, X\. Yao, Y\. Yang, and J\. ChenScaling long\-horizon LLM agent via context\-folding\.arXiv preprint arXiv:2510\.11967\.Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Trivediet al\.\(2024\)H\. Trivedi, T\. Khot, M\. Hartmann, R\. Manku, V\. Dong, E\. Li, S\. Gupta, A\. Sabharwal, and N\. BalasubramanianAppWorld: a controllable world of apps and people for benchmarking interactive coding agents\.InProceedings of the Annual Meeting of the Association for Computational Linguistics \(ACL\),pp\. 16022–16076\.External Links:[Document](https://dx.doi.org/10.18653/v1/2024.acl-long.850)Cited by:[§1](https://arxiv.org/html/2610.33274#S1.p1.1),[§4\.1](https://arxiv.org/html/2610.33274#S4.SS1.p1.1)\.
- Wanget al\.\(2025a\)B\. Wang, X\. Liang, J\. Yang, H\. Huang, S\. Wu, P\. Wu, L\. Lu, Z\. Ma, and Z\. LiSCM: enhancing large language model with self\-controlled memory framework\.InProceedings of the International Conference on Database Systems for Advanced Applications \(DASFAA\),Note:arXiv:2304\.13343Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Wanget al\.\(2025b\)Q\. Wang, Y\. Fu, Y\. Cao, S\. Wang, Z\. Tian, and L\. DingRecursively summarizing enables long\-term dialogue memory in large language models\.Neurocomputing639,pp\. 130193\.Note:arXiv:2308\.15022External Links:[Document](https://dx.doi.org/10.1016/j.neucom.2025.130193)Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p1.1)\.
- Wanget al\.\(2025c\)X\. Wang, B\. Li, Y\. Song, F\. F\. Xu, X\. Tang, M\. Zhuge, J\. Pan, Y\. Song, B\. Li, J\. Singh, H\. H\. Tran, F\. Li, R\. Ma, M\. Zheng, B\. Qian, Y\. Shao, N\. Muennighoff, Y\. Zhang, B\. Hui, J\. Lin, R\. Brennan, H\. Peng, H\. Ji, and G\. NeubigOpenHands: an open platform for AI software developers as generalist agents\.InProceedings of the International Conference on Learning Representations \(ICLR\),Note:arXiv:2407\.16741Cited by:[Appendix C](https://arxiv.org/html/2610.33274#A3.p1.1),[Appendix D](https://arxiv.org/html/2610.33274#A4.p4.1),[§1](https://arxiv.org/html/2610.33274#S1.p3.1),[§4\.2](https://arxiv.org/html/2610.33274#S4.SS2.p1.1),[Table 1](https://arxiv.org/html/2610.33274#S4.T1.2.11.1)\.
- Wanget al\.\(2026a\)X\. Wang, S\. Rosenberg, J\. Michelini, C\. Smith, H\. Tran, E\. Nyst, R\. Malhotra, X\. Zhou, V\. Chen, R\. Brennan, and G\. NeubigThe OpenHands software agent SDK: a composable and extensible foundation for production agents\.InProceedings of Machine Learning and Systems \(MLSys\),Note:arXiv:2511\.03690Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p4.1)\.
- Wanget al\.\(2026b\)Z\. Wang, H\. Chen, J\. Wang, and W\. WeiMemex\(RL\): scaling long\-horizon LLM agents via indexed experience memory\.arXiv preprint arXiv:2603\.04257\.Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p3.1)\.
- Wanget al\.\(2026c\)Z\. Wang, Y\. Zhang, D\. Lee, and Y\. YangLost in compaction: evaluating side\-constraint loss under context compaction\.arXiv preprint arXiv:2608\.11242\.Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p2.1)\.
- Weinberger and Hozez \(2026\)S\. Weinberger and A\. HozezToken reduction is not cost reduction\.arXiv preprint arXiv:2607\.12161\.Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p4.1)\.
- Wuet al\.\(2025a\)D\. Wu, H\. Wang, W\. Yu, Y\. Zhang, K\. Chang, and D\. YuLongMemEval: benchmarking chat assistants on long\-term interactive memory\.InProceedings of the International Conference on Learning Representations \(ICLR\),Note:arXiv:2410\.10813Cited by:[Appendix A](https://arxiv.org/html/2610.33274#A1.p1.1),[§1](https://arxiv.org/html/2610.33274#S1.p1.1),[§4\.1](https://arxiv.org/html/2610.33274#S4.SS1.p2.1)\.
- Wuet al\.\(2025b\)J\. Wu, M\. Hu, J\. Zhu, J\. Pan, Y\. Liu, M\. Xu, and Y\. JinGit context controller: manage the context of LLM\-based agents like git\.arXiv preprint arXiv:2508\.00031\.Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p3.1)\.
- Xiaoet al\.\(2026\)Y\. Xiao, P\. Gao, C\. Peng, and Y\. XiongReducing cost of LLM agents with trajectory reduction\.Proceedings of the ACM on Software Engineering3\(FSE\),pp\. 1241–1263\.Note:arXiv:2509\.23586External Links:[Document](https://dx.doi.org/10.1145/3797084)Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p4.1)\.
- Xuet al\.\(2026a\)D\. Xu, Y\. Wen, P\. Jia, Y\. Zhang, W\. Zhang, Y\. Wang, H\. Guo, R\. Tang, X\. Zhao, E\. Chen, and T\. XuFrom single to multi\-granularity: toward long\-term memory association and selection of conversational agents\.InProceedings of the International Conference on Learning Representations \(ICLR\),Note:arXiv:2505\.19549Cited by:[Appendix C](https://arxiv.org/html/2610.33274#A3.p2.1),[Table 16](https://arxiv.org/html/2610.33274#A5.T16.2.3.1),[§2](https://arxiv.org/html/2610.33274#S2.p1.1),[§4\.2](https://arxiv.org/html/2610.33274#S4.SS2.p1.1),[Table 1](https://arxiv.org/html/2610.33274#S4.T1.2.12.1)\.
- Xuet al\.\(2025a\)W\. Xu, Z\. Liang, K\. Mei, H\. Gao, J\. Tan, and Y\. ZhangA\-MEM: agentic memory for LLM agents\.InAdvances in Neural Information Processing Systems,Vol\.38,pp\. 20004–20031\.Note:arXiv:2502\.12110External Links:[Document](https://dx.doi.org/10.52202/085713-0593)Cited by:[Appendix C](https://arxiv.org/html/2610.33274#A3.p1.1),[§1](https://arxiv.org/html/2610.33274#S1.p3.1),[§2](https://arxiv.org/html/2610.33274#S2.p1.1),[§4\.2](https://arxiv.org/html/2610.33274#S4.SS2.p1.1),[Table 1](https://arxiv.org/html/2610.33274#S4.T1.2.10.1)\.
- Xuet al\.\(2025b\)W\. Xu, Y\. Shi, Z\. Liang, X\. Ning, K\. Mei, K\. Wang, X\. Zhu, M\. Xu, and Y\. ZhangIagent: llm agent as a shield between user and recommender systems\.InFindings of the Association for Computational Linguistics: ACL 2025,pp\. 18056–18084\.Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Xuet al\.\(2026b\)W\. Xu, Y\. Wang, K\. Mei, K\. Liang, Z\. Wang, M\. Jin, H\. Zhang, S\. Zhang, W\. Hua, S\. Sahu, and D\. N\. MetaxasMemGym: a long\-horizon memory environment for LLM agents\.arXiv preprint arXiv:2605\.20833\.Cited by:[Appendix C](https://arxiv.org/html/2610.33274#A3.p1.1),[Appendix D](https://arxiv.org/html/2610.33274#A4.p5.1)\.
- Yanet al\.\(2025\)B\. Y\. Yan, C\. Li, H\. Qian, S\. Lu, and Z\. LiuGeneral agentic memory via deep research\.arXiv preprint arXiv:2511\.18423\.Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p1.1)\.
- Yanet al\.\(2026\)S\. Yan, X\. Yang, Z\. Huang, E\. Nie, Z\. Ding, Z\. Li, X\. Ma, J\. Bi, K\. Kersting, J\. Z\. Pan, H\. Schütze, V\. Tresp, and Y\. MaMemory\-R1: enhancing large language model agents to manage and utilize memories via reinforcement learning\.InProceedings of the Annual Meeting of the Association for Computational Linguistics \(ACL\),pp\. 12805–12825\.Note:arXiv:2508\.19828External Links:[Document](https://dx.doi.org/10.18653/v1/2026.acl-long.583)Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Yanget al\.\(2024\)J\. Yang, C\. Jimenez, A\. Wettig, K\. Lieret, S\. Yao, K\. Narasimhan, and O\. PressSWE\-agent: agent\-computer interfaces enable automated software engineering\.InAdvances in Neural Information Processing Systems,pp\. 50528–50652\.Note:arXiv:2405\.15793External Links:[Document](https://dx.doi.org/10.52202/079017-1601)Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p4.1),[§1](https://arxiv.org/html/2610.33274#S1.p1.1)\.
- Yeet al\.\(2026\)R\. Ye, Z\. Zhang, K\. Li, H\. Yin, Z\. Tao, Y\. Zhao, L\. Su, L\. Zhang, Z\. Qiao, X\. Wang, P\. Xie, F\. Huang, S\. Chen, J\. Zhou, and Y\. JiangAgentFold: long\-horizon web agents with proactive context management\.InProceedings of the International Conference on Learning Representations \(ICLR\),Note:arXiv:2510\.24699Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Yuet al\.\(2024\)W\. Yu, H\. Zhang, X\. Pan, K\. Ma, H\. Wang, and D\. YuChain\-of\-Note: enhancing robustness in retrieval\-augmented language models\.InProceedings of the Conference on Empirical Methods in Natural Language Processing \(EMNLP\),Note:arXiv:2311\.09210Cited by:[Appendix A](https://arxiv.org/html/2610.33274#A1.p1.1)\.
- Yuet al\.\(2026\)Y\. Yu, L\. Yao, Y\. Xie, Q\. Tan, J\. Feng, Y\. Li, and L\. WuAgentic memory: learning unified long\-term and short\-term memory management for large language model agents\.InProceedings of the Annual Meeting of the Association for Computational Linguistics \(ACL\),pp\. 21457–21483\.Note:arXiv:2601\.01885External Links:[Document](https://dx.doi.org/10.18653/v1/2026.acl-long.981)Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p3.1)\.
- Zenget al\.\(2026\)Z\. Zeng, Y\. Li, R\. Xie, W\. Ye, and S\. ZhangAttnCompress: dynamic attention\-guided trajectory compression for software engineering agents\.InProceedings of the ACM SIGSOFT International Symposium on Software Testing and Analysis \(ISSTA\),Note:arXiv:2609\.08318Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p4.1),[Table 16](https://arxiv.org/html/2610.33274#A5.T16.2.7.1)\.
- Zerhoudiet al\.\(2026\)S\. Zerhoudi, J\. Mitrovic, and M\. GranitzerThe compaction cliff in long\-running AI agent memory\.InProceedings of the ACM International Conference on Information and Knowledge Management \(CIKM\),Note:arXiv:2608\.22752Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p4.1)\.
- Zhanget al\.\(2026a\)D\. Zhang, Y\. Lin, Z\. Wu, Y\. Sun, B\. Li, D\. Li, and H\. PengUseful memories become faulty when continuously updated by LLMs\.arXiv preprint arXiv:2605\.12978\.Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p2.1)\.
- Zhanget al\.\(2026b\)Y\. Zhang, J\. Shu, Y\. Ma, X\. Lin, S\. Wu, and J\. SangMemory as action: autonomous context curation for long\-horizon agentic tasks\.InFindings of the Association for Computational Linguistics: ACL 2026,pp\. 19149–19164\.Note:arXiv:2510\.12635External Links:[Document](https://dx.doi.org/10.18653/v1/2026.findings-acl.956)Cited by:[Appendix D](https://arxiv.org/html/2610.33274#A4.p3.1)\.
- Zhonget al\.\(2024\)W\. Zhong, L\. Guo, Q\. Gao, H\. Ye, and Y\. WangMemoryBank: enhancing large language models with long\-term memory\.Proceedings of the AAAI Conference on Artificial Intelligence38\(17\),pp\. 19724–19731\.External Links:[Document](https://dx.doi.org/10.1609/aaai.v38i17.29946)Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.
- Zhouet al\.\(2026\)Z\. Zhou, A\. Qu, Z\. Wu, S\. Kim, A\. Prakash, D\. Rus, J\. Zhao, B\. K\. H\. Low, and P\. P\. LiangMEM1: learning to synergize memory and reasoning for efficient long\-horizon agents\.InProceedings of the International Conference on Learning Representations \(ICLR\),Note:arXiv:2506\.15841Cited by:[§2](https://arxiv.org/html/2610.33274#S2.p1.1)\.

###### Contents

1. [1Introduction](https://arxiv.org/html/2610.33274#S1)
2. [2Related Work](https://arxiv.org/html/2610.33274#S2)
3. [3FlexA\-Mem](https://arxiv.org/html/2610.33274#S3)1. [3\.1Writing Memory](https://arxiv.org/html/2610.33274#S3.SS1) 2. [3\.2The Timeline of Records](https://arxiv.org/html/2610.33274#S3.SS2) 3. [3\.3Unit Recovery](https://arxiv.org/html/2610.33274#S3.SS3) 4. [3\.4Piece Recovery](https://arxiv.org/html/2610.33274#S3.SS4) 5. [3\.5Choosing a Recovery Mode](https://arxiv.org/html/2610.33274#S3.SS5)
4. [4Experimental Setup](https://arxiv.org/html/2610.33274#S4)1. [4\.1Benchmarks](https://arxiv.org/html/2610.33274#S4.SS1) 2. [4\.2Baselines and Implementation](https://arxiv.org/html/2610.33274#S4.SS2)
5. [5Results](https://arxiv.org/html/2610.33274#S5)1. [5\.1Agentic Tasks](https://arxiv.org/html/2610.33274#S5.SS1) 2. [5\.2Confirmation on Unused Tasks](https://arxiv.org/html/2610.33274#S5.SS2) 3. [5\.3Fact Recall](https://arxiv.org/html/2610.33274#S5.SS3) 4. [5\.4Cost and Other Models](https://arxiv.org/html/2610.33274#S5.SS4)
6. [6Analysis](https://arxiv.org/html/2610.33274#S6)1. [6\.1How the Baselines Fail on AppWorld](https://arxiv.org/html/2610.33274#S6.SS1) 2. [6\.2The Timeline Keeps the Trace](https://arxiv.org/html/2610.33274#S6.SS2) 3. [6\.3Recovery Brings Back the Detail](https://arxiv.org/html/2610.33274#S6.SS3) 4. [6\.4When Each Recovery Mode Wins](https://arxiv.org/html/2610.33274#S6.SS4)
7. [7Conclusion](https://arxiv.org/html/2610.33274#S7)
8. [References](https://arxiv.org/html/2610.33274#bib)
9. [AImplementation Details](https://arxiv.org/html/2610.33274#A1)
10. [BExperiment Details](https://arxiv.org/html/2610.33274#A2)
11. [CBaselines](https://arxiv.org/html/2610.33274#A3)
12. [DAdditional Related Work](https://arxiv.org/html/2610.33274#A4)
13. [EAdditional Results](https://arxiv.org/html/2610.33274#A5)1. [E\.1Confirmation Fixed in Advance](https://arxiv.org/html/2610.33274#A5.SS1) 2. [E\.2Results by Budget](https://arxiv.org/html/2610.33274#A5.SS2) 3. [E\.3AFM and LoCoMo](https://arxiv.org/html/2610.33274#A5.SS3) 4. [E\.4Recovery Modes in Detail](https://arxiv.org/html/2610.33274#A5.SS4) 5. [E\.5Other Agents and Readers](https://arxiv.org/html/2610.33274#A5.SS5) 6. [E\.6Token Costs](https://arxiv.org/html/2610.33274#A5.SS6) 7. [E\.7Robustness](https://arxiv.org/html/2610.33274#A5.SS7) 8. [E\.8What the Timeline Needs](https://arxiv.org/html/2610.33274#A5.SS8) 9. [E\.9What the Memory Recalls on SWE\-bench](https://arxiv.org/html/2610.33274#A5.SS9) 10. [E\.10How the Memory Uses the Budget](https://arxiv.org/html/2610.33274#A5.SS10) 11. [E\.11Excerpt Variants and Plug\-ins](https://arxiv.org/html/2610.33274#A5.SS11) 12. [E\.12A Case Study](https://arxiv.org/html/2610.33274#A5.SS12) 13. [E\.13Numbers Reported by Other Papers](https://arxiv.org/html/2610.33274#A5.SS13)
14. [FSupplementary Results](https://arxiv.org/html/2610.33274#A6)1. [F\.1Results](https://arxiv.org/html/2610.33274#A6.SS1)1. [F\.1\.1Agentic Tasks](https://arxiv.org/html/2610.33274#A6.SS1.SSS1) 2. [F\.1\.2Confirmation on Unused Tasks](https://arxiv.org/html/2610.33274#A6.SS1.SSS2) 3. [F\.1\.3Fact Recall](https://arxiv.org/html/2610.33274#A6.SS1.SSS3) 4. [F\.1\.4Cost and Other Models](https://arxiv.org/html/2610.33274#A6.SS1.SSS4) 2. [F\.2Analysis](https://arxiv.org/html/2610.33274#A6.SS2)1. [F\.2\.1How the Baselines Fail on AppWorld](https://arxiv.org/html/2610.33274#A6.SS2.SSS1) 2. [F\.2\.2The Timeline Keeps the Trace](https://arxiv.org/html/2610.33274#A6.SS2.SSS2) 3. [F\.2\.3Recovery Brings Back the Detail](https://arxiv.org/html/2610.33274#A6.SS2.SSS3) 4. [F\.2\.4When Each Recovery Mode Wins](https://arxiv.org/html/2610.33274#A6.SS2.SSS4)

## Appendix AImplementation Details

Algorithm 1Rendering memory at calltt\.0:notes

\{mi\}\\\{m\_\{i\}\\\}, timeline

TT, query

qtq\_\{t\}, allowance

AtA\_\{t\}, settings

ρ,λ,k,E\\rho,\\lambda,k,E
1:

𝒞←\\mathcal\{C\}\\leftarrowcandidates of

qtq\_\{t\}ordered by

gtg\_\{t\}\(Eq\.[2](https://arxiv.org/html/2610.33274#S3.E2)\)

2:

D←∑j∈𝒞costj​\(raw\)D\\leftarrow\\sum\_\{j\\in\\mathcal\{C\}\}\\mathrm\{cost\}\_\{j\}\(\\mathrm\{raw\}\)
3:while

‖T‖\>max⁡\(ρ​At,At−D\)\\\|T\\\|\>\\max\(\\rho A\_\{t\},\\ A\_\{t\}\-D\)do

4:merge the oldest records of

TTinto one merged record

5:endwhile

6:

R←At−‖T‖R\\leftarrow A\_\{t\}\-\\\|T\\\|,

𝒱←∅\\mathcal\{V\}\\leftarrow\\emptyset
7:for

j∈𝒞j\\in\\mathcal\{C\}in orderdo

8:if

costj​\(raw\)≤R\\mathrm\{cost\}\_\{j\}\(\\mathrm\{raw\}\)\\leq Rthen

9:

𝒱←𝒱∪\{\(j,raw\)\}\\mathcal\{V\}\\leftarrow\\mathcal\{V\}\\cup\\\{\(j,\\mathrm\{raw\}\)\\\},

R←R−costj​\(raw\)R\\leftarrow R\-\\mathrm\{cost\}\_\{j\}\(\\mathrm\{raw\}\)
10:elseif

costj​\(exc\)≤R\\mathrm\{cost\}\_\{j\}\(\\mathrm\{exc\}\)\\leq Rthen

11:

𝒱←𝒱∪\{\(j,exc\)\}\\mathcal\{V\}\\leftarrow\\mathcal\{V\}\\cup\\\{\(j,\\mathrm\{exc\}\)\\\},

R←R−costj​\(exc\)R\\leftarrow R\-\\mathrm\{cost\}\_\{j\}\(\\mathrm\{exc\}\)
12:endif

13:endfor

14:

Mt←TM\_\{t\}\\leftarrow Twith each

\(j,v\)∈𝒱\(j,v\)\\in\\mathcal\{V\}in place of the record of

uju\_\{j\}
15:while

\|Mt\|\>At\|M\_\{t\}\|\>A\_\{t\}do

16:remove the lowest ranked element of

𝒱\\mathcal\{V\}and rebuild

MtM\_\{t\}
17:endwhile

18:return

MtM\_\{t\}

Table 8:Settings of FlexA\-Mem, with tokens counted by the o200k tokenizer\.Table 9:Query of each operation\. For seeds, task\+\+newest unit is the normalized sum of their embeddings\. BM25 uses the content words of the query\.The agent and the reader use medium reasoning effort, and memory calls use low effort\. Embeddings come from all\-MiniLM\-L6\-v2, and tokens are counted with the o200k tokenizer\. On LongMemEval the reader receives the benchmark’s Chain\-of\-Note reading prompt\([Wu et al\., 2025a](https://arxiv.org/html/2610.33274#bib.bib54);[Yu et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib55)\)with the memory in place of the history, and the query is the question\. On the agentic tasks the context holds the system prompt and the task, a message with the memory, and the recent window as the original messages\. The recent window is the longest run of newest units within a quarter of the budget and always contains the newest unit\. The query embedding is the normalized sum of the embeddings of the task and of the newest unit\. On agentic tasks the pieces of an excerpt are ranked against the newest unit alone, because the task text stays the same for the whole episode and would pull every excerpt toward the same pieces\. Table[9](https://arxiv.org/html/2610.33274#A1.T9)lists the query of each operation\. Memory starts at the first call that would exceedB¯\\bar\{B\}, and below it every method passes the history through unchanged\.

On agentic tasks merged records persist for the whole episode, and merges are sized by the larger of the current allowance and a reference allowance computed with a full recent window\. When the newest unit alone takes more than a quarter of the budget, the current allowance falls below the reference, and the oldest records are hidden for that call only\. The prompt for a merged record asks for at most 120 words, and longer outputs are cut at 150\.

Ties in the BM25 ranking go to the cosine similarity between the piece and the query and then to the earlier piece\. BM25 usesk1=1\.2k\_\{1\}=1\.2andb=0\.75b=0\.75, treats the query as a set of lower\-cased content words, and removes stop words and markup on both sides\. Pieces never cross a turn or an output block\. A kept piece that does not begin its turn or block is labeled with its speaker, or with its step number and the first line of its command\. Pieces are cut at the first call after a unit is written, embedded when the unit is first excerpted, and reused at every later call\.

Piece recovery shows the timeline first within its share of the allowance, with merges sized as in unit recovery, and a timeline shorter than its share lends the rest to the pieces\. Pieces are ranked as in piece retrieval, by BM25 over the content words of the query with ties broken by embedding similarity and then by position\. They follow the timeline under a one\-line header, grouped by unit in time order with marks for omitted text\. The query is the question on LongMemEval and the task with the newest unit on the agentic tasks\. If joining the pieces pushes the memory past the allowance, it is rendered again with fewer pieces\. The control with random candidates makes every unit a candidate in a random order seeded by a hash of the query, and its excerpts keep the best matches to the query\.

## Appendix BExperiment Details

We test paired differences with the exact McNemar test on per\-item outcomes\. Confidence intervals of differences come from a paired bootstrap with 10,000 resamples, over questions on LongMemEval, over scenarios on AppWorld, over repositories on SWE\-bench and over conversations on LoCoMo\. The word significant in the text refers to an uncorrected test atp<0\.05p<0\.05, except for the predictions fixed in advance, which are Holm\-corrected\. We tested every paired difference in Tables[2](https://arxiv.org/html/2610.33274#S5.T2)and[5](https://arxiv.org/html/2610.33274#S5.T5)and in Figure[4](https://arxiv.org/html/2610.33274#S6.F4)a\. In Table[2](https://arxiv.org/html/2610.33274#S5.T2)the leads with 150 steps and in the second runs at 4k and 6k are significant\. Table[17](https://arxiv.org/html/2610.33274#A6.T17)stars the significant changes of Table[5](https://arxiv.org/html/2610.33274#S5.T5), and Table[11](https://arxiv.org/html/2610.33274#A5.T11)stars the significant gaps of Figure[4](https://arxiv.org/html/2610.33274#S6.F4)a, which the figure marks in the same way\. Stars in the appendix tables markp<0\.05p<0\.05\. Differences are computed from paired counts before rounding\. On LongMemEval the primary judge agrees with the second on 96\.2% to 99\.0% of the answers in each of the 38 settings of method and budget scored on all 500 questions\.

Table[1](https://arxiv.org/html/2610.33274#S4.T1)reports completion on the 168 Test\-Normal and 417 Test\-Challenge tasks of AppWorld, the resolve rate on the 95 selection issues and all 480 issues of SWE\-bench Verified at 8k, accuracy on the 440 held\-out LongMemEval questions under the primary judge, and accuracy \(J\) on the 1,540 LoCoMo questions of categories 1 to 4\. Column heads give budgets in tokens, full history has no budget, a dash marks a setting that was not run, and masking is observation masking\. Masking does not apply to LongMemEval and LoCoMo, whose conversations hold no tool observations to mask\. Masking \+ rule log keeps the recent actions of observation masking, turns older outputs into rule\-written outcome lines and keeps a rule\-written log of the steps that no longer fit, with no LLM call, and it ran separately on both AppWorld test sets\. Owing to compute cost, the remaining baselines were evaluated on the 95\-issue subset of SWE\-bench only, and AFM was not run on SWE\-bench\. Some AppWorld results in Table[1](https://arxiv.org/html/2610.33274#S4.T1)come from runs other than the main run\. On both test sets these are ReadAgent, AFM and masking with a rule log, on Test\-Normal also Summary\+A\-Mem, MemGAS and Sculptor, and on Test\-Challenge also unit retrieval and piece recovery\. Piece recovery on Test\-Normal and on the 95 SWE\-bench issues comes from a separate run with its own unit\-recovery control, which Table[11](https://arxiv.org/html/2610.33274#A5.T11)compares\. AFM uses its better setting on each benchmark, the paper thresholds on AppWorld and thresholds calibrated on the 60 LongMemEval development questions and on one LoCoMo conversation\. Table[3](https://arxiv.org/html/2610.33274#S5.T3)uses the 147 tasks of AppWorld’s Train and Dev sets, timeline only is FlexA\-Mem without recovery, and steps are per episode\. Timeline only in Table[1](https://arxiv.org/html/2610.33274#S4.T1)is the arm without recovery of Table[5](https://arxiv.org/html/2610.33274#S5.T5), a separate run on AppWorld and SWE\-bench, and its LongMemEval values follow from the paired counts of that table\. On LoCoMo it comes from the run of Table[1](https://arxiv.org/html/2610.33274#S4.T1)\. On LoCoMo, J is the share of answers that Claude Sonnet 4\.6 judges correct with the judge prompt of Mem0\. Table[14](https://arxiv.org/html/2610.33274#A5.T14)counts tokens on both AppWorld test sets at 4k, on the 95 SWE\-bench issues \(SWE\) at 8k and on the 440 held\-out LongMemEval questions \(LME\) at 8k, and FlexA\-Mem uses unit recovery\. Each LongMemEval question has its own history, and on LongMemEval piece recovery costs within 0\.2k tokens of unit recovery\.

Table[5](https://arxiv.org/html/2610.33274#S5.T5)covers AppWorld Test\-Normal, the 95 SWE\-bench issues and the 440 held\-out LongMemEval questions\. Each row is compared with its own control\. On LongMemEval the control of every row is the first row, the run of Table[1](https://arxiv.org/html/2610.33274#S4.T1), which is also the in\-run control of the render controls\. On AppWorld and SWE\-bench the first row is a separate run of the full method, and it is the control of the rows without the timeline, without recovery and without links\. The row without excerpts is compared with the run of Table[1](https://arxiv.org/html/2610.33274#S4.T1)\. Random candidates is compared with its own control run, which completes 65\.5% and 75\.6%, and the other render controls with a control in their own run, which completes 63\.7% and 78\.6%\. A\-Mem with fit\-or\-degrade is compared with A\-Mem, in the same run on AppWorld \(22\.0% and 47\.0%\) and with the A\-Mem run of Table[1](https://arxiv.org/html/2610.33274#S4.T1)on LongMemEval\. Random candidates makes every unit a candidate in a random order, the next row shuffles only the relevant candidates, the next shows the same selection after the timeline, and fixed\-length recovery gives every candidate an excerpt instead of the highest resolution that fits the room\.

In Figure[7](https://arxiv.org/html/2610.33274#A5.F7), ReadAgent and AFM on both AppWorld test sets and Summary\+A\-Mem on Test\-Normal come from separate runs, and in Figure[5](https://arxiv.org/html/2610.33274#S6.F5)so do Summary\+A\-Mem, Sculptor and MemGAS\. Figure[4](https://arxiv.org/html/2610.33274#S6.F4)a plots the pairs of Table[11](https://arxiv.org/html/2610.33274#A5.T11), and Figure[4](https://arxiv.org/html/2610.33274#S6.F4)b groups the held\-out LongMemEval questions by the rank at which BM25 with the bare question places the best piece of the evidence\. In Table[11](https://arxiv.org/html/2610.33274#A5.T11)the last column gives units minus pieces and the number of items that only unit recovery or only piece recovery solves\. Test\-Normal, the 95 SWE\-bench issues and LoCoMo pair two arms of one run, and Test\-Challenge and LongMemEval pair separate runs\. In Table[12](https://arxiv.org/html/2610.33274#A5.T12), SS is single\-session, update is knowledge update, and abstention questions also count in their own type\.

In Table[4](https://arxiv.org/html/2610.33274#S5.T4)GPT, Gemini and Haiku are GPT\-5\.4 mini, Gemini 3\.1 Pro and Claude Haiku 4\.5, and the colors leave out the version without excerpts\. GPT\-5\.4 mini writes the memory in every case, FlexA\-Mem uses unit recovery, the answers of Claude Haiku 4\.5 are judged by GPT\-5\.4, and rows run with only one model are left out\. In Table[13](https://arxiv.org/html/2610.33274#A5.T13), Full is the full history, w/o exc\. is FlexA\-Mem without excerpts, Base is the mean of observation masking, piece retrieval and truncation, and the memory is the mean of FlexA\-Mem and its version without excerpts\. GPT\-5\.4 mini averages two runs\. In Table[2](https://arxiv.org/html/2610.33274#S5.T2)the gap is an absolute difference in %, the rows with 150 steps use 56 tasks, and without network access only FlexA\-Mem and its version without excerpts were rerun on the 95 issues\. In Table[6](https://arxiv.org/html/2610.33274#S6.T6)the first two rows share a run, as do the two rows with Claude Haiku 4\.5, and no row uses excerpts\. The row with masking comes from its own run, which keeps the recent actions of observation masking and turns older outputs into rule\-written outcome lines\. In Table[7](https://arxiv.org/html/2610.33274#S6.T7), recall covers 22 questions about earlier events, and hit rate and balanced accuracy cover 307 questions that ask whether the agent displayed a given file\.

In Table[15](https://arxiv.org/html/2610.33274#A5.T15), raw text first gives raw text to every candidate that fits before any excerpt, and memory evolution lets an LLM choose the links and rewrite the notes of neighbors in FlexA\-Mem without excerpts\. Table[10](https://arxiv.org/html/2610.33274#A5.T10)uses AppWorld Test\-Normal, with thresholds of 0\.45 and 0\.25 in the paper setting and 0\.30 and 0\.15 after calibration\. Figure[6](https://arxiv.org/html/2610.33274#S6.F6)uses all 500 LongMemEval questions\. Figure[8](https://arxiv.org/html/2610.33274#A5.F8)wraps long lines and removes the user’s name and email\.

Several further details of the design and the runs bear on the results\. We chose the excerpt length on the 60 development questions of LongMemEval with their evidence labels, and the query for ranking pieces on agentic tasks on the 95 SWE\-bench issues used for selection\. In the render control that shows the selection after the timeline, the added header changes the selection in 10\.8% of the renders\. AFM is our reproduction from its paper, and its calibrated thresholds were chosen on development data\. Two runs of the timeline alone differ by 7\.1% at 6k on Test\-Normal, and two runs of FlexA\-Mem differ by 5\.3% on the 95 SWE\-bench issues\. The budget is enforced on our own token count, and on the 95 SWE\-bench issues the provider billed more than the budget on 8\.9% of the calls of FlexA\-Mem that used memory\. Rerunning the five episodes that held most of these calls with 85% of the budget removed every such call and left the number of resolved issues unchanged\. The SWE\-bench agents could reach the internet, and without network access both FlexA\-Mem and its version without excerpts lose 4% to 5%\. On LongMemEval each history serves a single question, and the tokens of memory construction are never shared across questions, and each merged record costs an LLM call at read time\.

## Appendix CBaselines

A\-Mem\([Xu et al\., 2025a](https://arxiv.org/html/2610.33274#bib.bib4)\)follows the original prompts for note construction, link generation and memory evolution\. Each note is indexed by its metadata and by its raw text in spans of 150 tokens\. At read time A\-Mem’s search order is kept, and raw notes are taken while they fit and shown in time order\. Summary\+A\-Mem adds a running summary written with the summarizing prompt of OpenHands and MemGym\([Wang et al\., 2025c](https://arxiv.org/html/2610.33274#bib.bib34);[Xu et al\., 2026b](https://arxiv.org/html/2610.33274#bib.bib22)\), extended with an instruction to keep names, numbers, identifiers, paths and error messages\. The summary takes its share of the allowance and lends what it does not use to retrieval\. On LongMemEval it is built once over the whole history before the question is seen\. On agentic tasks it is updated as units leave the recent window\.

MemGAS\([Xu et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib9)\)keeps every unit as raw text, as turns or steps, as an LLM summary and as LLM keywords\. It links units with a Gaussian mixture over their similarities, weights the granularities per query, ranks units with personalized PageRank and passes them through one LLM filter\. Sculptor\([Li et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib28)\)shows each unit as a fragment that the model can summarize, fold, restore or search through the paper’s tools, with the tool schemas counted against the budget\. ReadAgent\([Lee et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib42)\)writes one gist per unit and lets one LLM call per question, or per agent call on SWE\-bench, choose the units whose raw text replaces their gists\. MemGAS, Sculptor, ReadAgent and AFM are our implementations from their papers\. They run under the same harness, budgets, agent or reader model and judges as the other methods, and they reuse the prompts written for SWE\-bench and LongMemEval on the other agentic and conversational benchmarks\.

Piece retrieval and unit retrieval make no LLM call\. Unit retrieval ranks raw units by the best embedding similarity of their spans of 150 tokens and shows the units that fit in time order\. Piece retrieval ranks the pieces of every unit by BM25 and shows the best pieces that fit, grouped by unit in time order with marks for omitted text\. Observation masking\([Lindenbauer et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib36)\)replaces tool outputs older than the last ten steps with a placeholder once the context would exceedB¯\\bar\{B\}, and masks more steps while the context still exceeds it\.

## Appendix DAdditional Related Work

Several memories fix the unit or the tier of detail when they write\. SeCom shows that turn, session and summary units each fall short and builds segment units denoised by prompt compression\([Pan et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib8)\), yet it commits to one granularity at write time\. MemoryOS moves dialogue from a short\-term queue into mid\-term segments and a long\-term store, each with its own budget\([Kang et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib10)\), and recursive summarization keeps one rolling summary of a long dialogue\([Wang et al\., 2025b](https://arxiv.org/html/2610.33274#bib.bib15)\)\. GAM keeps a memo per session and the raw sessions as pages, and an LLM researcher plans, searches and reflects over them at read time\([Yan et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib14)\), which raises its serving time to 12\.43 seconds against 0\.52 for A\-Mem in that paper\. EdgeMem keeps the original turns and builds its index without a generative LLM call\([Cui et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib18)\), but units outside the retrieved set stay invisible\. FlexA\-Mem keeps the raw text of every unit, a trace of every unit in the timeline, and a rule that chooses the resolution without an LLM call\.

Other work argues for keeping raw text instead of rewriting it\. Repeated consolidation by an LLM turns useful memories faulty, which leads its authors to treat raw episodes as evidence\([Zhang et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib17)\)\. Compactors keep on average 17% of injected constraints, and most do worse than no compaction\([Wang et al\., 2026c](https://arxiv.org/html/2610.33274#bib.bib53)\)\. Under compression agents also call retrieval tools far more often, 63\.9 times against 21\.0 in one study\([Liu, 2026](https://arxiv.org/html/2610.33274#bib.bib51)\)\. These findings motivate writing each unit once and recovering its exact text when a call needs it\.

Agents can also manage their context themselves\. Memex\(RL\) and GCC let the agent read raw experience back through an exact key or a context command\([Wang et al\., 2026b](https://arxiv.org/html/2610.33274#bib.bib26);[Wu et al\., 2025b](https://arxiv.org/html/2610.33274#bib.bib27)\), and Pichay restores an evicted tool output only after the agent issues the same call again\([Mason, 2026](https://arxiv.org/html/2610.33274#bib.bib44)\)\. Other agents are trained to edit or condense their own context\([Zhang et al\., 2026b](https://arxiv.org/html/2610.33274#bib.bib31);[Liu et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib32)\), and AgeMem learns one memory for short and long horizons with reinforcement learning and tool actions\([Yu et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib20)\)\. Recovery then depends on an action of the agent, whereas FlexA\-Mem recovers by a fixed rule before every call\.

Coding agents compact their history to fit the budget\. SWE\-agent replaces old observations with one\-line placeholders\([Yang et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib33)\), the OpenHands condensers mask, truncate or summarize\([Wang et al\., 2025c](https://arxiv.org/html/2610.33274#bib.bib34);[Wang et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib35)\), and ACON optimizes the guidelines of an LLM compressor\([Kang et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib37)\)\. Observation masking matches LLM summarization at about half the cost on SWE\-bench Verified\([Lindenbauer et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib36)\), but the removed content cannot return, and repeated compaction erodes even the rules an agent was told to keep\([Zerhoudi et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib50)\)\. Other methods reduce what the agent reads\. LLMLingua and LLMLingua\-2 drop tokens from a single prompt\([Jiang et al\., 2023](https://arxiv.org/html/2610.33274#bib.bib39);[Jiang et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib40);[Pan et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib41)\), AttnCompress keeps a fixed share of each observation as verbatim blocks\([Zeng et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib43)\), and AgentDiet removes 39\.9% to 59\.7% of input tokens by reducing trajectories\([Xiao et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib38)\)\. Fewer tokens need not mean a lower bill, and one study finds that cutting tool\-output tokens raised the billed cost of the agent\([Weinberger and Hozez, 2026](https://arxiv.org/html/2610.33274#bib.bib52)\)\. We count every call and every memory construction in tokens per task\. Unlike these methods, FlexA\-Mem never removes the raw text of a unit from its store\.

Among other benchmarks, LoCoMo tests very long conversational memory\([Maharana et al\., 2024](https://arxiv.org/html/2610.33274#bib.bib60)\), and SWE\-rebench collects fresh issues for decontaminated evaluation of coding agents\([Badertdinov et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib61)\)\. MemGym offers a long\-horizon memory environment\([Xu et al\., 2026b](https://arxiv.org/html/2610.33274#bib.bib22)\)\.

## Appendix EAdditional Results

### E\.1Confirmation Fixed in Advance

The 147 AppWorld Train and Dev tasks had not been used by any run, analysis or design decision, and the agent’s prompt holds no demonstrations\. Before the first episode we froze the code, the six arms of Table[3](https://arxiv.org/html/2610.33274#S5.T3), the two budgets and five predictions\. FlexA\-Mem with unit recovery was predicted to lead Summary\+A\-Mem at 4k and at 6k, to lead the timeline alone at 6k, and to be no more than 5% below piece recovery at 4k and at 6k\. The first three were tested with one\-sided exact McNemar tests and the last two with a non\-inferiority test on a bootstrap over scenarios, with Holm correction over all five\. The adjusted p\-values are 0\.006, 0\.061, 0\.345, 0\.0005 and 0\.024 in that order\. Power computed beforehand from Test\-Normal was 0\.36 for the lead over Summary\+A\-Mem at 6k and 0\.50 for the lead over the timeline alone\. One episode imported AppWorld’s internal modules, and it was rerun with the frozen code\.

### E\.2Results by Budget

Figure 7:\(a\) LongMemEval accuracy on 440 held\-out questions\. \(b, c\) AppWorld completion rate at 4k \(filled\) and 6k \(open\)\. Dashed lines mark the full history\.Figure[7](https://arxiv.org/html/2610.33274#A5.F7)plots the results of Table[1](https://arxiv.org/html/2610.33274#S4.T1)by budget\. On LongMemEval piece recovery leads every memory built by an LLM at 4k and 8k, and the gaps shrink as the budget grows\. On AppWorld the lead of FlexA\-Mem over the second\-best method is largest at 4k on Test\-Challenge, 11\.5%, and smallest at 4k on Test\-Normal, 2\.4%\.

### E\.3AFM and LoCoMo

Table 10:AFM with its paper and calibrated thresholds, against FlexA\-Mem with unit recovery\.We reproduce AFM from its paper\. A unit’s score multiplies the best embedding similarity of its spans with the query, a recency term with a half\-life and an LLM importance label, and two thresholds map the score to a full, compressed or placeholder form\. Units are packed oldest first, each falls back to the next form when it does not fit, and an LLM compresses a unit to about 100 tokens once\. The prompts and the compression target are our choices\. The paper set its thresholds for another embedder, and with ours the median score is 0\.21 while the full\-text threshold of 0\.45 lies above the 99th percentile\. For this reason we compared four threshold pairs on one LoCoMo conversation with a rule fixed in advance, the highest mean accuracy over the three budgets, and chose 0\.30 and 0\.15, which reach 52\.6 against 43\.0 for the paper’s values\.

On LongMemEval the histories score lower, and we compared the paper’s thresholds with three pairs on the 60 development questions by mean accuracy over the four budgets, which chose 0\.15 and 0\.07 \(74\.2 against 32\.5 for the paper’s values\)\. Five threshold pairs were tried in all\. On the 440 held\-out questions AFM then reaches 37\.5, 58\.9, 75\.5 and 76\.6 from 4k to 32k, against 33\.2 to 34\.1 with the paper’s thresholds\.

Which AFM setting works better depends on the benchmark \(Table[10](https://arxiv.org/html/2610.33274#A5.T10)\)\. Calibration raises AFM on LoCoMo by about 14% and 16% at 4k and 8k, but lowers it on AppWorld\. There more units pass the lower thresholds, the full units fill the room, and oldest\-first packing drops 4\.4 of the newest units per call at 4k against 2\.3 with the paper’s values\. FlexA\-Mem with unit recovery leads both settings on both benchmarks\. Against the better setting it outperforms AFM by 8\.9% and 6\.0% on AppWorld and by 7\.5%, 5\.2% and 13\.1% on LoCoMo\. Without the conversation used for calibration, AFM reaches 45\.2%, 60\.3% and 63\.2% on LoCoMo, and FlexA\-Mem still leads by 7\.7%, 4\.5% and 11\.6%\.

On LoCoMo each session forms one unit, and every memory is built once per conversation without its questions\. The timeline alone reaches 40\.3, 63\.8 and 67\.8 at 2k, 4k and 8k, and A\-Mem with fit\-or\-degrade 47\.8, 57\.1 and 69\.1, close to A\-Mem, because a LoCoMo session usually fits whole\. Memory construction costs 35\.3k tokens per conversation for FlexA\-Mem, against 189\.2k for A\-Mem and 211\.9k for Summary\+A\-Mem\.

### E\.4Recovery Modes in Detail

BenchmarkBudgetUnitsPiecesUnits−\-piecesTest\-Normal4k65\.558\.3\+\+7\.1 \(23/11\)6k75\.670\.8\+\+4\.8 \(23/15\)Test\-Challenge4k40\.330\.2\+\+10\.1∗\(67/25\)6k62\.452\.8\+\+9\.6∗\(80/40\)SWE\-bench8k70\.564\.2\+\+6\.3 \(9/3\)LongMemEval4k69\.578\.0−\-8\.4∗\(33/70\)8k75\.081\.6−\-6\.6∗\(25/54\)16k81\.485\.0−\-3\.6∗\(21/37\)32k86\.185\.7\+\+0\.5 \(23/21\)LoCoMo2k52\.569\.9−\-17\.4∗\(133/401\)4k65\.273\.2−\-8\.1∗\(135/259\)8k75\.778\.1−\-2\.4∗\(125/162\)Table 11:Unit and piece recovery paired by task or question\.∗marksp<0\.05p<0\.05\.Table 12:Unit and piece recovery by LongMemEval question type at 4k and their gap at each budget\.Piece recovery leads on most question types at 4k, by the most on temporal reasoning with 17\.1% \(Table[12](https://arxiv.org/html/2610.33274#A5.T12)\)\. Unit recovery leads on questions about what the assistant said, on preference questions and on the abstention questions\. On LongMemEval the two modes cost the same, within 0\.2k tokens per question, because piece recovery reuses the notes and merged records that unit recovery writes\.

The two modes also reach different evidence\. At 4k piece recovery alone shows part of every evidence turn for 106 questions and wins 54 of the 56 decided there, and unit recovery alone does so for 21 questions and wins 12 of 13\.

Piece retrieval and unit recovery fail on different questions\. At 8k piece retrieval shows 86\.4% of the held\-out evidence turns of LongMemEval verbatim, against 77\.4% for unit recovery\. On the 82 of all 500 questions where piece retrieval shows only part of the evidence or none of it, unit recovery answers more often\. It is correct on 56\.9% against 41\.4% where piece retrieval shows part of the evidence, and on 62\.5% against 37\.5% where it shows none\.

### E\.5Other Agents and Readers

Table 13:Share of the 4k budget loss that the memory recovers on AppWorld Test\-Normal, by agent\.The lead on AppWorld holds with Gemini 3\.1 Pro and Claude Haiku 4\.5 as agents \(Table[4](https://arxiv.org/html/2610.33274#S5.T4)\)\. With Gemini, FlexA\-Mem completes 94\.0% of the tasks, level with the full history at 94\.6%, and outperforms observation masking, the second\-best method with that agent, by 6\.5%\. With Haiku it completes 67\.3% and outperforms observation masking by 8\.9%\. GPT\-5\.4 mini writes the memory in every case, and only the agent changes\.

On LongMemEval, FlexA\-Mem is the most accurate method that writes memory at 8k with all three readers and under both judges\. Excerpts matter more with the two other readers, adding 4\.6% with Gemini 3\.1 Pro \(30 wins, 7 losses\) and 4\.4% with Claude Haiku 4\.5 \(33 wins, 11 losses\) but only 1\.4% with GPT\-5\.4 mini \(22 wins, 15 losses, not significant\)\. At 16k FlexA\-Mem ties A\-Mem and Summary\+A\-Mem with both other readers, with no paired difference above 2\.2%\. The answers of Claude Haiku 4\.5 are judged by GPT\-5\.4, because the primary judge comes from the same model family as Haiku\.

We measure how much of the loss caused by a 4k budget the memory recovers on AppWorld with each agent \(Table[13](https://arxiv.org/html/2610.33274#A5.T13)\)\. The share is the gap between the memory and the mean of three baselines, divided by the gap between the full history and that mean\. The memory recovers 75% of the loss with GPT\-5\.4 mini, 89% with Gemini 3\.1 Pro and 56% with Claude Haiku 4\.5\. The agents differ in how fast their history fills the budget\. The history of GPT\-5\.4 mini passes the 4k budget before its first login in 87\.5% of the episodes, against 53\.6% for Gemini 3\.1 Pro and 57\.1% for Claude Haiku 4\.5\.

On SWE\-bench Verified with Claude Haiku 4\.5 as the agent, no method with a budget comes close to the agent without one, which resolves 72\.6% of the 95 issues\. FlexA\-Mem resolves 61\.1%, against 65\.3% for its version without excerpts and 63\.2% for observation masking\.

### E\.6Token Costs

Table 14:Thousands of tokens per task, memory construction included, at 4k on AppWorld and 8k on SWE\-bench and LongMemEval \(LME\)\.Table[14](https://arxiv.org/html/2610.33274#A5.T14)lists the costs behind Figure[3](https://arxiv.org/html/2610.33274#S5.F3)and the two settings the figure leaves out, Test\-Challenge at 4k and the 95 SWE\-bench issues at 8k\. In the figure FlexA\-Mem on LongMemEval is plotted at the token count of unit recovery, which is within 0\.2k of that of piece recovery\. MemGAS, Sculptor and masking with a rule log have no cost measurement and are left out\.

### E\.7Robustness

Budgets, step limits, repeated runs and issue sets all leave the lead of FlexA\-Mem in place \(Table[2](https://arxiv.org/html/2610.33274#S5.T2)\)\. At 8k on AppWorld it outperforms A\-Mem, the strongest baseline run at that budget, by 7\.7%\. A second run of AppWorld changes the outcome of 15% to 17% of the tasks for FlexA\-Mem and keeps every gap to the rerun baselines significant\. On the 385 SWE\-bench issues not used to choose settings, FlexA\-Mem outperforms observation masking by 1\.8% and Summary\+A\-Mem by 3\.1%\. Resampling the LongMemEval reader at 8k changes 19 of the 440 answers of unit recovery but moves its accuracy by only 0\.2%\.

### E\.8What the Timeline Needs

A trace written by fixed rules keeps most of the benefit of the timeline at 4k, and records written by an LLM matter once there is room \(Table[6](https://arxiv.org/html/2610.33274#S6.T6)\)\. The trace is built from the agent’s actions without an LLM call and completes 61\.3% of the Test\-Normal tasks at 4k against 67\.3% for records written by GPT\-5\.4 mini\. This difference is not significant, and the trace still outperforms observation masking by 25\.6%\. At 6k the trace stays at 61\.3% while the LLM records reach 75\.0%, which gives a significant gap of 13\.7%\.

Recovery also makes the memory tolerant of a weaker writer\. With records from Claude Haiku 4\.5 the timeline alone completes 15\.5% fewer tasks than with records from GPT\-5\.4 mini\. Recovery of raw text closes most of that gap\. The memory written by Haiku then completes 62\.5% of the tasks, 1\.8% below the same memory written by GPT\-5\.4 mini, and within its run recovery adds 10\.7%\.

### E\.9What the Memory Recalls on SWE\-bench

FlexA\-Mem keeps track of what a coding agent has seen nearly as well as the full history \(Table[7](https://arxiv.org/html/2610.33274#S6.T7)\)\. We stop the full\-history trajectories of the 95 SWE\-bench issues at 109 checkpoints and render each memory at 8k\. We then ask the LLM 22 questions about earlier events and 307 questions about whether the agent displayed a given file\. On the second kind FlexA\-Mem reaches a balanced accuracy of 0\.93, against 0\.83 without excerpts, 0\.73 for Summary\+A\-Mem and 0\.61 for A\-Mem\. Observation masking reaches 0\.96, because it keeps every command and hides only old outputs\.

Re\-runs show where the remaining errors come from\. When the agent re\-runs a command whose output has left its context, the memory usually held the right unit but lacked the room to show it\. For FlexA\-Mem without excerpts on the 95 issues, the unit with the earlier output was a candidate for 84\.4% of 1,666 such re\-runs\. In 39\.2% of them its raw text was larger than the room\. Replaying these steps with excerpts shows part of the earlier output in only 5\.8% of them\. In about 70% of the cases where the raw text was too long, the room could not hold an excerpt either\.

### E\.10How the Memory Uses the Budget

As the budget grows, the memory shifts toward raw text \(Figure[6](https://arxiv.org/html/2610.33274#S6.F6)\)\. Excerpts take 7\.4% of the memory’s tokens at 8k and 2\.4% at 32k, raw text grows from 68\.2% to 73\.5%, and records stay near a quarter\. At 8k unit recovery shows 77\.4% of the held\-out evidence turns verbatim against 71\.8% without excerpts, and 11 of its 20 wins over that version come with more evidence shown, against 2 of its 15 losses\.

### E\.11Excerpt Variants and Plug\-ins

Table 15:Excerpt variants and the fit\-or\-degrade plug\-in on 440 held\-out LongMemEval questions\.Shorter excerpts help at 4k and 8k \(Table[15](https://arxiv.org/html/2610.33274#A5.T15)\), whereas giving raw text to every candidate first loses most of the gain at 4k\. Fit\-or\-degrade raises the accuracy of A\-Mem and of the variant with memory evolution by 13\.4% and 13\.9% at 4k and by 5\.7% and 3\.7% at 8k\.

### E\.12A Case Study

```
[u1 · step 3] Inspected API docs for phone.show_contact_relationships and
  Venmo endpoints search_friends, add_friend, remove_friend, and search_users.
  (…)
[u2 · step 4] Queried API docs for three apps. Supervisor APIs include
  show_active_task, complete_task, (…)
[u3 · step 5 · excerpt] Looked up API docs for phone.show_contact_relationships
  and venmo.search_friends/add_friend/remove_friend. (…)
[step 5] output of $ print(apis.api_docs.show_api_doc(app_name=’phone’,
  api_name=’show_contact_relationships’)): [...] (…)
[u4 · steps 6-8] Queried available supervisor, phone, and Venmo APIs. (…)
[u5 · step 9] Looked up API docs for supervisor.show_account_passwords,
  phone.show_contact_relationships, and Venmo friend/user endpoints. (…)
[u6 · steps 10-11] Retrieved supervisor passwords for amazon, file_system,
  gmail, phone, (…) and venmo. (…)
[u7 · steps 12-14 · excerpt] Loaded API docs for phone.login and venmo.login,
  then successfully logged in (…), both returning Bearer access_token
  dicts. (…)
[step 12] assistant: [...]
print(phone_token)
print(venmo_token)
[... 1 block omitted]
```

Figure 8:Memory of FlexA\-Mem at step 16 of an AppWorld task at 4k, verbatim and trimmed\. The excerpt of steps 12 to 14 keeps the code that names the access tokens\.Figure[8](https://arxiv.org/html/2610.33274#A5.F8)shows how unit recovery keeps an AppWorld agent from repeating its setup\. The task is “Reset friends on venmo to be the same as my friends in my phone”\. In the figure, text after a unit label is the record of that unit, text after a step label is a verbatim piece of an excerpt, and long lines are wrapped\. At step 16 with a 4k budget, the newest unit takes 1,571 tokens and leaves 1,712 tokens for memory, which holds five records and two excerpts\. The record of steps 12 to 14 says that both logins returned access tokens but not under which names, and its excerpt keeps the code that printed them\. The agent checks that both tokens still exist, never logs in again, and submits at step 22\. On the same task truncation, A\-Mem and piece retrieval stop at the limit of 60 steps after reading API documentation 74 to 109 times\.

### E\.13Numbers Reported by Other Papers

MethodBackboneSettingReportedReference in the same paperLongMemEvalMemGAS\([Xu et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib9)\)GPT\-4o minireader input cut at 8k and 16k, GPT\-4o judge59\.8, 60\.3full history 50\.6Nemori\([Ma et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib13)\)GPT\-4\.1 mini, GPT\-4o minicontext of 3\.7k to 4\.8k tokens74\.6, 64\.2full context 65\.6, 55\.0LightMem\([Fang et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib16)\)GPT\-4o minino token budget, GPT\-4o mini judge64\.3 to 68\.6A\-Mem 62\.6, full text 56\.8SWE\-bench VerifiedAttnCompress\([Zeng et al\., 2026](https://arxiv.org/html/2610.33274#bib.bib43)\)Gemini 3 Flash200 issues, no token budget71\.5full history 72\.5, masking 67\.5masking\([Lindenbauer et al\., 2025](https://arxiv.org/html/2610.33274#bib.bib36)\)Gemini 2\.5 Flash500 issues, 250 turns, no token budget35\.6raw agent 32\.8, summary 36\.0AppWorld Test\-NormalACON\([Kang et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib37)\)GPT\-4\.1 minicompression from 4,096 history tokens42\.3no compression 35\.7ACON\([Kang et al\., 2026a](https://arxiv.org/html/2610.33274#bib.bib37)\)GPT\-5 chatas above62\.5, 65\.5no compression 66\.7Table 16:Numbers that other papers report in their own settings, not comparable to ours\.Table[16](https://arxiv.org/html/2610.33274#A5.T16)lists numbers that other papers report on our three benchmarks\. Their backbones, judges, splits, harnesses and budgets differ from ours\. Without a budget our agents and reader reach 88\.4% on LongMemEval, 67\.9% on the 480 SWE\-bench issues and 78\.6% and 62\.1% on the two AppWorld test sets, the references of Table[1](https://arxiv.org/html/2610.33274#S4.T1)\.

## Appendix FSupplementary Results

This section gives supplementary results for Sections[5](https://arxiv.org/html/2610.33274#S5)and[6](https://arxiv.org/html/2610.33274#S6), including the complete ablations and the longer form of each analysis\.

Table 17:All variants of Table[5](https://arxiv.org/html/2610.33274#S5.T5), change in completion or accuracy \(%\), where∗marksp<0\.05p<0\.05\. Appendix[B](https://arxiv.org/html/2610.33274#A2)gives the control of each row\.### F\.1Results

#### F\.1\.1Agentic Tasks

FlexA\-Mem with unit recovery completes more AppWorld tasks than every baseline with a budget, and its lead is largest on the harder Test\-Challenge \(Table[1](https://arxiv.org/html/2610.33274#S4.T1)\)\. There it completes 40\.3% of the tasks at 4k and outperforms the second\-best method, ReadAgent, by 11\.5% \(p<0\.001p<0\.001\), and by 7\.7% at 6k \(p=0\.002p=0\.002\)\. At 6k it completes 62\.4% against 62\.1% for the agent with its full history, with no significant difference \(p=1p=1\)\. Test\-Normal is less decisive\. The leads over ReadAgent, 2\.4% at 4k and 6\.0% at 6k, are not significant \(p=0\.64p=0\.64and0\.120\.12\), while the 8\.9% lead over AFM at 4k is \(p=0\.017p=0\.017\)\. At 6k on Test\-Normal FlexA\-Mem comes within 0\.6% of the full history\. A second run of FlexA\-Mem completes 65\.5% and 74\.4% of Test\-Normal \(Appendix[E\.7](https://arxiv.org/html/2610.33274#A5.SS7)\), and two runs of the same arm differ by up to 4\.8%, which is more than the 2\.4% lead\.

SWE\-bench Verified repeats this ordering with smaller margins\. Among the methods run on all 480 issues, FlexA\-Mem resolves 66\.5% and outperforms the second\-best method, observation masking, by 2\.3% and Summary\+A\-Mem by 4\.0%, while Summary\+A\-Mem spends 1,577\.1k tokens per issue against 306\.2k\. On the 385 issues not used to choose settings these leads are 1\.8% and 3\.1%\. A\-Mem, MemGAS, Sculptor and ReadAgent ran only on the 95 selection issues, where FlexA\-Mem resolves 71\.6% against 67\.4% for ReadAgent and observation masking and 69\.5% for the full history\.

#### F\.1\.2Confirmation on Unused Tasks

The AppWorld results hold on the 147 unused tasks, which played no part in the design \(Table[3](https://arxiv.org/html/2610.33274#S5.T3)\)\. Before the first episode we froze the code, six arms, two budgets and five predictions with their tests\. FlexA\-Mem completes 76\.9% of these tasks at 4k and outperforms the strongest baseline, Summary\+A\-Mem, by 12\.2% \(Holm\-adjustedp=0\.006p=0\.006\)\. Its differences from the full history,−\-0\.7% at 4k and\+\+4\.1% at 6k, are not significant\. Three of the five predictions hold after Holm correction, the lead over Summary\+A\-Mem at 4k and non\-inferiority to piece recovery at both budgets \(p=0\.0005p=0\.0005and0\.0240\.024\)\. Two predictions fail\. The 7\.5% lead over Summary\+A\-Mem at 6k givesp=0\.061p=0\.061, and the lead over the timeline alone at 6k is 2\.0% \(p=0\.345p=0\.345\) against 8\.3% on Test\-Normal\. This second miss is the first sign that the timeline does most of the work on AppWorld, which Section[6\.2](https://arxiv.org/html/2610.33274#S6.SS2)examines\.

#### F\.1\.3Fact Recall

Keyword retrieval over the raw history is the strongest simple method for fact recall, and piece recovery keeps pace with it \(Table[1](https://arxiv.org/html/2610.33274#S4.T1)\)\. Piece retrieval, which writes no memory, and piece recovery stay within 0\.7% of each other at every LongMemEval budget, because questions that name their evidence are served well by keyword matching\. Both lead every memory built by an LLM at tight budgets\. At 4k piece recovery answers 78\.0% of the held\-out questions and outperforms A\-Mem by 25\.9% and Summary\+A\-Mem by 27\.3%\. These gaps shrink as the budget grows, and at 32k A\-Mem is the more accurate, 88\.6% against 85\.7%\. On LoCoMo piece recovery leads piece retrieval by 1\.0% to 2\.6% at every budget\. Unit recovery there outperforms every baseline memory built by an LLM, by 6\.2% to 9\.4% over A\-Mem and Summary\+A\-Mem and by 5\.2% to 13\.1% over AFM with calibrated thresholds\. For questions that name their evidence, the value of FlexA\-Mem lies in keeping the raw text verbatim more than in the records that an LLM writes for each unit\.

#### F\.1\.4Cost and Other Models

FlexA\-Mem spends about one seventh to one third of the tokens of A\-Mem and Summary\+A\-Mem per task, whose memory construction includes LLM link generation and memory evolution \(Table[14](https://arxiv.org/html/2610.33274#A5.T14)\)\. On Test\-Normal it uses about as many tokens as truncation and observation masking while completing far more tasks\. The full history costs fewer tokens than FlexA\-Mem in every column, and the savings of FlexA\-Mem are relative to other memories, not to reading the whole history\.

Changing the agent leaves the AppWorld lead in place \(Appendix[E\.5](https://arxiv.org/html/2610.33274#A5.SS5)\)\. With Gemini 3\.1 Pro as the agent, FlexA\-Mem completes 94\.0% of Test\-Normal at 4k against 94\.6% for the full history and 87\.5% for observation masking, and with Claude Haiku 4\.5 67\.3% against 58\.3%\. The lead does not carry over to SWE\-bench Verified with Haiku as the agent, where FlexA\-Mem resolves 61\.1% of the 95 issues against 63\.2% for observation masking and 65\.3% for its own version without excerpts\.

### F\.2Analysis

#### F\.2\.1How the Baselines Fail on AppWorld

In the failure trajectories we analyze, the main failure mode of the baselines on AppWorld is repeating their own setup, not giving wrong answers \(Figure[5](https://arxiv.org/html/2610.33274#S6.F5)\)\. At 4k on Test\-Normal, 23\.8% of the episodes of FlexA\-Mem end at the step limit, against 55\.4% to 85\.7% for every baseline except Summary\+A\-Mem\. When the five baselines of the main run declare a task complete, they are right about as often as FlexA\-Mem, 77\.8% to 85\.0% against 84\.4%\. Of their failures at 4k, 90% are loops in which the agent logs in, lists the APIs and reads their documentation again\. Extra steps do not rescue them\. With 150 steps instead of 60, observation masking, truncation and piece retrieval complete exactly as many tasks as before, whereas FlexA\-Mem rises from 64\.3% to 80\.4%\. On Test\-Challenge at 4k, 47% of the episodes of FlexA\-Mem reach the limit, against 57% for piece recovery, 61% for Summary\+A\-Mem and 84% to 95% for the other baselines\.

ReadAgent and AFM, the two strongest baselines on Test\-Normal, are also the two that keep something of every unit in view\. ReadAgent keeps a gist of every unit and spends 91\.0k memory tokens per episode at 4k against 36\.8k for FlexA\-Mem\. AFM keeps most units as short compressed summaries, but it packs units oldest first and drops 2\.3 of the newest units per call at 4k\. The ablations below test whether the trace of the whole history is what decides completion\.

#### F\.2\.2The Timeline Keeps the Trace

Removing the timeline costs the most on AppWorld \(Table[5](https://arxiv.org/html/2610.33274#S5.T5)\)\. Completion falls by 15\.5% at 4k and 10\.1% at 6k, and on SWE\-bench Verified the agent needs 56\.9 steps per issue instead of 43\.8 while its resolve rate moves by only 1\.1%\. On the unused tasks the timeline alone completes 76\.2% and 79\.6%, within 2\.0% of the full method \(Table[3](https://arxiv.org/html/2610.33274#S5.T3)\)\. Even a trace written by fixed rules from the agent’s actions, with no LLM call, completes 61\.3% of Test\-Normal at 4k against 67\.3% for records written by GPT\-5\.4 mini \(p=0\.15p=0\.15\)\. At 6k it falls 13\.7% behind \(Appendix[E\.8](https://arxiv.org/html/2610.33274#A5.SS8)\)\.

The trace matters where an agent must know what it has already done, and it does little for questions that name their answer\. Without the timeline, LongMemEval accuracy changes by at most 3\.6%, and its one significant effect is a gain of 3\.6% at 8k\. On LoCoMo the timeline alone answers 40\.3% to 67\.8% of the questions from 2k to 8k, below piece recovery at every budget \(Table[1](https://arxiv.org/html/2610.33274#S4.T1)\)\.

#### F\.2\.3Recovery Brings Back the Detail

Recovery decides accuracy when the answer is an exact detail\. On LongMemEval, removing recovery lowers accuracy by 28\.2% at 4k and removing excerpts lowers it by 15\.7%\. Four render controls, each changing one part of unit recovery on the same notes and budget, show that the choice and order of the recovered units decide accuracy there\. Making every unit a candidate in a random order loses 47\.5% at 4k and shuffling the relevant candidates loses 46\.8%, whereas showing the same selection after the timeline changes accuracy by at most 1\.4%\. Fit\-or\-degrade is not the best rule for this task, since giving every candidate an excerpt instead gains 6\.1% and 7\.0% at 4k and 8k\. Excerpts also raise from 0\.83 to 0\.93 the balanced accuracy with which the memory tells whether a SWE\-bench agent displayed a given file \(Appendix[E\.9](https://arxiv.org/html/2610.33274#A5.SS9)\)\.

On AppWorld recovery changes effort more than completion, and no render control changes the completion rate of Test\-Normal significantly\. Unit recovery takes 26\.9 steps per episode on the unused tasks against 32\.2 for the timeline alone at 4k, and 20\.7 against 28\.7 at 6k\. Fixed\-length recovery takes 3\.6 and 5\.0 more steps than fit\-or\-degrade\. Excerpts add 5\.0% on Test\-Challenge at 4k \(p=0\.031p=0\.031\)\. Records from Claude Haiku 4\.5 leave the timeline alone 15\.5% behind, and recovery of raw text then adds 10\.7% on Test\-Normal \(Appendix[E\.8](https://arxiv.org/html/2610.33274#A5.SS8)\)\.

Without a timeline the recovery rule decides the completion rate\. Rendering the notes that A\-Mem writes with fit\-or\-degrade raises Test\-Normal completion by 10\.7% at 4k and 7\.7% at 6k, and LongMemEval accuracy by 13\.4% at 4k\. A\-Mem shows 0\.87 whole notes per call at 4k and leaves much of its allowance empty, because a retrieved step is often longer than the room, whereas fit\-or\-degrade fills that room with about two excerpts\. A\-Mem with fit\-or\-degrade still completes 21% to 33% fewer tasks than FlexA\-Mem\.

#### F\.2\.4When Each Recovery Mode Wins

Each recovery mode leads on the kind of scenario it was set for \(Figure[4](https://arxiv.org/html/2610.33274#S6.F4)a\)\. Unit recovery outperforms piece recovery in all five agentic settings, by 4\.8% to 10\.1%, significantly at both budgets of Test\-Challenge\. Piece recovery leads on LongMemEval by 8\.4%, 6\.6% and 3\.6% from 4k to 16k, and the two tie at 32k\. LoCoMo shows leads of 17\.4%, 8\.1% and 2\.4% from 2k to 8k\. The two modes also differ in where their text appears and in how much room the timeline can borrow \(Limitations\), and these gaps compare two configurations rather than isolate the unit of recovery\.

In the questions we test, the gap between the modes is associated with how well the question names its evidence \(Figure[4](https://arxiv.org/html/2610.33274#S6.F4)b\)\. We measure this by the rank at which BM25 with the bare question places the best evidence piece among the roughly 1,040 pieces of a history\. For the 204 of the 413 held\-out questions with an answer in the history whose evidence ranks first, piece recovery is ahead of unit recovery by 17\.6% at 4k\. Unit recovery is ahead by 26\.5% for the 34 questions whose evidence ranks below twentieth\.

This rank needs the evidence labels, and the runtime signals we tested do not reliably predict the better mode for a single query\. On AppWorld the detail an agent uses next lands among the top five keyword matches with its task and latest steps for 22\.4% of its needs, against 22\.2% under a random order\. None of nine task properties correlates with the gap\. The BM25 score of the best LongMemEval piece has a Spearman correlation of at most 0\.05 in magnitude with the gap at 4k and 8k\. For these reasons we set the mode per task type\.

相似文章

MemFit:面向对话智能体的高效长期记忆系统

arXiv cs.AI

MemFit 是一套面向对话智能体的长期记忆系统:它以只追加的方式将多轮对话逐字保存到存储中,并采用无 LLM 的记忆写入与多路检索机制,在大幅降低记忆构建成本与延迟的同时,在 LoCoMo、MemGallery 和 LongMemEval-S 上取得了当前最优结果。

ETAMem:面向长期对话智能体的异构记忆解耦与对齐

arXiv cs.CL

提出了ETAMem多视角记忆框架,通过解耦异构对话信息并构建Event、Affect、Time三个互补的层次化视图,提升长期对话智能体的记忆检索效果,在LoCoMo和LongMemEval-S上分别实现12.46%和7.96%的相对准确率提升。

MemFold:通过 On-Policy 优化学习用于长上下文个性化的紧凑软记忆

Hugging Face Daily Papers

MemFold 提出一种通过行为优化固定预算软记忆的方法,将查询条件化的文本记忆压缩为 K 个连续向量,并用组相对奖励与置信度门控的 on-policy 蒸馏信号训练读者模型,在 PersonaMem-32K/128K 上取得最佳准确率并向 PrefEval、LongMemEval 迁移。