> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Warm Session • AI Agent SDK

> WarmSession: A warm per-session agent cache eligible for memory-pressure eviction.

# WarmSession

> Defined in the [**protocols**](../modules/protocols) module.

<Badge color="blue">AI Agent</Badge>

A warm per-session agent cache eligible for memory-pressure eviction.

A pure, import-free fact carried from the running gateway to
:func:`plan_pressure_evictions`. Attributes:

* `session_id`: the cache key to soft-evict.
* `last_activity`: monotonic/epoch seconds of the session's last turn;
  the planner evicts the coldest (smallest `last_activity`) first.
* `in_flight`: `True` while a turn is executing — never evicted (would
  abort live work).
* `flushed`: `True` when the transcript is durably persisted — only a
  flushed cache is rebuildable, so an unflushed one is never evicted
  (would lose data).

## Properties

<ResponseField name="session_id" type="str">
  No description available.
</ResponseField>

<ResponseField name="last_activity" type="float">
  No description available.
</ResponseField>

<ResponseField name="in_flight" type="bool">
  No description available.
</ResponseField>

<ResponseField name="flushed" type="bool">
  No description available.
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L3480">
  `praisonaiagents/gateway/protocols.py` at line 3480
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Session Management" icon="clock" href="/docs/docs/concepts/session-management" />

  <Card title="Sessions Feature" icon="folder" href="/docs/docs/features/sessions" />

  <Card title="Session Persistence" icon="database" href="/docs/docs/features/session-persistence" />
</CardGroup>
