ELI5: how llm memory works
// explanation
What is LLM memory?
LLMs don't actually remember things like you do—they're like someone with amnesia who forgets everything after you stop talking [1]. To make them seem like they remember you, programmers add a "memory helper" that saves past conversations and shows them back to the AI, kind of like reading old texts before responding [1][2].
Why can't LLMs remember on their own?
LLMs are designed to only look at the words you give them right now—they have no brain storage like humans do [1]. Each time you chat, it's like meeting them for the first time unless someone writes down what you said and shows it to them again [1][3].
What types of memory can they use?
There are three kinds: facts they learned during training (like knowing the Earth is round), memories of your past conversations (like you telling them your name), and learned habits for doing tasks (like how to write an email) [2]. All three work together to make them seem smarter about you [2].
How do you give them memory?
You attach a database (like a notebook) that saves important things from your chats and shows them to the AI when needed [4][5]. You can also add fact databases like online encyclopedias so they know current information [4].
// sources
Feb 14, 2024 ... To create the perception of a LLM being able to remember things about you, we combine a LLM with a memory abstraction layer.
Dec 16, 2025 ... LLMs use semantic memory (facts and knowledge stored externally), episodic memory (past conversation history), procedural memory (system ...
Jul 27, 2024 ... 18 votes, 49 comments. Hello everyone, I'm having a little trouble understanding how an LLM works locally. If I'm using Ollama and I'm ...
Jul 19, 2024 ... To increase its knowledge, we can add fact memory databases to the application. These databases function like encyclopedias to the models. For ...
Long-term memory allows agents to remember important information across conversations. LangMem provides ways to extract meaningful details from chats, store ...
Video by LangChain

Video by IBM Technology

Video by Traceloop
