Agent Session

An agent session is a durable instance of an AI agent that keeps the context needed to work across multiple user inputs and turns. Depending on the runtime, it can hold an agent configuration, conversation items, tool results, pending actions, and references to saved artifacts. The application retains a session identifier so a later message continues the same work.

The distinction between a session and a turn matters operationally. A turn is one cycle of work triggered by input. A session can contain many turns: a user may start an analysis, inspect the result, then steer the agent to revise it without creating a new session. A resumable agent run concerns recovery of an interrupted execution; session persistence also supports ordinary follow-up work after a turn has completed.

The session is also separate from the agent sandbox or other compute environment. An environment may be stopped or replaced while the conversation survives. If files or processes must survive that replacement, the application needs persistent storage or snapshots rather than assuming the session ID preserves the machine's filesystem. Agent memory is broader still: it stores selected knowledge for future retrieval, potentially across sessions.

Production applications should record the session ID, observe turn outcomes, and reconcile missed stream events from saved session state. A completed turn does not guarantee that every tool succeeded; the final output and any changed external state still need inspection. Session retention, access control, and deletion also matter because the stored history may contain sensitive input and tool output.

The OpenAI Agents API session guide illustrates these boundaries, including turns, follow-up input, saved items, and event recovery.

The LLM Knowledge Base is a collection of bite-sized explanations for commonly used terms and abbreviations related to Large Language Models and Generative AI.

It's an educational resource that helps you stay up-to-date with the latest developments in AI research and its applications.

© 2026 Promptmetheus