MemWeaver: Structured Memory Weaving
- MemWeaver is a suite of memory-weaving frameworks that restructure flat memories into hierarchical, graph, and version-aware formats for improved inference and reasoning.
- It enhances performance in personalized generation and long-horizon agentic reasoning by integrating behavioral, cognitive, graph, experience, and passage memory components.
- The approach supports auditable, reversible memory revisions through explicit transactional operations such as replace, obsolete, rollback, and trace for mutable knowledge management.
Searching arXiv for the named MemWeaver paper and closely related memory-weaving works to ground the article with fresh citations. MemWeaver is a name used for several memory-centric research programs rather than a single standardized architecture. Across recent work, it denotes at least three distinct but related formulations: a hierarchical memory for personalized generation from textual interactive behaviors, a hybrid memory for traceable long-horizon agentic reasoning, and a version-aware system for editing explicit memories in Multi-layer MeMo without retraining (Yu et al., 9 Oct 2025, Ye et al., 26 Jan 2026, Li, 23 Jun 2026). Taken together, these formulations treat memory not as a flat retrieval buffer but as a structured substrate for temporal organization, semantic abstraction, provenance, and controlled reuse.
1. Scope of the term and major formulations
The term has been used in multiple technical settings, each centered on “weaving” memory into a form usable by downstream reasoning or generation. In personalization, MemWeaver converts a user’s textual interaction history into a hierarchical memory composed of behavioral memory and cognitive memory (Yu et al., 9 Oct 2025). In long-horizon QA and agentic reasoning, MemWeaver consolidates memory into a tri-layer state comprising graph memory, experience memory, and passage memory (Ye et al., 26 Jan 2026). In the Multi-layer MeMo line, MemWeaver is a version-aware operation layer over explicit correlation matrix memories, supporting replace, obsolete, keep-history, rollback, and trace through transactions of primitive memory edits (Li, 23 Jun 2026).
| Formulation | Core memory form | Reported setting |
|---|---|---|
| MemWeaver for personalized generation | Hierarchical memory with behavioral memory and cognitive memory | LaMP benchmark (Yu et al., 9 Oct 2025) |
| MemWeaver for long-horizon reasoning | Tri-layer memory with graph, experience, and passage memory | LoCoMo benchmark (Ye et al., 26 Jan 2026) |
| MemWeaver for Multi-layer MeMo | Version-aware transactions over explicit memories with V-CMM and T-CMM | Version-aware memory operations (Li, 23 Jun 2026) |
A common misconception is that MemWeaver refers to one canonical architecture. The publication record instead shows a shared design intuition—structured memory weaving—applied to different problem classes.
2. Hierarchical memory from textual interactive behaviors
In personalized generation, MemWeaver is defined as a memory-augmented framework that converts a user’s textual interaction history into a hierarchical memory so that generation models can reason over both concrete past behaviors and abstract long-term preferences (Yu et al., 9 Oct 2025). Its motivating claim is that flat-history retrieval misses two orthogonal dimensions: the temporal evolution of interests and the semantic relationships between disparate activities.
The architecture has two complementary components. Behavioral memory captures concrete, query-specific actions. For a user , MemWeaver constructs a memory graph in which each node corresponds to a behavior with embedding , temporal edges connect chronologically adjacent behaviors, and semantic edges connect behaviors placed in the same K-means cluster. Query-relevant memory is then extracted by a context-aware random walk whose transition score combines semantic relevance, recency, and sequential continuity: with
The walk runs for a fixed number of steps, 10 by default, and the visited nodes form (Yu et al., 9 Oct 2025).
Cognitive memory abstracts long-term preferences. The history is partitioned into temporal phases by semantic breakpoints, then summarized in two stages: local summaries for each segment, followed by a global synthesis 0 over the set of local summaries (Yu et al., 9 Oct 2025). This design gives the model both short-range behavioral evidence and a higher-level narrative of stable traits and evolving interests. Generation is conditioned jointly on the query, the behavioral memory, and the cognitive memory: 1
The implementation is explicitly training-free for generation. Documents are embedded with BGE-M3, clustered with 2 by default, and passed to backbone LLMs including Qwen3-8B and Llama-3.1-8B-Instruct (Yu et al., 9 Oct 2025). On six publicly available LaMP tasks, MemWeaver outperforms Vanilla, Random, Recency, BM25, BGE, ROPG, and CFRAG. Under Qwen3-8B, for example, LaMP-5 reaches ROUGE-1/ROUGE-L 3 versus 4 for CFRAG, and LaMP-3 reaches MAE/RMSE 5 versus 6, with all improvements reported as statistically significant by 7-test with 8 (Yu et al., 9 Oct 2025).
The ablation pattern clarifies the division of labor inside the hierarchy. Removing cognitive memory reduces performance but leaves the system functional, whereas removing behavioral memory causes a severe collapse on context-heavy tasks; the paper reports, for example, LaMP-4 ROUGE-1/ROUGE-L dropping to 9 and LaMP-3 MAE/RMSE worsening to 0 (Yu et al., 9 Oct 2025). This suggests that behavioral memory is the operational retrieval backbone, while cognitive memory provides longer-horizon regularization over user identity and preference evolution.
3. Hybrid memory for traceable long-horizon agentic reasoning
A second MemWeaver formulation addresses long-horizon conversational and agentic reasoning. Its stated goal is to support temporal consistency, multi-hop reasoning, and evidence-grounded reuse across sessions, all while preserving traceability back to verbatim passages (Ye et al., 26 Jan 2026). The central data structure is a tri-layer memory
1
where 2 is a temporally grounded graph memory, 3 is an experience memory, and 4 is a passage memory.
The graph memory is a directed knowledge graph 5 with absolute time normalization and provenance. A relation edge is represented as 6 with metadata 7, where 8 is a normalized absolute time, 9 is an optional condition, and 0 is provenance (Ye et al., 26 Jan 2026). Relative expressions such as “yesterday” and “last week” are resolved into absolute calendar forms using the session timestamp. The graph enforces temporal consistency through precedence constraints on causal edges and conflict detection for overlapping incompatible facts.
The experience memory abstracts recurring patterns across episodes rather than single turns. Experience items are induced from DBSCAN clusters over dialogue-unit embeddings, then validated by an LLM judge for coherence and converted into concise items of type fact, preference, or strategy, each requiring support by at least two source units (Ye et al., 26 Jan 2026). The passage memory stores original dialogue units or chunks with text, speaker, timestamp, and embeddings, preserving verbatim evidence for auditability and correction.
Retrieval is dual-channel. For a query 1, candidate memory items are scored by
2
with graph scoring combining semantic similarity, path relevance, and a temporal alignment penalty, and passage scoring combining semantic similarity with citation strength via structural links to selected triples or entities (Ye et al., 26 Jan 2026). The pipeline first retrieves seed triples from a dense triple index, expands a bounded 3-hop neighborhood—4 by default—filters for temporal conflicts, and then collects linked passages and experiences to assemble compact structured context 5 and textual context 6.
The reported results on LoCoMo are notable because they combine accuracy gains with aggressive context reduction. With a GPT-4o-mini backbone, MemWeaver reaches Multi-Hop F1 7 using 8 input tokens, compared with LoCoMo at 9 using 0 tokens and A-Mem at 1 using 2 tokens; Temporal F1 reaches 3 versus 4 for A-Mem (Ye et al., 26 Jan 2026). With Qwen2.5-1.5B, Multi-Hop F1 is 5 versus 6 for A-Mem, and Temporal F1 is 7 versus 8 (Ye et al., 26 Jan 2026). The paper states that input context is reduced by over 9 compared to long-context baselines, with retrieval time around 0 ms and a total memory footprint of 1 MB (Ye et al., 26 Jan 2026).
Ablations identify the graph memory as the critical component. Removing experience memory reduces performance moderately, while removing graph memory causes severe degradation, including Multi-Hop F1 falling to 2 and Temporal F1 to 3 under GPT-4o-mini (Ye et al., 26 Jan 2026). The implication is that long-horizon reasoning benefits less from generic summarization than from explicit temporal normalization, provenance, and graph-structured composition.
4. Version-aware operations and transaction memories
A third MemWeaver formulation shifts attention from retrieval and reasoning to memory revision. In the Multi-layer MeMo setting, MemWeaver is described as a version-aware system for weaving and revising explicit memories without retraining, built on the MeMo operation layer and two auxiliary correlation matrix memories, a Version CMM and a Transaction CMM (Li, 23 Jun 2026).
The substrate is a stack of correlation matrix memories, where a CMM stores associations by outer products: 4
The exposed primitives are memo(S,y), forget(S,y), and retrieve(S), where 5 is an input sequence and 6 is the associated token or value (Li, 23 Jun 2026). A primitive edit is
7
with 8 denoting memorization and 9 denoting forgetting, and a high-level operation is compiled into an ordered transaction
0
This transaction view is central. A direct replace is
1
while multi-token continuations are decomposed into sequence–token chains: 2 Structured assertions are serialized as
3
allowing versioned replaces over subject–relation slots (Li, 23 Jun 2026).
MemWeaver defines five high-level operations with explicit compilation semantics: replace, obsolete, keep-history, rollback, and trace. Replace updates the latest-view association; obsolete deactivates a current association while optionally tagging status as OBSOLETE; keep-history preserves versioned chains; rollback executes the inverse program
4
and trace reconstructs the lineage of a current answer through versions, transactions, and primitive edits (Li, 23 Jun 2026).
The auxiliary memories separate indexing from executable content. The Version CMM stores mappings from version transitions to transaction handles: 5 while the Transaction CMM stores the fields of a transaction: 6 This decomposition enables auditability, rollback, and template reuse. The evaluation route proposed in the paper includes update success, outdated-current suppression, historical preservation, rollback correctness, trace correctness, locality/non-interference, and transaction reuse (Li, 23 Jun 2026).
This line of work defines MemWeaver less as a retrieval memory and more as an operational memory control plane. A plausible implication is that it targets the problem of mutable knowledge—where facts change and must remain reversible—rather than the problem of selecting static historical context.
5. Relation to adjacent memory-weaving systems
Several adjacent systems articulate design choices that are closely aligned with the MemWeaver idea even when they use different names. ContextWeaver organizes a tool-using agent’s interaction trace into a dependency-structured DAG of reasoning steps, where each node is derived from thought–action–observation triples and parent edges encode causal or logical dependence (Wu et al., 24 Apr 2026). Parent selection is treated as a reasoning problem rather than a similarity lookup, and nodes marked failed or superseded are excluded from future parent selection. On a 100-instance subset of SWE-Bench Verified, the paper reports pass@1 7 for ContextWeaver versus 8 for a sliding window, pass@5 9 versus 0, average steps 1 versus 2, and agent-side token savings of 3 on Verified and 4 on Lite (Wu et al., 24 Apr 2026). The paper also reports that sliding windows remain competitive, and sometimes superior, in short, linear tasks.
MemoBrain advances a related but more explicitly executive notion of memory for tool-augmented agents. It constructs a dependency-aware graph over reasoning steps, prunes invalid or superseded steps through selective flush, folds completed sub-trajectories into summaries, and preserves a salience-based reasoning backbone under a fixed context budget (Qian et al., 12 Jan 2026). On GAIA, WebWalker, and BrowseComp-Plus, MemoBrain improves strong baselines; for example, on GAIA, GLM-4.6 rises from 5 to 6, and on BrowseComp-Plus, DeepResearch rises from 7 to 8 accuracy (Qian et al., 12 Jan 2026). This positions executive memory as active control rather than passive storage.
Mem-W transfers the weaving idea from symbolic or textual memory into the latent space of GUI agents. It freezes a GUI backbone 9 and learns only a trajectory-to-latent compressor 0 that converts both retrieved historical trajectories and expired in-session segments into compact memory tokens woven directly into the policy input (Zhang et al., 10 May 2026). With default settings 1, 2, 3, and 4, Mem-W reports large gains on web and mobile navigation benchmarks, including raising UI-Venus-1.5-8B on MMINA from 5 to 6 and reaching Pass@4 accuracy 7 on AndroidControl-v2 Low (Zhang et al., 10 May 2026). The paper’s distinctive claim is representational alignment: memory is stored in the same latent form that the policy consumes.
WeaveLA applies an event-triggered memory hand-off to repetitive robot manipulation. On a frozen 8 backbone, it compresses each completed segment into 9 latent tokens via query-driven attention pooling and routes them directly into the next sub-task’s action-generation path through memory-conditioned AdaRMS (Zhu et al., 16 Jun 2026). Its reported gains are concentrated where cross-subtask causal information matters; on RoboMME’s hardest SwingXtimes slice with 0, success rises from 1 to 2 in the 6-task setting, while single-execution episodes remain unchanged at approximately 3 (Zhu et al., 16 Jun 2026).
These adjacent systems do not define MemWeaver identically, but they converge on a common research direction: preserve structure, expose provenance or causal dependence, and select memory by task relevance rather than by flat similarity or recency alone.
6. Limitations, trade-offs, and open problems
The different MemWeaver formulations inherit different failure modes. In personalized generation, behavioral memory depends on embedding and clustering quality, cognitive memory depends on LLM summarization quality, and overly strong recency or continuity biases can hurt diverse, non-sequential tasks; the paper also notes the risk that long-term summaries may preserve outdated interests unless periodically re-synthesized (Yu et al., 9 Oct 2025). In long-horizon agentic reasoning, time normalization can misresolve ambiguous relative expressions, residual contradictions may persist when evidence is sparse, and induction prompts and clustering thresholds may not transfer directly beyond conversational domains (Ye et al., 26 Jan 2026). In the version-aware MeMo formulation, the method targets local changes expressible as MeMo-compatible associations; dependent transactions may require replay rather than simple inversion, and overlapping contexts can still produce unintended interference despite serialized keys and slot-based execution (Li, 23 Jun 2026).
Related systems sharpen these trade-offs. ContextWeaver reports that branching adds overhead on strictly sequential, localized tasks such as pytest-dev__pytest-7205, where the sliding window wins 4 runs (Wu et al., 24 Apr 2026). Mem-W states that undercompression may drop actionable state while overcompression wastes budget, and that discrete Top-5 retrieval from frozen keys can select off-task trajectories (Zhang et al., 10 May 2026). WeaveLA reports that latent-shift triggers underperform oracle boundaries on purely symbolic timing tasks such as StopCube, and that replacing attention pooling with a Q-Former causes aggregate success to collapse to 6 with 7 timeouts (Zhu et al., 16 Jun 2026).
The broader research question is therefore not whether memory should exist, but what structure it should take. The literature under the MemWeaver name and its close relatives suggests three non-equivalent answers. One answer is hierarchical user modeling, where memory must jointly preserve semantic structure and temporal evolution (Yu et al., 9 Oct 2025). A second is traceable long-horizon reasoning, where memory must unify graph structure, reusable abstractions, and verbatim evidence under severe token budgets (Ye et al., 26 Jan 2026). A third is version-aware explicit memory editing, where memory must support auditable change, rollback, and history preservation without retraining (Li, 23 Jun 2026). The persistence of these distinct formulations indicates that “weaving” is best understood as a design principle—structured integration of memory into inference, reasoning, or update mechanics—rather than as a single fixed algorithm.