Abstract
The recent advancement of autonomous agents powered by Large Language Models (LLMs) has demonstrated significant potential for automating tasks on mobile devices through graphical user interfaces (GUIs). Despite initial progress, these agents still face challenges when handling complex real-world tasks. These challenges arise from a lack of knowledge about real-life mobile applications in LLM-based agents, which may lead to ineffective task planning and even cause hallucinations. To address these challenges, we propose a novel LLM-based agent framework called MapAgent that leverages memory constructed from historical trajectories to augment current task planning. Specifically, we first propose a trajectory-based memory mechanism that transforms task execution trajectories into a reusable and structured page-memory database. Each page within a trajectory is extracted as a compact yet comprehensive snapshot, capturing both its UI layout and functional context. Secondly, we introduce a coarse-to-fine task planning approach that retrieves relevant pages from the memory database based on similarity and injects them into the LLM planner to compensate for potential deficiencies in understanding real-world app scenarios, thereby achieving more informed and context-aware task planning. Finally, planned tasks are transformed into executable actions through a task executor supported by a dual-LLM architecture, ensuring effective tracking of task progress. Experimental results in real-world scenarios demonstrate that MapAgent achieves superior performance to existing methods.
Introduction
Autonomous mobile agents often suffer from knowledge bias. While LLMs possess general reasoning capabilities, they lack specific, up-to-date knowledge of the diverse and evolving UI layouts of mobile applications. This deficiency leads to ineffective planning, where agents suggest impossible steps, and hallucinations, where agents expect non-existent UI elements. MapAgent addresses this by providing agents with a "mental map" derived from past interactions.
The MapAgent Framework
The MapAgent framework consists of three integrated components designed to move beyond zero-shot interaction toward memory-augmented automation.
1. Trajectory-Based Memory Mechanism
Historical interaction trajectories are processed into structured Page Chunks. Each chunk encapsulates a page label, a functional description, key UI elements, and the specific Action Path required to reach that state. These chunks are vectorized and stored in a page-memory database organized by application, allowing for efficient retrieval during task planning.
2. Coarse-to-Fine Task Planning
Planning is executed in two stages. First, a Coarse-grained Planning phase uses an LLM to decompose the user's goal into high-level subtasks. Then, Fine-grained Planning retrieves the most relevant page chunks from memory. These retrieved pages serve as in-context examples, providing the agent with precise UI details and navigation paths to refine the plan into executable steps.
3. Dual-LLM Task Executor
To bridge the gap between planning and execution, MapAgent employs a dual-LLM architecture. A Decision-maker generates specific actions (e.g., click, scroll) based on the current UI state and the fine-grained plan. Simultaneously, a Judge evaluates the outcome of each action, providing feedback to correct errors or handle unexpected app behaviors in real-time.
Experimental Evaluation
MapAgent was evaluated on benchmarks including SPA-Bench (340 tasks) and CHOP (60 tasks).
Performance and Efficiency
MapAgent significantly outperformed existing state-of-the-art models. On SPA-Bench cross-app tasks, it achieved a 35% success rate, tripling the performance of MobileAgentV2. In the CHOP dataset, it reached success rates of 0.800 in English and 0.700 in Chinese.
Qualitative analysis (see Figure 6) demonstrates that without memory, agents often hallucinate navigation steps (e.g., looking for "Display Settings" in an app where they don't exist). Memory-augmented planning provides the specific "Action Path" (e.g., "Click 'Me' and enter the Settings page") necessary for success. Despite the overhead of memory retrieval, MapAgent remains efficient, with a mean time spent per step of approximately 15.3 seconds, making it competitive with less capable agents while maintaining higher accuracy.
Conclusion
MapAgent demonstrates that structured memory of past trajectories is a powerful tool for overcoming the limitations of LLM-based mobile agents. By combining historical context with a robust dual-LLM execution strategy, MapAgent reduces hallucinations and improves success rates in complex, multi-app scenarios. Future work will focus on improving UI perception and dynamic memory updates to handle evolving application environments.
Summary updated