> ## 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.

# Gateway Session Protocol • AI Agent SDK

> GatewaySessionProtocol: Protocol for gateway session management.

# GatewaySessionProtocol

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

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

Protocol for gateway session management.

Sessions track conversations between clients and agents,
maintaining state and message history.

## Methods

<CardGroup cols={2}>
  <Card title="session_id()" icon="function" href="../functions/GatewaySessionProtocol-session_id">
    Unique session identifier.
  </Card>

  <Card title="agent_id()" icon="function" href="../functions/GatewaySessionProtocol-agent_id">
    ID of the agent handling this session.
  </Card>

  <Card title="client_id()" icon="function" href="../functions/GatewaySessionProtocol-client_id">
    ID of the client in this session.
  </Card>

  <Card title="is_active()" icon="function" href="../functions/GatewaySessionProtocol-is_active">
    Whether the session is currently active.
  </Card>

  <Card title="created_at()" icon="function" href="../functions/GatewaySessionProtocol-created_at">
    Session creation timestamp.
  </Card>

  <Card title="last_activity()" icon="function" href="../functions/GatewaySessionProtocol-last_activity">
    Last activity timestamp.
  </Card>

  <Card title="get_state()" icon="function" href="../functions/GatewaySessionProtocol-get_state">
    Get session state.
  </Card>

  <Card title="set_state()" icon="function" href="../functions/GatewaySessionProtocol-set_state">
    Set a session state value.
  </Card>

  <Card title="add_message()" icon="function" href="../functions/GatewaySessionProtocol-add_message">
    Add a message to the session history.
  </Card>

  <Card title="get_messages()" icon="function" href="../functions/GatewaySessionProtocol-get_messages">
    Get session message history.
  </Card>

  <Card title="close()" icon="function" href="../functions/GatewaySessionProtocol-close">
    Close the session.
  </Card>
</CardGroup>

## Source

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

***

## Related Documentation

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

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

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

  <Card title="Gateway Feature" icon="tower-broadcast" href="/docs/features/gateway" />
</CardGroup>
