Manuscript Offprint

arXiv:2611.00779

Who Schedules Agent Memory? A Sidecar Approach to Long-Horizon Tasks

Qijia Zhuang, Rui Liu, Yuxiang Ren

Abstract

As large language model agents increasingly undertake complex, long-horizon tasks, memory has become an important component for supporting sustained decision-making and action. Existing methods primarily focus on memory storage, updating, and retrieval, but often overlook how memory scheduling affects task execution: the main agent must identify memory needs, initiate retrieval, and wait for results while advancing the task, increasing both scheduling burden and execution time. To address this problem, we propose MemSidecar, which decouples memory scheduling from task execution through two independently selectable modes. Hooks directly delivers bound memory to the main agent when execution events match predefined conditions. Foresight uses an independent agent to predict potential queries, retrieve results in parallel, and store them in a cache, delivering matching and valid results when actual requests arrive. Hooks and Foresight achieve scores of 41.23% and 44.34% on MCP-Persona, respectively, while effectively reducing execution costs and latency and improving the efficiency of long-horizon agent execution.

Keywords: LLM Agents, Agent Memory, Long-Horizon Agents

1 Introduction

Large language model agents are moving from answering questions to sustained task execution: browsing requires combining clues across pages, application use requires connecting successive operations, and project work requires carrying earlier decisions and progress forward [12, 32]. As task horizons grow, continuity across steps and sessions becomes an important basis for sustained execution. For Web application tasks, we study memory scheduling during long-horizon agent execution so that relevant memories can be delivered automatically and continually support subsequent decisions and actions.

Memory provides historical information that remains available throughout long-horizon tasks. Prior studies retain histories, summarize experience, and recover information across sessions to support continued decisions [18, 22]. Once information is stored, it must also be retrieved and delivered at the appropriate execution point.

This raises two related problems.

First, retrieval timing and waiting overhead. In a typical on-demand workflow, the main agent identifies memory needs from the current instruction or query, then constructs a retrieval query and accesses memory [21]. In long-horizon tasks, identifying access needs only from the current input may overlook earlier constraints, task state, or cross-task dependencies, or delay

retrieval until after the relevant decision. Waiting for memory recall blocks task progress and increases overall execution latency; repeated accesses bring demand identification, query construction, and retrieval waits into the task's critical path [3].

Second, retrieval coverage. In long-horizon tasks, the current instruction may not explicitly contain all the historical cues needed to complete the task. Relevant constraints, prior progress, and cross-task dependencies may be distributed across memories and expressed differently from the current instruction. Constructing queries solely from that instruction may therefore miss relevant information, making task goals and visible context necessary for determining what to retrieve. As a task unfolds, a planning step may need long-term constraints, whereas a later tool action may depend on recent progress or an earlier artifact. The relevant memory set therefore changes with execution, even when the user does not introduce a new instruction.

Existing memory research emphasizes storage, updating, and retrieval. In a typical on-demand interface, the main agent still initiates memory access inside its task loop. We study this scheduling coupling: the agent makes task decisions while identifying memory needs, constructing queries, and initiating and waiting for memory access. This adds scheduling burden to the main agent, while memory recall waits block task progress and increase overall execution latency. We assign memory scheduling to a separate module that uses task goals and visible context to determine retrieval content and organizes triggering, preparation, and delivery around task execution.

Figure 1 illustrates an XH hotel-booking task resumed after earlier sessions established the budget and meeting arrangements. It shows retrieval not being triggered, blocking from serial memory access, and incomplete queries. Stored information may still fail to reach the agent before the relevant decision.

We propose MemSidecar with two complementary memories. Global Memory organizes knowledge and user preferences reusable across tasks. Workspace Memory organizes knowledge, skills, experience, and task state within a particular workspace. In a multi-step workflow, a standing budget can remain applicable while selected resources, completed operations, and unresolved dependencies evolve in the workspace. Recovering both kinds of information gives a resumed task an explicit account of its requirements and progress. The scheduling module can then associate a decision with the relevant constraint or prior result as that decision approaches.

MemSidecar offers two independently selectable modes, Hooks and Foresight. Hooks binds specific memory entries to executable condition functions generated by an LLM. During execution, the system evaluates these functions against the current event, state, or pending action. When a condition holds, it delivers the corre-

*Corresponding author: renyuxiang@nju.edu.cn.

References (20)