This paper provides a comprehensive survey on the memory mechanism of large language model (LLM)-based agents, addressing the key component that supports agent-environment interactions. The survey begins by discussing the necessity of memory in LLM-based agents from cognitive psychology, self-evolution, and agent applications perspectives. It then systematically reviews previous studies on designing and evaluating memory modules, covering memory sources, forms, and operations. The paper also presents various agent applications where memory plays a crucial role, such as role-playing, social simulation, personal assistants, open-world games, code generation, recommendations, and expert systems. Finally, it analyzes the limitations of existing work and highlights future directions, including advancements in parametric memory, multi-agent applications, lifelong learning, and humanoid agents. The main contributions of this survey include defining the memory module, summarizing existing studies, presenting typical applications, and identifying key limitations and future directions.This paper provides a comprehensive survey on the memory mechanism of large language model (LLM)-based agents, addressing the key component that supports agent-environment interactions. The survey begins by discussing the necessity of memory in LLM-based agents from cognitive psychology, self-evolution, and agent applications perspectives. It then systematically reviews previous studies on designing and evaluating memory modules, covering memory sources, forms, and operations. The paper also presents various agent applications where memory plays a crucial role, such as role-playing, social simulation, personal assistants, open-world games, code generation, recommendations, and expert systems. Finally, it analyzes the limitations of existing work and highlights future directions, including advancements in parametric memory, multi-agent applications, lifelong learning, and humanoid agents. The main contributions of this survey include defining the memory module, summarizing existing studies, presenting typical applications, and identifying key limitations and future directions.