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

# Presence Protocol • AI Agent SDK

> PresenceProtocol: Protocol for tracking client presence (online/idle/offline).

# PresenceProtocol

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

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

Protocol for tracking client presence (online/idle/offline).

## Methods

<CardGroup cols={2}>
  <Card title="track_presence()" icon="function" href="../functions/PresenceProtocol-track_presence">
    Set or update a client's presence status.
  </Card>

  <Card title="remove_presence()" icon="function" href="../functions/PresenceProtocol-remove_presence">
    Remove a client's presence (on disconnect).
  </Card>

  <Card title="get_presence()" icon="function" href="../functions/PresenceProtocol-get_presence">
    Get a single client's presence info.
  </Card>

  <Card title="get_all_presence()" icon="function" href="../functions/PresenceProtocol-get_all_presence">
    Get presence info, optionally filtered by channel.
  </Card>

  <Card title="get_online_count()" icon="function" href="../functions/PresenceProtocol-get_online_count">
    Count online clients, optionally filtered by channel.
  </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#L1357">
  `praisonaiagents/gateway/protocols.py` at line 1357
</Card>
