Chatbots built on large language models (LLMs) do not remember anything. Each new session starts from zero. That is fine for safety and for running many chats at once. It is a problem when you want an assistant that knows the user.
The fix is a memory layer. It is a separate piece of software that stores useful facts from past chats and hands them back when needed. This post explains how it works, and what a business leader should ask before it goes live.
Memory is a context problem
An LLM can only use what you put in front of it. Giving it the right facts at the right time is called context engineering. Memory is one part of that work.
A memory layer needs a few skills:
- Pulling clear facts out of raw chat text
- Summarising long chats
- Storing facts in a vector database, a store that finds items by meaning, not exact words
- Writing a search query and finding the closest matches
- Sorting the results so the best ones come first
The basic design
A sound memory system does four jobs: extract, store, retrieve and maintain.
Extraction
The system reads the chat and turns it into small memories. Each memory is one self-contained fact, such as a user preference. Small facts are easier to find later.
Storage
Each memory is turned into a list of numbers that captures its meaning. These are called embeddings. They go into the vector database, tagged with the user ID.
Retrieval
When a user asks something, the chatbot agent can call a lookup tool. The tool searches for memories close to the question. The agent then answers with that context.
Maintenance
Memories go out of date. After each chat, the agent decides whether to add, update, delete or ignore a memory. This keeps the store accurate.
Extracting memories
Extraction turns a chat transcript into a list of short, labelled facts. Tools such as DSPy, a framework for structuring LLM tasks, help here. You define what goes in (the chat) and what comes out (a list of memories). The result is saved in an external database, not inside the model.
Storing and retrieving memories
We store embeddings in a vector database such as Qdrant. The choice of embedding model is a trade-off between cost, speed and quality. Every record carries a user ID, so a search only looks at that user's memories.
At answer time, the agent decides if it needs more context. If it does, it calls the lookup tool and uses what comes back.
Keeping memory current
Memory changes as people change. A user moves teams or drops an old preference. The maintenance step handles this by updating or deleting old entries. Without it, the assistant slowly becomes wrong.
What this means for a business leader
A memory layer stores information about people. That makes it a data risk as well as a feature. Before it ships, ask three questions.
- Is data kept apart? One user or team must never see another's memories. Isolation should be built into storage and search, not left to the prompt.
- Can you audit memory writes? Every add, update and delete should be logged with who, when and why. Without a record, you cannot explain why the assistant said something.
- Can each team switch it off? Some teams will want memory, and others will not. Per-team on/off controls, and a way to wipe stored memories, should exist from day one.
How we approach it
Memory demos are easy to build. Memory that passes a security review is harder. We start by asking what the assistant should remember, for whom, and for how long. Those answers shape the design.
Our forward-deployed engineers work inside your team. We build the memory layer with your security and data owners, not after them. That way isolation, audit logs and switches are part of the first release.
We then hand it over. Your team learns how to run, review and change the memory rules. You can see how this works in our process, and in our work on AI agents and RAG systems.
Next step
If your team has a chatbot with memory in pilot but not in production, book a discovery call.
Saksham Gupta
Founder & CEO, EduBildSaksham Gupta is the founder and CEO of EduBild, which embeds forward-deployed AI engineers with enterprise teams to ship production AI. Ex-Daimler AG; KIT Germany.



