---
title: "What is session memory?"
description: "Session memory defined: what an AI agent retains within one conversation, why it disappears when the session ends, and how it becomes persistent."
canonical: https://past.dev/glossary/session-memory
last-updated: 2026-09-02
---
# What is session memory?

Source: https://past.dev/glossary/session-memory

Session memory is what an agent retains within one conversation and loses when the session ends. It lives in the conversation state: the messages, tool results, and scratch notes inside the model's context window. Nothing about it persists by default. When the session ends, the agent's next conversation starts empty unless the useful parts were written to memory outside the session.

## What session memory holds

During a conversation, an agent accumulates state: the messages exchanged, tool results, files read, corrections the user made, and decisions taken along the way. All of it is available for the rest of the session because the conversation history is resent to the model on each call.

Session memory is why a correction sticks within a conversation. Tell an agent at 10:02 that the meeting moved to Thursday, and at 10:40 it still plans around Thursday. Open a new session the next morning and the same agent proposes Wednesday again, because the correction existed only in the discarded transcript.

[Working memory](/glossary/working-memory) is the narrower term for what the model holds in its [context window](/glossary/context-window) for the current task; session memory covers the conversation as a whole.

## Why it disappears

Language models are stateless between calls. The continuity a session shows comes entirely from resending the transcript. When the session ends, that transcript is no longer resent, and the next conversation starts with a blank history.

Long sessions hit a second limit before the end: the context window is finite, so older turns get truncated or summarized while the session is still running. A user's correction from the first hour can be gone by the third.

## What to persist, and how

The transition from session memory to [cross-session memory](/glossary/cross-session-memory) is a deliberate write. During or after the session, the facts worth keeping (preferences stated, decisions made, commitments given) are extracted and stored outside the session with their timestamps and source. [Long-term memory](/glossary/long-term-memory) is the layer that holds them; the overview at [what is agent memory](/what-is-agent-memory) maps how the layers fit together.

Deciding what to keep is a policy question: persisting everything keeps noise and personal data; persisting nothing forces users to repeat themselves every session. A reasonable default is to persist decisions, stated preferences, and commitments, and to let small talk expire with the session. The [forgetting policy guide](/guides/forgetting-policy) covers retention choices.

## Related concepts

- **[Cross-session memory](/glossary/cross-session-memory)**: the mirror term, information that persists between conversations.
- **[Working memory](/glossary/working-memory)**: in-window state for the current task.
- **[Long-term memory](/glossary/long-term-memory)**: durable storage outside any session.
- **[Context rot](/glossary/context-rot)**: quality degradation inside long sessions.
- **Evaluation**: the [benchmark methodology](/benchmarks/methodology) describes how agent memory systems are evaluated.

## Frequently asked questions

### Can an AI agent remember things after a session ends?

Within the session, yes: the conversation history is resent on each call. After the session ends, only what was explicitly written to persistent memory remains; everything else is gone.

### Why do AI agents forget previous conversations?

Language models are stateless between calls. Continuity inside a session comes from resending the transcript, and once the session ends that transcript is no longer supplied, so nothing carries over by itself.

### What is the difference between session memory and working memory?

Working memory is what the agent holds in the context window for the current task. Session memory covers the whole conversation, which may span many tasks. Both end with the session unless persisted elsewhere.

## Related

- [What is cross-session memory?](https://past.dev/glossary/cross-session-memory)
- [What is working memory?](https://past.dev/glossary/working-memory)
- [What is long-term memory?](https://past.dev/glossary/long-term-memory)
- [Forgetting policy guide](https://past.dev/guides/forgetting-policy)
- [Memory API quickstart](https://past.dev/docs/memory-api/quickstart)