Editor’s introduction
The study examines LEGOMem, a modular procedural memory framework designed for multi-agent large language model systems. It compares memory placement and retrieval strategies across orchestrators and task agents, measuring improvements in task decomposition, planning accuracy, and execution consistency. Results indicate that orchestrator memory is vital for effective task delegation, while fine-grained agent memory boosts execution precision. The research demonstrates that even smaller language models benefit from procedural memory by leveraging past execution traces to improve planning and tool use. A qualitative case study illustrates that without memory, agents fail to complete tasks systematically, such as missing the earliest email in a list. With LEGOMem, agents consistently process and compare all entries, showing improved reasoning and task completeness.
Introduction
Large Language Models (LLMs) are increasingly deployed as agents to automate complex multi-step workflows. These agents are especially valuable in productivity environments such as document editing, email handling, and calendar scheduling. To manage the diversity and compositionality of such tasks, recent systems often adopt multi-agent designs, where multiple LLM-based agents collaborate, specialize, or delegate responsibilities across roles and tools. This trend reflects a broader shift in AI system design: the real world is inherently multi-agent, involving heterogeneous roles and coordinated decision-making. Multi-agent LLM systems offer a scalable and modular approach to reasoning, tool-use, and workflow execution, positioning them as a natural fit for these increasingly complex productivity environments.
Despite these advances, current multi-agent systems remain largely stateless and transactional: each task is solved from scratch, without reusing prior experience. This lack of memory—particularly procedural memory—limits their ability to learn from past experiences and build up execution skills over time for complex workflows. While recent works have proposed memory modules for single-agent LLMs, such as Synapse, Agent Workflow Memory (AWM), these approaches do not address the unique coordination and specialization challenges of multi-agent systems.
To address this gap, we introduce LEGOMem, a modular procedural memory framework designed for multi-agent LLM systems. In this work, we focus on a common and practical subclass of multi-agent architectures, where a central orchestrator performs planning and delegates subtasks to specialized tool-using task agents, as exemplified by the Magentic-One framework. Our goal is to equip both orchestrators and task agents with memory grounded in prior task trajectories, enabling them to perform better planning, coordination, and task executions. To this end, we design LEGOMem to distill successful executions into structured memory units: full-task memories (task-level plans and reasoning traces) and subtask memories (agent behavior and tool interactions). These modular memories are stored in a memory bank, indexed by semantic embeddings, and reused at inference time to augment planning and execution.
LEGOMem is instantiated as a retrieval augmentation (RAG) layer over existing multi-agent systems. During a new task, the orchestrator receives relevant full-task memories to support task decomposition and agent selection, while each task agent is assigned subtask memories aligned with its delegated subtasks. We explore three memory retrieval strategies—vanilla, dynamic retrieval, and query rewriting—to study how retrieval and memory specificity affect multi-agent performance. This framework allows us to systematically investigate key questions in multi-agent memory design, including where memory should be placed, how it should be retrieved, and which agents benefit most from it.
We evaluate LEGOMem in the context of productivity workflow automation using the OfficeBench benchmark, with agent teams composed of LLM-only, hybrid, and small language model configurations. Across these settings, all LEGOMem variants significantly improve task success rates over memory-less and baseline methods. Our ablation studies reveal that orchestrator memory is critical for high-level planning and delegation, while fine-grained subtask retrieval provides meaningful gains for smaller agents that rely more on localized execution support. These findings highlight how memory placement and retrieval strategy shape the effectiveness of multi-agent collaboration in workflow settings. Overall, LEGOMem provides a practical and extensible framework for memory-augmented multi-agent workflow automation, enabling agents to plan, coordinate, and execute more effectively by reusing structured procedural knowledge. We hope this work facilitates further research on memory design, continual learning, and efficient agent collaboration in complex productivity settings.
Multi-agent LLM systems for workflow automation
The recent advent of LLMs has enabled the development of multi-agent systems able to plan, decompose and solve complex workflows. Generalist multi-agent frameworks such as Magentic-One use a common design pattern where a lead orchestrator agent decomposes high-level goals into a step-by-step plan and directs a team of specialized agents to execute specific subtasks. This modular, multi-agent architecture simplifies development and facilitates the reuse of encapsulated skills, a significant advantage over monolithic, single-agent approaches. However, a key limitation remains that they are often stateless, solving each task from scratch and discarding valuable insights gained during execution. Without memory, agents may repeatedly make the same errors and cannot improve over time.
Memory for LLM agents
Memory offers a natural solution to the limitations of stateless agents. However, a primary challenge is that memory in LLM agents is often designed for single-agent systems and are often episodic/semantic, replaying information from dialogue histories, such as A-MEM which captures interactions as a network of interconnected notes that form an evolving memory structure, and Mem0, which focus on managing memory from ongoing conversations. While these systems advance memory capabilities, they are not designed for agentic learning and workflow automation. Another line of works target memory optimization for agentic workflows including, which focus on short-term context optimization for workflow agents. Most closely related works on long-term, procedural memory for agents include Synapse, which uses successful past full trajectories as exemplars, and Agent Workflow Memory (AWM) which induces frequently used subtask sequences as reusable skills. However, both works target procedural memory for single-agent scenarios. In contrast, LEGOMem introduces modular, role-aware procedural memory for multi-agent systems. By flexibly allocating memory across orchestrators and task agents, it addresses unique challenges in memory placement and allocation, improving workflow automation through better planning, execution, and coordination.
LEGOMem: Modular Procedural Memory for Multi-agent LLM Systems
In this section, we introduce LEGOMem, a modular procedural memory framework designed for multi-agent LLM systems. We begin by formalizing the problem setting of multi-agent workflow execution with procedural memory, then present the detailed LEGOMem framework, its variants and the design choices studied in our experiments.
The LEGOMem framework
The LEGOMem framework instantiates the problem formulation by equipping multi-agent systems with modular procedural memory. It operates in two phases: (i) an offline memory construction phase, where successful task trajectories are distilled into reusable memory units; and (ii) an online memory-augmented inference phase, where retrieved memories are allocated to the orchestrator and task agents to guide planning and execution. As illustrated in 1(a), past task trajectories are curated into a procedural memory bank, which is then queried at inference time to provide high-level orchestration guidance and agent-specific execution traces. 1(b) further shows the structure of these memory units, consisting of a high-level plan, localized agent subtask traces, the final answer, and a brief reflection. This modular design enables LEGO-like recombination of past experiences to support efficient and reliable task completion across diverse multi-agent environments.
LEGOMem variants
To explore the impact of subtask retrieval granularity in multi-agent systems, we compare three variants of LEGOMem: (vanilla) LEGOMem, LEGOMem-Dynamic, and LEGOMem-QueryRewrite. These variants differ in how they store and retrieve subtask memories and allocate them to the task agents.
LEGOMem-QueryRewrite
Interestingly, our experiments show that all three variants achieve similar overall performance in full memory settings, demonstrating the robustness across variants. Furthermore, our ablation study shows that LEGOMem-Dynamic and LEGOMem-QueryRewrite outperform vanilla LEGOMem when only task agent-level memory is used and with small language model task agents. This indicates that fine-grained subtask retrieval may offer more relevant guidance to task agents and may be particularly beneficial in settings with weaker orchestrator support.
Together, the LEGOMem framework and its variants provide a general and modular approach to procedural memory for multi-agent LLM systems, enabling both orchestrators and task agents to learn from and reuse prior task executions. In the following section, we empirically evaluate these variants across different agent team configurations and memory settings.
Experiments
We evaluate LEGOMem on the OfficeBench benchmark, comparing its variants with strong baselines across LLM-only, hybrid, and SLM-only multi-agent teams. Beyond overall performance, we conduct ablations on memory placement, retrieval strategies, and representation formats to analyze the contributions of different design choices. Our results show that LEGOMem consistently improves task success rates across team configurations, and that memory design, particularly the placement of orchestrator memory, plays a central role in enabling effective multi-agent coordination.
Dataset and metrics
We evaluate the agents on the OfficeBench, which consists of multi-step office automation tasks with varying levels of complexity. We split the 300 tasks into training (148 instances, for memory curation) and test (152 instances, for evaluation) sets. Tasks span three difficulty levels: Level 1 (single application), Level 2 (two-application), and Level 3 (multi-application workflows).
The evaluation metric is the success rate, i.e. the percentage of tasks solved correctly. The success of a task is evaluated programmatically according to the final state of the environment, including exact match or fuzzy keyword match of the final outputs and expected outputs (e.g., correctly updated spreadsheet entries, calendar events, emails sent and received, and question answering).
Implementation details
Additionally, for memory storage and retrieval, we use the OpenAI text-embedding-3-large model for embedding the task descriptions, and the FAISS library for the vector database. For the OCR app, we use the Phi-3.5-mini model as the vision language model for image parsing.
We compare the LEGOMem variants with three baselines: (i) No memory, and two state-of-the-art methods on procedural memory for workflow automation (ii) Synapse, which augments agents with semantically similar memories using raw action sequences and full trajectories, and (iii) AWM, which augments agents with summarized subtask memories extracted from full trajectories.
Memory curation and agent inference details
Memory construction uses the 148 training tasks, where we first run the full LLM agent team without memory, and filter for successful trajectories and extracted 93 full task memories from the successful trajectories. For the LEGOMem variants, we further extracted 250 subtask memories for the task agents from the 93 full task memories. Both Synapse and AWM focus on single-agent systems; for a fair comparison we use the same 93 successful trajectories, and adapt both baselines to the multi-agent team, augmenting the memories to both orchestrators and task agents. For Synapse, we augment both orchestrators and task agents with the full trajectories. For AWM, we cluster the successful trajectories, to extract and consolidate subtask memories from each cluster, and during inference, we augment the task agents with their corresponding extracted subtask memories and augment the orchestrator with a list of extracted subtask memories. For all variants, we use 5 memories for orchestrator and 3 memories for each task agent from the successful trajectories.
Memory retrieval
The three subtask memory retrieval strategies—vanilla LEGOMem, LEGOMem-Dynamic, and LEGOMem-QueryRewrite—all perform robustly and achieve similar overall success rates. While dynamic retrieval enables more targeted allocation and query rewriting improves robustness to subtask phrasing variations, these differences are modest compared to the impact of memory placement and allocation strategy.
In the task-agent-only memory setting, both LEGOMem-Dynamic and LEGOMem-QueryRewrite outperform vanilla LEGOMem by 4–5% on average in the Hybrid team where task agents are smaller models and agent-level memory plays a more critical role. These results highlight the advantage of fine-grained subtask retrieval in providing more relevant and contextual guidance to task agents, especially when global planning signals are weaker. We hypothesize that the similar overall performance of all three variants in full-memory settings may be due to the strength of the orchestrator memory, where the orchestrator receives the complete trajectory of prior solutions, compensating for weaker task agent execution by enabling better task decomposition and delegation.
Memory allocation
Regarding memory allocation, we find that joint allocation of orchestrator and task agent memory (Orchestrator + Agent memory variant) yields the strongest overall results, with orchestrator memory supporting effective planning, task decomposition and subtask orchestration, and task agent memory enabling execution-level precision. Orchestrator memory emerges as essential: when memory is removed from the orchestrator and provided only to task agents (Task Agent memory variant), performance drops noticeably.
Memory placement
Looking at memory placement, even when restricted to the planning and replanning stages, orchestrator memory still improves over task-agent-only variants, confirming its central role in guiding high-level planning and task decomposition. Finally, Task-Agent-only memory while facilitating more accurate tool use and outperforming the no-memory baseline, remains less effective than orchestrator-level memory – indicating that local memory without global coordination is insufficient.
Effectiveness of memory on execution steps and failure rates
Similarly, 4(b) shows that LEGOMem reduces the average failure rate of agent steps. At Level 3, the failure rate decreases from 0.275 in the no-memory setting to 0.225 with LEGOMem. These results indicate that LEGOMem not only improves task success rates but also enables more efficient and reliable task execution.
In summary, our experiments show that LEGOMem consistently outperforms baselines methods, improving task success by over 12 absolute percentage points compared with memory-less teams. LEGOMem can enable smaller and hybrid teams to match or even surpass LLM-only teams, highlighting its value for efficient multi-agent configurations. Ablations reveal that, as one may expect, the memory placement strategy is critical: orchestrator memory is essential for effective planning, while subtask memory complements execution. Additional analysis also show reductions in execution steps required and per-step failure rates with LEGOMem.
Conclusion
We introduced LEGOMem, a modular procedural memory framework for multi-agent systems that enables orchestrators and task agents to learn from prior task executions. By representing workflows as reusable memory units—split into full-task and subtask components—LEGOMem supports efficient task planning and execution through memory retrieval and allocation. We implemented and evaluated three LEGOMem variants to explore the design space of memory retrieval and placement strategies. Across extensive experiments on workflow automation tasks, we show that LEGOMem significantly improves task success rates over memory-less and baseline methods, with orchestrator memory playing a critical role in planning and coordination, and memory can also benefit smaller agents, highlighting the flexibility and effectiveness of the framework. Our work shows that integrating procedural memory into multi-agent systems enables more reliable and reusable solutions. Future work may explore continual learning also from failed past trajectories, and scaling LEGOMem to open-ended environments and tool ecosystems.


