What is a session (AI conversation)?
A session is a single bounded conversation with an AI model or agent. It begins when a user opens a chat or a system starts a task, and it holds the messages exchanged, the tool calls and their results, uploaded files, and settings such as the model and system prompt in use. The application gives each session an identifier and sends the accumulated history to the model with every new turn, because the model itself retains nothing between calls. When the history outgrows the context window, the application summarizes or trims the earliest turns.
Why sessions matter
The session is the unit of state, cost, and accountability. Cost rises through a session because each turn re-sends the whole history. Accountability depends on knowing which user, in which session, asked for what, and the session identifier is what ties an audit log entry to a person. In a platform serving many users, one session’s data must never leak into another’s, which is why per-user sessions are a basic security requirement. A law firm’s assistant must not let one attorney’s session retrieve a document opened in another’s. Anything that should carry between sessions belongs in agent memory.
What to watch for
- Set an idle timeout and a maximum session length so cost and context do not grow without limit.
- Store session transcripts with the same controls as the data they contain.
- Test that sessions are isolated per user and per tenant, including tool access and uploaded files.