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

# Session Observer Protocol • AI Agent SDK

> SessionObserverProtocol: Protocol for attaching multiple observers to one live session.

# SessionObserverProtocol

> Defined in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

AI Agent

Protocol for attaching multiple observers to one live session.

Extends the single-owner :class:`GatewaySessionProtocol` model so that a
session can fan its live turn stream (tokens, tool calls, results, final)
out to more than one authorised client. Implementations live in the
wrapper Gateway; the contract lives here so every client agrees on the
attach/detach/enumerate surface.

Default behaviour is unchanged: a `PRIVATE` session keeps a single
`OWNER` observer (today's 1:1 model).

## Methods

> **[attach()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/SessionObserverProtocol-attach.md)**
>
> Attach `client_id` to `session_id` with the given role.

> **[detach()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/SessionObserverProtocol-detach.md)**
>
> Detach `client_id` from `session_id` (stop observing).

> **[observers()](https://praison.ai/docs/sdk/reference/praisonaiagents/functions/SessionObserverProtocol-observers.md)**
>
> Return `(client_id, role)` pairs currently attached to the session.

## Source

> **[View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L313)**
>
> `praisonaiagents/gateway/protocols.py` at line 313

***

## Related Documentation

> **[Session Management](https://praison.ai/docs/docs/concepts/session-management)**

> **[Sessions Feature](https://praison.ai/docs/docs/features/sessions)**

> **[Session Persistence](https://praison.ai/docs/docs/features/session-persistence)**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.