Source-linked AI summary

TrawMem: Reframing Agent Memory as Task-Oriented Role-Adaptive Workspaces

Mingyu Zhang, Zixu Li, Zhiheng Fu, Zhiwei Chen, Jinhe Bi, Yupeng Hu

arXiv:2610.36918v1cs.CL

TL;DR

Long interaction histories strain context windows, and relevance alone does not capture how memories support task solving. TrawMem organizes histories into local threads and role-adaptive workspaces, selecting complementary memories for each task. It improves over representative memory systems across two benchmarks and four backbones.

  • Problem

    Long interaction histories strain limited context windows, while query relevance alone does not capture the different roles memories play in solving tasks.

    Source: §1 · p. 2
  • Method

    TrawMem organizes interaction histories into local threads and constructs task-oriented workspaces by assigning roles and selecting complementary memories.

    Source: §1 · p. 2, §9 · p. 26
  • Results

    TrawMem improves macro-average 𝐽score (LLM-Judge) by 2.19–6.34 and 0.52–4.82 percentage points on LoCoMo and MemGallery, with mean gains of +3.71 and +2.94, respectively.

    Source: §1 · p. 2, §9 · p. 26
  • Takeaways & Limitations

    The results suggest that modeling memory roles and relations provides a useful perspective for memory utilization in long-horizon agent tasks.

    Source: §9 · p. 26

    Interaction histories may contain sensitive information or preserve biases, errors, or misinformation, so deployment should include privacy and content safeguards.

    Source: Ethics Statement · p. 26

Abstract

from arXiv · show

Large language model (LLM) agents rely on memory systems to leverage long-term interactions, yet existing systems typically retrieve memories based on their relevance to the current query and use them as contextual evidence. However, relevance alone does not characterize how a memory contributes to task solving: the same memory may serve different roles across tasks, such as directly supporting the answer or linking to complementary memories with weaker semantic relevance but necessary information. We therefore reframe agent memory systems as Task-Oriented Role-Adaptive Workspaces, where memories are selected and organized by their task-oriented roles and relations. Based on this view, we propose TrawMem, which organizes interaction histories into local threads and constructs task-oriented workspaces by assigning roles and jointly selecting complementary memories. Experiments on LoCoMo and MemGallery with four open- and closed-source backbones show consistent improvements over representative memory systems, with macro-F1 gains of 2.23-3.14 points. On LoCoMo, TrawMem improves the LLM-Judge score over SimpleMem by 4.07 and 4.31 percentage points on Qwen3.5-9B and DeepSeek-V4-Flash, respectively, while requiring approximately 12.8% and 5.1% fewer context tokens, respectively.

1. Introduction

Long interaction histories strain context windows and make repeated processing costly, while relevance-based retrieval overlooks how memories contribute different roles to task solving. TrawMem organizes memories into task-oriented workspaces, and its evaluation reports improvements over representative memory systems.

Motivation

  • Growing interaction histories strain limited context windows, and reprocessing the full history for each query incurs substantial inference overhead.Even larger context windows may leave information in less salient positions prone to being overlooked.Source: §1 · p. 2

Background

  • Agent memory systems store information outside the current context and retrieve relevant memories to support new queries.Prior work advances memory construction, maintenance, and retrieval.Source: §1 · p. 2

Motivation

  • Relevance-based systems overlook memory roles: a memory can directly support one task’s answer but connect to complementary memories for another.A complementary memory may have weaker semantic relevance and thus be overlooked by existing methods.Source: §1 · p. 2

Contribution

  • TrawMem reframes agent memory as task-oriented workspaces that organize memories according to their roles and relations.It organizes interaction histories into local threads, then retrieves from relevant thread neighborhoods and selects memories by task-oriented roles.Source: §1 · p. 2

Performance

  • TrawMem improves macro-average 𝐽score (LLM-Judge) by 2.19–6.34 and 0.52–4.82 percentage points on LoCoMo and MemGallery, with mean gains of +3.71 and +2.94, respectively.The evaluation compares representative memory systems across four open- and closed-source backbones.Source: §1 · p. 2

2. Related Work

Prior agent-memory work improves memory construction, maintenance, organization, and retrieval, but generally emphasizes independent units or coarse relevance. TrawMem instead assigns task-oriented roles and selects complementary memories into a workspace.

Memory for LLM Agents

  • Agent-memory research addresses compactness, update efficiency, information extraction, linked notes, and temporal, hierarchical, or multi-type representations.Examples include compression and consolidation (Liu et al., 2026), evolving linked notes (Chhikara et al., 2025), and temporal or hierarchical representations (Kang et al., 2025; Rasmussen et al., 2025; Zhang et al., 2026a; Li et al., 2025a).Source: §2 · p. 3
  • Existing agent-memory methods rarely model how a memory’s role changes across tasks or make complementary-memory selection central to retrieval.TrawMem assigns task-oriented roles to candidates and selects memories to form a task-oriented workspace.Source: §2 · p. 3

Retrieval-Augmented Generation

  • RAG methods use query planning, iterative retrieval, compositional reformulation, or entity-relation structures, but typically rely on a preconstructed knowledge base.TrawMem instead organizes interactions into local threads and constructs task-oriented workspaces through role assignment and coverage-based selection.Source: §2 · p. 3

3. Preliminary

Agent memory systems represent interaction records as reusable units, retrieve task-relevant content, and provide it to an answering model. TrawMem’s architecture first organizes histories into threads and then forms a task-oriented workspace.

Agent Memory Systems

  • Agent memory systems organize interaction records into reusable units, which may be turns, summaries, facts, or events, using vectors, graphs, or hierarchies.They select task-relevant content from the memory bank and provide it to the answering model.Source: §3 · p. 3

Problem Formulation

  • The general memory-augmented QA pipeline constructs memory representations from interaction history, retrieves query-relevant context, and generates an answer.M denotes the history-derived memory representation, C_q the context retrieved for query q, and A_θ the answering model.Source: §3 · pp. 3–4

Architecture

  • TrawMem’s architecture organizes interaction history into threads and a thread graph, then selects and organizes memory units from task-relevant neighborhoods into a workspace.The two stages are specified in the Figure 2 caption.Source: Figure 2 · p. 4

4. Methodology

TrawMem first organizes interaction histories into linked local threads, then uses task-specific roles and relations to select complementary memories for a workspace. Query-relevant thread neighborhoods bound the candidates, and role-guided, coverage-oriented selection assembles the final workspace.

4.1. From Memory to Local Threads

  • Each local thread pairs a concise summary head with ordered memory units, while the thread graph links source-adjacent and semantically close threads for neighborhood access.The ordered units preserve detailed content, contextual order, provenance, and temporal information; the head serves as a retrieval entry point.Source: §4.1 · pp. 4–5

4.2. From Thread Neighborhoods to Workspaces

  • For a query, TrawMem identifies relevant threads, expands their neighborhoods, assigns roles to candidate memories, and selects them into a task-oriented workspace.The method has two stages: organizing histories into local threads and establishing relations, then constructing workspaces from relevant neighborhoods.Source: §4 · p. 4, §4.2 · p. 5

4.2.1. Localizing the Task Context

  • Query-scored threads propagate relevance through the thread graph; high-scoring neighbors form a task-relevant neighborhood subject to hop-count and size limits.Subsequent role assignment and workspace construction are restricted to candidate units collected from that neighborhood.Source: §4.2.1 · p. 5

4.2.2. Task-Oriented Role Assignment

  • Task demands and each memory’s relational features determine its role adaptability, allowing the same memory to receive task-specific role weights.The model maps observable task demands and neighborhood relational features to role scores.Source: §4.2.2 · p. 5

4.2.3. Role-Guided Workspace Assembly

  • Candidate-unit priority combines thread accessibility, query affinity, and role adaptability, with an activation cap and normalization over the candidate set.The effective unit budget sets the per-unit activation cap; normalized priorities are defined when the denominator is positive.Source: §4.2.3 · p. 6
  • A greedy coverage objective adds the memory unit with the largest marginal gain, stopping at the coverage threshold or budget and preserving selected units’ thread heads and order.If all budgeted steps are completed, the selected set has a 1 − 1/e approximation guarantee.Source: §4.2.3 · p. 6

5. Experiments

Experiments evaluate TrawMem on LoCoMo and MemGallery across four answer backbones, then examine component contributions, parameter sensitivity, and query-dependent role changes. TrawMem leads across the reported benchmarks, while the analyses show how workspace structure and memory roles relate to performance.

5. Experiments

  • Experiments process conversations chronologically, use Qwen3-Embedding-0.6B for vector representations, and evaluate four answer backbones on LoCoMo and MemGallery.LLM-Judge uses the same backbone as answer generation; LoCoMo covers four question categories, while MemGallery covers nine.Source: §5 · pp. 7–8

5.1.1. Results on LoCoMo.

  • TrawMem achieves the highest Average F1, B-1, and J scores across four LoCoMo question types and all four backbones.On Qwen3.5-9B, its scores are 39.14/36.75/63.26, exceeding the second-best baseline by 2.23, 3.71, and 3.30 points, respectively.Source: Table 1 · p. 7, §5.1.1 · p. 8

5.1.2. Results on MemGallery

  • TrawMem achieves the highest Average F1, B-1, and J scores across all four MemGallery backbones.Against each backbone’s second-best baseline, its gains are 0.30–5.45, 1.36–2.96, and 0.52–4.82 percentage points for F1, B-1, and J, respectively.Source: Table 2 · p. 8, §5.1.2 · pp. 8–9

5.2. Ablation Study

  • All six ablated components contribute to performance, with removing multi-thread selection causing the largest drops on both datasets.No Multi-thread drops |ΔJ| by 1.86–2.62 on LoCoMo and 1.91–3.13 on MemGallery; Fixed Seg. and Seed-only also reduce performance, with Fixed Seg. generally worse.Source: §5.2 · p. 9, Figure 4 · p. 9, Figure 5 · p. 9
  • Role conditioning and structured coverage improve local selection, with removing role conditioning generally causing a larger drop than removing Identity K.The authors interpret these components as helping select complementary rather than redundant information.Source: §5.2 · p. 10

5.3. Parameter sensitivity

  • Parameter sensitivity is moderate: weight optima vary slightly by backbone, while an evidence budget of 16 gives the highest J across all four backbones.Performance decreases when the budget is too small or too large; the authors attribute this to omitted necessary information or added less relevant or redundant memories.Source: §5.3 · p. 10, Figure 6 · p. 10

5.4. Query-Dependent Role Changes

  • Across 356 paired queries, anchor weight trends downward and bridge weight upward, while context weight has no consistent overall direction.The authors report that the same memory’s role shifts between directly supporting an answer and connecting other records according to the query.Source: §5.4 · p. 11, Figure 7 · p. 11

5.5. Workspace Compression

TrawMem compresses candidate memories into small workspaces while retaining complementary facts and records from multiple threads. In paired answer comparisons, it outperformed FullText and NaiveRAG on judge accuracy.

5.5. Workspace Compression

  • Across all queries, the mean candidate and selected memory units were 144.8 and 15.4, respectively, with a mean per-query unit-count reduction of 89.2%.Source: §5.5 · p. 12

5.6. Information Complementarity under a Memory Budget

  • Across most budgets, TrawMem retained more distinct relevant facts than Top-B Relevance while accumulating fewer redundant mentions.The advantage became more pronounced as the budget grew; at very small budgets coverage was similar, while Random had less redundancy but captured fewer useful facts.Source: §5.6 · pp. 12–13, Figure 9 · p. 13

5.7. Memory-Context Length and Retrieval Cost

  • Mean memory context was 2,216 tokens (95th percentile 2,516), while median retrieval took 3.57 seconds (95th percentile 7.12).Context measurements exclude answering instructions and generated answers; retrieval-time statistics describe the observed run and do not establish equivalent token or latency savings from reducing units.Source: §5.7 · p. 13, Figure 10 · p. 14

5.8. Cross-Thread Composition of Workspaces

  • Workspaces averaged 15.36 selected units from 10.54 threads, with 5–16 threads represented and 1.53 units contributed per thread on average.The mean thread counts were 11.28 for MultiHop, 10.59 for Temporal, 10.51 for OpenDomain, and 10.28 for SingleHop queries.Source: §5.8 · p. 14, Figure 12 · p. 15

5.9. Paired Comparison of Answer Outcomes

  • TrawMem’s mean judge accuracy was 80.45%, versus 63.70% for FullText and 74.61% for NaiveRAG, gains of 16.75 and 5.84 percentage points.The paired-comparison figure reports conversation-level bootstrap intervals for these gains.Source: §5.9 · p. 14, Figure 11 · p. 15

6. Efficiency Analysis

TrawMem trades additional retrieval time against answer quality, while using less answer context than SimpleMem on both reported backbones. Traversal depth H offers a way to adjust this trade-off.

Traversal-depth analysis

  • On Qwen3.5-9B, reducing H from 3 to 2 or 1 lowered total time by 10.2% or 18.3%, while Answer-context remained approximately 2,050 tok/q.The corresponding J values were 63.26, 61.58, and 59.11; reducing H primarily lowered retrieval cost under the reported settings.Source: §6 · pp. 15–16

Efficiency and answer quality

  • Qwen3.5-9B: TrawMem uses 12.8% fewer Answer-context tokens and raises J by 4.07 points over SimpleMem; DeepSeek-V4-Flash: 5.1% fewer tokens and 4.31 more J points.Total time is higher than SimpleMem for both backbone configurations.Source: §6 · pp. 15–16, Table 3 · p. 16

Traversal-depth analysis

  • In the other reported configuration, reducing H from 3 to 2 or 1 lowered total time to 446.8 or 394.7 s/root, with J values of 65.02 or 62.74.Answer-context remained approximately 2,406 tok/q across the three configurations.Source: §6 · p. 16

Efficiency and answer quality

  • Compared with SimpleMem, TrawMem(H=3) uses less context and achieves higher J on both backbones, but total time increases; versus LightMem it uses more context.The reported comparisons describe a tunable efficiency–quality trade-off.Source: §6 · p. 16

7. Prompts

The appendix prompts specify how TrawMem forms event threads, selects evidence, and generates answers. Separate judge instructions define binary evaluation rules for task types in LoCoMo and Mem-Gallery.

7.1. Event Thread Construction and Evidence Selection

  • Event-thread induction segments contiguous dialogue into evolving situations, preserves exact source-turn identifiers, and assigns each turn to exactly one thread.Threads follow their first source turn; speaker alternation alone is not a reason to split an episode.Source: §7.1 · p. 17
  • The answer generator must ground factual claims in original interaction turns, treating thread heads and role labels as organizational metadata rather than evidence.It also specifies handling for multi-hop, temporal, set-valued, update, preference, visual, and unanswerable questions.Source: §7.1 · p. 17

7.2. LLM-as-Judge

  • The judge sees only the question, reference answer or rubric, and model response; LoCoMo uses binary scores, while Mem-Gallery uses YES or NO.Intermediate states such as thread heads, roles, and retrieval scores are withheld from the judge.Source: §7.2 · p. 17
  • For standard tasks, equivalent paraphrases count as correct, but contradictions, unsupported additions, or omissions of central requested items do not.For complete-set questions, a proper subset is incorrect.Source: §7.2 · p. 17
  • Temporal-task judging checks event dates, periods, ordering, or duration and does not treat a source timestamp as event time without dialogue support.Equivalent date and time formats are accepted when they denote the same value.Source: §7.2 · p. 18
  • Knowledge-update judging requires the latest supported value; an obsolete value is acceptable only if the updated value is also identified correctly..Source: §7.2 · p. 18
  • Personal-preference judging checks whether the response correctly recalls and uses personal information, without requiring every rubric item..Source: §7.2 · p. 18
  • The Mem-Gallery binary judge accepts paraphrases and equivalent date or time formats, but rejects unsupported additions, contradictions, and omitted central items.Visual judgments rely only on image identifiers and captions in the textual input.Source: §7.2 · p. 18

8. Case Study

The case studies illustrate workspaces combining evidence across conversations and time, with all five gold-source turns covered. A date-related failure is attributed to ambiguity in the reference annotation.

Case-study presentation

  • Each case is shown through raw sessions, persistent thread memory, a task-oriented workspace, and answer synthesis; yellow marks identify gold-source turns.Unexpanded selected units are omitted for space, not because they were unselected.Source: §8 · pp. 18–19

Case Analysis

  • Across five cases, workspaces combined repeated statements, relational clues, distant event observations, relationship changes, or location and skill clues; gold-source recall was 1.0.The examples illustrate evidence combinations across conversations and time, including complementary relational information.Source: §8 · p. 19

Failure Case

  • The Harry Potter date case is ambiguous because the dialogue says “last August” without a year, while the reference requires “August 2023.”The passage treats this as a dataset-annotation limitation, not a retrieval failure.Source: §8 · p. 19

9. Conclusion

TrawMem reframes agent memory as task-oriented workspaces, organizing interaction histories into local threads and selecting complementary memories by roles. Experiments show improvements over representative memory systems on LoCoMo and MemGallery across four backbones.

9. Conclusion

  • Experiments on LoCoMo and MemGallery across four backbones show consistent improvements over representative memory systems.Ablations further confirm the contribution of individual components.Source: §9 · p. 26
  • TrawMem organizes interaction histories into local event threads and constructs task-oriented workspaces for agent systems.It establishes relations among threads and assigns task-oriented roles to select complementary memories.Source: §9 · p. 26
  • The results suggest that modeling memory roles and relations is a useful perspective for memory utilization in long-horizon agent tasks.Source: §9 · p. 26

Ethics Statement

The ethics statement notes privacy and content-quality risks from storing and reusing interaction histories, and recommends safeguards for deployment.

Ethics Statement

  • Storing and reusing interaction histories raises privacy concerns because they may contain sensitive personal information.Source: Ethics Statement · p. 26
  • Memories may preserve or amplify biases, errors, or misinformation in user-provided content, potentially leading to undesirable agent behavior.The authors recommend data anonymization, informed consent, and mechanisms to detect and mitigate biased or false memories.Source: Ethics Statement · p. 26

AI Assistance Statement

The authors report using generative AI tools only to polish and clarify the English prose, not to design the method, develop the theory, or conduct experiments.

AI Assistance Statement

  • Generative AI tools were used only for English-language polishing, grammar checking, and improving clarity and exposition.The authors say they reviewed all AI-assisted text and take responsibility for the final paper and its scientific content.Source: AI Assistance Statement · p. 26
Loading 2610.36918v1…