AI Chatbot Wiki

Session Memory, What Your Chatbot Remembers and When

Session memory is what a chatbot retains during and between conversations. Getting the boundary right decides whether it feels sharp or forgetful.

Updated 2026-08-18

Session memory is the information a chatbot keeps about the current conversation, and sometimes about the person across conversations. It splits into two things that get confused constantly: what the model can see right now, and what your system has stored.

What the model sees is the context window, rebuilt on every turn from the prompt, the history and any retrieved content. It is not memory, it is a snapshot. What your system stores is a record in a database keyed to a session ID or a customer identifier. Only the second one survives a hangup.

Why it matters when you are buying or building

Ask any vendor a single question: what does the bot know if the same person comes back tomorrow? The honest answers range from "nothing" to "everything you chose to save and re-inject". Neither is wrong, but you need to know which you are buying, because it changes the experience completely.

Within a session, the risk is silent truncation. Long conversations get trimmed to fit, and the oldest turns go first, which is usually where the customer said what they actually wanted. If a bot forgets the name it collected at the start of a twenty minute call, this is why. The fix is to extract important facts into variables as they are captured rather than trusting them to sit in the transcript.

Across sessions, the risk is the opposite: remembering things people did not expect you to remember. Cross-session memory is a privacy decision as much as a product one. Store what serves the customer, tell them you store it, and give a way to clear it.

A production example

The pattern I use on lead-capture agents is to write facts to variables the moment they are confirmed, not at the end. Name, phone, service needed, and urgency each get captured and stored as they come in. Two reasons. First, dynamic variables survive a truncated transcript. Second, calls drop. On phone agents a meaningful share of conversations end abruptly, and if you only persist at conversation end, you lose the lead entirely. Capturing incrementally means a call that dies after ninety seconds still produces a usable callback record, which for a home-services client is the difference between a booked job and a missed one.

Practical rules

  • Extract to variables early, do not rely on the transcript to remember anything you need.
  • Give sessions an explicit timeout and decide what a returning customer sees after it.
  • On voice, re-establish context out loud when you use it ("calling about the quote from Tuesday?") so it feels helpful rather than creepy.
  • Log what you persist. If you cannot list the fields you store per customer, you cannot answer a privacy question about them.