Think-in-Memory: Recalling and Post-thinking Enable LLMs with Long-Term Memory
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
Memory-augmented Large Language Models (LLMs) have demonstrated remarkable performance in long-term human-machine interactions, which basically relies on iterative recalling and reasoning of history to generate high-quality responses. However, such repeated recall-reason steps easily produce biased thoughts, textiti.e., inconsistent reasoning results when recalling the same history for different questions. On the contrary, humans can keep thoughts in the memory and recall them without repeated reasoning. Motivated by this human capability, we propose a novel memory mechanism called TiM (Think-in-Memory) that enables LLMs to maintain an evolved memory for storing historical thoughts along the conversation stream. The TiM framework consists of two crucial stages: (1) before generating a response, a LLM agent recalls relevant thoughts from memory, and (2) after generating a response, the LLM agent post-thinks and incorporates both historical and new thoughts to update the memory. Thus, TiM can eliminate the issue of repeated reasoning by saving the post-thinking thoughts as the history. Besides, we formulate the basic principles to organize the thoughts in memory based on the well-established operations, (textiti.e., insert, forget, and merge operations), allowing for dynamic updates and evolution of the thoughts. Furthermore, we introduce Locality-Sensitive Hashing into TiM to achieve efficient retrieval for the long-term conversations. We conduct qualitative and quantitative experiments on real-world and simulated dialogues covering a wide range of topics, demonstrating that equipping existing LLMs with TiM significantly enhances their performance in generating responses for long-term interactions.
Key facts. Cited by 64 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 27 of its 33 references that are in the map. First posted on arXiv 15 Nov 2023.
Builds on
27 of 33 references.
References · 27
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
- 2021Improving language models by retrieving from trillions of tokenscited by 1,293
- 2022GLM-130B: An Open Bilingual Pre-trained Modelcited by 843
- 2019Plug and Play Language Models: A Simple Approach to Controlled Text Generationcited by 799
- 2023Baichuan 2: Open Large-scale Language Modelscited by 670
- 2014Neural Turing Machinescited by 644
- 2023MemoryBank: Enhancing Large Language Models with Long-Term Memorycited by 556
15 more
- 2021Recent Advances in Natural Language Processing via Large Pre-Trained Language Models: A Surveycited by 463
- 2021Beyond Goldfish Memory: Long-Term Open-Domain Conversationcited by 267
- 2023FinGPT: Open-Source Financial Large Language Modelscited by 253
- 2023Prompting Large Language Model for Machine Translation: A Case Studycited by 250
- 2023HuatuoGPT, towards Taming Language Model to Be a Doctorcited by 214
- 2023Augmenting Language Models with Long-Term Memorycited by 189
- 2023GPTs are GPTs: An Early Look at the Labor Market Impact Potential of Large Language Modelscited by 176
- 2022From Images to Textual Prompts: Zero-shot VQA with Frozen Large Language Modelscited by 115
- 2022Long Time No See! Open-Domain Conversation with Long-Term Persona Memorycited by 108
- 2015Practical and Optimal LSH for Angular Distancecited by 106
- 2023SCM: Enhancing Large Language Model with Self-Controlled Memory Frameworkcited by 98
- 2021A Practical Survey on Faster and Lighter Transformerscited by 73
- 2020KdConv: A Chinese Multi-domain Dialogue Dataset Towards Multi-turn Knowledge-driven Conversationcited by 59
- 2022Investigating Efficiently Extending Transformers for Long Input Summarizationcited by 43
- 2022Relational Memory Augmented Language Modelscited by 24
Built on by
Citing papers per year: 2023: 1; 2024: 13; 2025: 30; 2026: 20.
64 papers.
Sort:
By area:
- 2025Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memorycited by 779
- 2024A Survey on the Memory Mechanism of Large Language Model based Agentscited by 634
- 2024Understanding the planning of LLM agents: A surveycited by 421
- 2025Darwin Godel Machine: Open-Ended Evolution of Self-Improving Agentscited by 356
- 2025Memory in the Age of AI Agentscited by 303
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 126
- 2025A Survey of Context Engineering for Large Language Modelscited by 126
- 2025Agentic Large Language Models, a surveycited by 108
- 2025How Memory Management Impacts LLM Agents: An Empirical Study of Experience-Following Behaviorcited by 101
- 2024A Survey on Self-Evolution of Large Language Modelscited by 91
- 2024AgentGen: Enhancing Planning Abilities for Large Language Model based Agent via Environment and Task Generationcited by 83
- 2025Collaborative Memory: Multi-User Memory Sharing in LLM Agents with Dynamic Access Controlcited by 61
38 more
- 2025MemoryBench: A Benchmark for Memory and Continual Learning in LLM Systemscited by 61
- 2025HaluMem: Evaluating Hallucinations in Memory Systems of Agentscited by 54
- 2026A Survey of Agent Memory in the Second Half: Towards Self-Evolving and Long-Horizon Agentscited by 44
- 2024KARMA: Augmenting Embodied AI Agents with Long-and-short Term Memory Systemscited by 39
- 2025Position: Episodic Memory is the Missing Piece for Long-Term LLM Agentscited by 36
- 2025O-Mem: Omni Memory System for Personalized, Long Horizon, Self-Evolving Agentscited by 32
- 2024INMS: Memory Sharing for Large Language Model based Agentscited by 31
- 2025Cognitive Memory in Large Language Modelscited by 29
- 2025From Single to Multi-Granularity: Toward Long-Term Memory Association and Selection of Conversational Agentscited by 29
- 2024Emotional RAG: Enhancing Role-Playing Agents through Emotional Retrievalcited by 26
- 2024MemSim: A Bayesian Simulator for Evaluating Memory of LLM-based Personal Assistantscited by 24
- 2025ArcMemo: Abstract Reasoning Composition with Lifelong LLM Memorycited by 24
- 2025Adaptation of Agentic AI: A Survey of Post-Training, Memory, and Skillscited by 22
- 2024A Survey of Optimization-based Task and Motion Planning: From Classical To Learning Approachescited by 20
- 2025Large language models for artificial general intelligence (AGI): A survey of foundational principles and approachescited by 18
- 2026A Comprehensive Survey on Agent Skills: Taxonomy, Techniques, and Applicationscited by 18
- 2023From Beginner to Expert: Modeling Medical Knowledge into General LLMscited by 14
- 2024A Human-Like Reasoning Framework for Multi-Phases Planning Task with Large Language Modelscited by 12
- 2025AI Meets Brain: Memory Systems from Cognitive Neuroscience to Autonomous Agentscited by 12
- 2026Memex(RL): Scaling Long-Horizon LLM Agents via Indexed Experience Memorycited by 12
- 2024Assessing Episodic Memory in LLMs with Sequence Order Recall Taskscited by 10
- 2025HiMA-Ecom: Enabling Joint Training of Hierarchical Multi-Agent E-commerce Assistantscited by 9
- 2025Memory-Augmented Transformers: A Systematic Review from Neuroscience Principles to Enhanced Model Architecturescited by 9
- 2026All-Mem: Agentic Lifelong Memory via Dynamic Topology Evolutioncited by 9
- 2025Beyond Pipelines: A Survey of the Paradigm Shift toward Model-Native Agentic AIcited by 8
- 2025Evaluating Long-Term Memory for Long-Context Question Answeringcited by 8
- 2025AI Awarenesscited by 7
- 2026MemWeaver: Weaving Hybrid Memories for Traceable Long-Horizon Agentic Reasoningcited by 7
- 2026Procedural Knowledge at Scale Improves Reasoningcited by 7
- 2026Memory as a Controlled Process: Learned Adaptive Memory Management for LLM Agentscited by 7
- 2025EvoMem: Improving Multi-Agent Planning with Dual-Evolving Memorycited by 6
- 2025Semantic Caching of Contextual Summaries for Efficient Question-Answering with Language Modelscited by 5
- 2026From Memory to Skills: Evidence-Grounded Co-Evolution Governance for Long-Horizon LLM Agentscited by 5
- 2024MathLearner: A Large Language Model Agent Framework for Learning to Solve Mathematical Problemscited by 4
- 2026SafeHarbor: Defining Precise Decision Boundaries via Hierarchical Memory-Augmented Guardrail for LLM Agent Safetycited by 4
- 2026InjecMEM: Memory Injection Attack on LLM Agent Memory Systemscited by 4
- 2025Learning, Reasoning, Refinement: A Framework for Kahneman's Dual-System Intelligence in GUI Agentscited by 2
- 2025Empowering Real-World: A Survey on the Technology, Practice, and Evaluation of LLM-driven Industry Agentscited by 2
50 most cited of 64 All 64 (JSON)
- 2026Memory Type Varies: Empowering LLM Agents for Long-Term Memory with Diverse Strategies8 Oct 2026
- 2026Gated Memory: Admission-Controlled Memory Formation for Conversational AI8 Oct 2026
- 2026From Knowledge Access to Source Learning: Developing Source-Specific Competence1 Oct 2026
- 2026Selective Forgetting: A Graph-Based Memory Framework for Long-Term LLM Agents29 Aug 2026
- 2026InjecMEM: Memory Injection Attack on LLM Agent Memory Systems24 Aug 2026
- 2026A Taxonomy of Cognitive Capability Gaps in Generative and Agentic AI3 Aug 2026
- 2026From Memory to Skills: Evidence-Grounded Co-Evolution Governance for Long-Horizon LLM Agents18 Jul 2026
- 2026Memory as a Controlled Process: Learned Adaptive Memory Management for LLM Agents15 Jul 2026
- 2026SF-AMS: Strategic Forgetting for Structured Memory in LLM Agent29 May 2026
- 2026Improving Multi-turn Dialogue Consistency with Self-Recall Thinking14 May 2026
- 2026Evaluating Memory Condensation Strategies for Coding Agents in Data-Driven Scientific Discovery13 May 2026
- 2026A Comprehensive Survey on Agent Skills: Taxonomy, Techniques, and Applications8 May 2026
38 more
- 2026SafeHarbor: Defining Precise Decision Boundaries via Hierarchical Memory-Augmented Guardrail for LLM Agent Safety7 May 2026
- 2026Procedural Knowledge at Scale Improves Reasoning1 Apr 2026
- 2026WorkflowGen:an adaptive workflow generation mechanism driven by trajectory experience22 Mar 2026
- 2026All-Mem: Agentic Lifelong Memory via Dynamic Topology Evolution20 Mar 2026
- 2026Memex(RL): Scaling Long-Horizon LLM Agents via Indexed Experience Memory4 Mar 2026
- 2026Scene-Aware Memory Discrimination: Deciding Which Personal Knowledge Stays12 Feb 2026
- 2026MemWeaver: Weaving Hybrid Memories for Traceable Long-Horizon Agentic Reasoning26 Jan 2026
- 2026A Survey of Agent Memory in the Second Half: Towards Self-Evolving and Long-Horizon Agents14 Jan 2026
- 2025AI Meets Brain: Memory Systems from Cognitive Neuroscience to Autonomous Agents29 Dec 2025
- 2025Adaptation of Agentic AI: A Survey of Post-Training, Memory, and Skills18 Dec 2025
- 2025Memory in the Age of AI Agents15 Dec 2025
- 2025SEAL: Self-Evolving Agentic Learning for Conversational Question Answering over Knowledge Graphs4 Dec 2025
- 2025O-Mem: Omni Memory System for Personalized, Long Horizon, Self-Evolving Agents17 Nov 2025
- 2025HaluMem: Evaluating Hallucinations in Memory Systems of Agents5 Nov 2025
- 2025EvoMem: Improving Multi-Agent Planning with Dual-Evolving Memory1 Nov 2025
- 2025Evaluating Long-Term Memory for Long-Context Question Answering27 Oct 2025
- 2025Empowering Real-World: A Survey on the Technology, Practice, and Evaluation of LLM-driven Industry Agents20 Oct 2025
- 2025MemoryBench: A Benchmark for Memory and Continual Learning in LLM Systems20 Oct 2025
- 2025Beyond Pipelines: A Survey of the Paradigm Shift toward Model-Native Agentic AI19 Oct 2025
- 2025ArcMemo: Abstract Reasoning Composition with Lifelong LLM Memory4 Sep 2025
- 2025TinyMusician: On-Device Music Generation with Knowledge Distillation and Mixed Precision Quantization31 Aug 2025
- 2025Memory-Augmented Transformers: A Systematic Review from Neuroscience Principles to Enhanced Model Architectures14 Aug 2025
- 2025A Survey of Context Engineering for Large Language Models17 Jul 2025
- 2025HiMA-Ecom: Enabling Joint Training of Hierarchical Multi-Agent E-commerce Assistants24 Jun 2025
- 2025Learning, Reasoning, Refinement: A Framework for Kahneman's Dual-System Intelligence in GUI Agents22 Jun 2025
- 2025Darwin Godel Machine: Open-Ended Evolution of Self-Improving Agents29 May 2025
- 2025From Single to Multi-Granularity: Toward Long-Term Memory Association and Selection of Conversational Agents26 May 2025
- 2025Collaborative Memory: Multi-User Memory Sharing in LLM Agents with Dynamic Access Control23 May 2025
- 2025How Memory Management Impacts LLM Agents: An Empirical Study of Experience-Following Behavior21 May 2025
- 2025Semantic Caching of Contextual Summaries for Efficient Question-Answering with Language Models16 May 2025
- 2025Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory28 Apr 2025
- 2025AI Awareness25 Apr 2025
- 2025Cognitive Memory in Large Language Models3 Apr 2025
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systems31 Mar 2025
- 2025Agentic Large Language Models, a survey29 Mar 2025
- 2025Position: Episodic Memory is the Missing Piece for Long-Term LLM Agents10 Feb 2025
- 2025Addressing the sustainable AI trilemma: a case study on LLM agents and RAG14 Jan 2025
- 2025Large language models for artificial general intelligence (AGI): A survey of foundational principles and approaches6 Jan 2025
50 newest of 64 All 64 (JSON)
- 2025Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memorycited by 779
- 2024Understanding the planning of LLM agents: A surveycited by 421
- 2025Darwin Godel Machine: Open-Ended Evolution of Self-Improving Agentscited by 356
- 2025Memory in the Age of AI Agentscited by 303
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 126
- 2025Agentic Large Language Models, a surveycited by 108
- 2025How Memory Management Impacts LLM Agents: An Empirical Study of Experience-Following Behaviorcited by 101
- 2025Collaborative Memory: Multi-User Memory Sharing in LLM Agents with Dynamic Access Controlcited by 61
- 2025HaluMem: Evaluating Hallucinations in Memory Systems of Agentscited by 54
- 2026A Survey of Agent Memory in the Second Half: Towards Self-Evolving and Long-Horizon Agentscited by 44
- 2024KARMA: Augmenting Embodied AI Agents with Long-and-short Term Memory Systemscited by 39
- 2025Position: Episodic Memory is the Missing Piece for Long-Term LLM Agentscited by 36
12 most cited of 33 All 33 (JSON)
- 2026Memory Type Varies: Empowering LLM Agents for Long-Term Memory with Diverse Strategies8 Oct 2026
- 2026InjecMEM: Memory Injection Attack on LLM Agent Memory Systems24 Aug 2026
- 2026A Taxonomy of Cognitive Capability Gaps in Generative and Agentic AI3 Aug 2026
- 2026From Memory to Skills: Evidence-Grounded Co-Evolution Governance for Long-Horizon LLM Agents18 Jul 2026
- 2026Memory as a Controlled Process: Learned Adaptive Memory Management for LLM Agents15 Jul 2026
- 2026SF-AMS: Strategic Forgetting for Structured Memory in LLM Agent29 May 2026
- 2026Evaluating Memory Condensation Strategies for Coding Agents in Data-Driven Scientific Discovery13 May 2026
- 2026A Comprehensive Survey on Agent Skills: Taxonomy, Techniques, and Applications8 May 2026
- 2026SafeHarbor: Defining Precise Decision Boundaries via Hierarchical Memory-Augmented Guardrail for LLM Agent Safety7 May 2026
- 2026All-Mem: Agentic Lifelong Memory via Dynamic Topology Evolution20 Mar 2026
- 2026Memex(RL): Scaling Long-Horizon LLM Agents via Indexed Experience Memory4 Mar 2026
- 2026A Survey of Agent Memory in the Second Half: Towards Self-Evolving and Long-Horizon Agents14 Jan 2026
12 newest of 33 All 33 (JSON)
- 2024AgentGen: Enhancing Planning Abilities for Large Language Model based Agent via Environment and Task Generationcited by 83
- 2025ArcMemo: Abstract Reasoning Composition with Lifelong LLM Memorycited by 24
- 2024A Human-Like Reasoning Framework for Multi-Phases Planning Task with Large Language Modelscited by 12
- 2026MemWeaver: Weaving Hybrid Memories for Traceable Long-Horizon Agentic Reasoningcited by 7
- 2026Procedural Knowledge at Scale Improves Reasoningcited by 7
- 2024MathLearner: A Large Language Model Agent Framework for Learning to Solve Mathematical Problemscited by 4
- 2025Learning, Reasoning, Refinement: A Framework for Kahneman's Dual-System Intelligence in GUI Agentscited by 2
- 2025Empowering Real-World: A Survey on the Technology, Practice, and Evaluation of LLM-driven Industry Agentscited by 2
- 2025SEAL: Self-Evolving Agentic Learning for Conversational Question Answering over Knowledge Graphscited by 1
- 2026Improving Multi-turn Dialogue Consistency with Self-Recall Thinkingcited by 0
- 2026Improving Multi-turn Dialogue Consistency with Self-Recall Thinking14 May 2026
- 2026Procedural Knowledge at Scale Improves Reasoning1 Apr 2026
- 2026MemWeaver: Weaving Hybrid Memories for Traceable Long-Horizon Agentic Reasoning26 Jan 2026
- 2025SEAL: Self-Evolving Agentic Learning for Conversational Question Answering over Knowledge Graphs4 Dec 2025
- 2025Empowering Real-World: A Survey on the Technology, Practice, and Evaluation of LLM-driven Industry Agents20 Oct 2025
- 2025ArcMemo: Abstract Reasoning Composition with Lifelong LLM Memory4 Sep 2025
- 2025Learning, Reasoning, Refinement: A Framework for Kahneman's Dual-System Intelligence in GUI Agents22 Jun 2025
- 2024MathLearner: A Large Language Model Agent Framework for Learning to Solve Mathematical Problems3 Aug 2024
- 2024AgentGen: Enhancing Planning Abilities for Large Language Model based Agent via Environment and Task Generation1 Aug 2024
- 2024A Human-Like Reasoning Framework for Multi-Phases Planning Task with Large Language Models28 May 2024
- 2025A Survey of Context Engineering for Large Language Modelscited by 126
- 2024A Survey on Self-Evolution of Large Language Modelscited by 91
- 2025MemoryBench: A Benchmark for Memory and Continual Learning in LLM Systemscited by 61
- 2025Cognitive Memory in Large Language Modelscited by 29
- 2024A Survey of Optimization-based Task and Motion Planning: From Classical To Learning Approachescited by 20
- 2023From Beginner to Expert: Modeling Medical Knowledge into General LLMscited by 14
- 2024Assessing Episodic Memory in LLMs with Sequence Order Recall Taskscited by 10
- 2025Memory-Augmented Transformers: A Systematic Review from Neuroscience Principles to Enhanced Model Architecturescited by 9
- 2025Evaluating Long-Term Memory for Long-Context Question Answeringcited by 8
- 2025AI Awarenesscited by 7
- 2024Efficient and Accurate Memorable Conversation Model using DPO based on sLLMcited by 1
- 2026WorkflowGen:an adaptive workflow generation mechanism driven by trajectory experiencecited by 1
12 most cited of 16 All 16 (JSON)
- 2026Gated Memory: Admission-Controlled Memory Formation for Conversational AI8 Oct 2026
- 2026From Knowledge Access to Source Learning: Developing Source-Specific Competence1 Oct 2026
- 2026WorkflowGen:an adaptive workflow generation mechanism driven by trajectory experience22 Mar 2026
- 2026Scene-Aware Memory Discrimination: Deciding Which Personal Knowledge Stays12 Feb 2026
- 2025Evaluating Long-Term Memory for Long-Context Question Answering27 Oct 2025
- 2025MemoryBench: A Benchmark for Memory and Continual Learning in LLM Systems20 Oct 2025
- 2025TinyMusician: On-Device Music Generation with Knowledge Distillation and Mixed Precision Quantization31 Aug 2025
- 2025Memory-Augmented Transformers: A Systematic Review from Neuroscience Principles to Enhanced Model Architectures14 Aug 2025
- 2025A Survey of Context Engineering for Large Language Models17 Jul 2025
- 2025AI Awareness25 Apr 2025
- 2025Cognitive Memory in Large Language Models3 Apr 2025
- 2024Assessing Episodic Memory in LLMs with Sequence Order Recall Tasks10 Oct 2024
12 newest of 16 All 16 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2026Memory in the LLM Era: Modular Architectures and Strategies in a Unified Framework
- 2026Evaluating Memory Structure in LLM Agents
- 2023Empowering Working Memory for Large Language Model Agents
- 2026Thought-Retriever: Don't Just Retrieve Raw Data, Retrieve Thoughts for Memory-Augmented Agentic Systems
- 2026Beyond Dialogue Time: Temporal Semantic Memory for Personalized LLM Agents
- 2026MemOps: Benchmarking Lifecycle Memory Operations in Long-Horizon Conversations
- 2025Rethinking Memory in LLM based Agents: Representations, Operations, and Emerging Topics
- 2025CogMem: A Cognitive Memory Architecture for Sustained Multi-Turn Reasoning in Large Language Models