Abstract
Multi-agent Large Language Model (LLM) systems often suffer from "stateless amnesia," failing to leverage past successes when encountering similar tasks. This paper introduces LEGOMem, a modular procedural memory framework that decomposes successful task trajectories into "LEGO-like" units. By strategically allocating these units to orchestrators for high-level planning and to task agents for precise tool execution, LEGOMem significantly enhances system performance. Evaluated on the OfficeBench benchmark, LEGOMem improved success rates by up to 13.4% and enabled smaller models (e.g., GPT-4o-mini) to outperform larger, memory-less models (e.g., GPT-4o).
Introduction
Despite the rapid advancement of LLM agents, current multi-agent systems typically solve every task from scratch. This lack of procedural memory leads to repeated errors, inefficient planning, and a failure to build specialized execution skills over time. While single-agent memory modules exist, multi-agent environments pose unique challenges: a central orchestrator must plan and delegate, while specialized task agents (e.g., Excel or Email agents) must execute specific tool calls. LEGOMem addresses this by providing a structured, modular memory system that serves both the "brain" (orchestrator) and the "hands" (task agents).
The LEGOMem Framework
LEGOMem operates in two distinct phases: offline curation and online inference.
1. Offline Memory Curation
The system processes logs of successful past executions to distill them into structured, reusable units. These are categorized into:
- Full-task memories: Containing high-level plans and reasoning for the orchestrator.
- Subtask memories: Detailing specific tool interactions and observations for individual task agents.
2. Online Memory-Augmented Inference
When a new task is received, the system retrieves relevant memories from a vector database using Retrieval-Augmented Generation (RAG). The framework supports three retrieval strategies:
- Vanilla LEGOMem: Retrieves a full-task memory and statically assigns its sub-components.
- LEGOMem-Dynamic: Performs "just-in-time" retrieval of subtask memories as the orchestrator assigns steps.
- LEGOMem-QueryRewrite: Uses an LLM to draft a plan, then rewrites those steps into optimized search queries to find the best subtask memories before execution.
Experimental Evaluation
The researchers evaluated LEGOMem using OfficeBench, a benchmark comprising 300 complex, multi-step office automation tasks involving applications like Outlook, Excel, Word, and Calendar. Tasks range from single-app interactions to complex multi-app workflows.
Key Results
- Performance Gains: LEGOMem improved absolute success rates by 12.6% to 13.4% across various team configurations.
- Model Efficiency: A "Hybrid" team (GPT-4o orchestrator with GPT-4o-mini agents) using LEGOMem achieved a 50.22% success rate, surpassing a full GPT-4o team without memory (45.83%).
- Reduced Error Rates: The "failed steps rate" dropped significantly, particularly in the most complex tasks (Level 3), falling from 0.275 to 0.225.
- Operational Efficiency: Agents with memory required up to 16.2% fewer steps, as they spent less time recovering from errors or "wandering" through the task space.
Discussion: Insights and Ideas
A critical finding of this work is that memory placement matters. Orchestrator memory is vital for high-level planning and task decomposition, while fine-grained agent memory is essential for correct tool call formatting and avoiding common pitfalls.
Furthermore, LEGOMem demonstrates that modular beats monolithic. By breaking memories into "LEGO" pieces (subtasks) rather than replaying entire raw trajectories, the system can mix and match successful sub-routines from different past tasks to solve novel problems. This modularity also acts as a "great equalizer," allowing smaller, cheaper models to compete with or exceed the performance of larger models.
Conclusion and Future Work
LEGOMem provides a robust framework for procedural memory in multi-agent systems. However, it currently faces a "cold start" problem, relying on an offline phase of successful trajectories rather than learning "on the fly" from failures. Future research will explore scaling LEGOMem to open-ended web environments and massive tool ecosystems, as well as addressing potential challenges like memory decay or instruction conflict as the memory bank grows.
Summary updated