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

# Relay Transport • AI Agent SDK

> RelayTransport: Protocol for an out-of-process platform-connector relay.

# RelayTransport

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

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

Protocol for an out-of-process platform-connector relay.

A concrete implementation (e.g. a `WebSocketRelayTransport` in the
praisonai wrapper) lets a connector that holds the platform socket
forward normalised inbound :class:`GatewayMessage` events to the gateway
and accept outbound sends/interrupts back down. The gateway treats the
relay like any other adapter (same inbound routing, admission control,
delivery) but the connection lives elsewhere.

Lifecycle::

caps = await transport.connect()            # handshake → capabilities
transport.set\_inbound\_handler(on\_message)   # wire inbound events in
...                                          # events relayed in/out
await transport.go\_dormant()                 # pause, keep connection
await transport.disconnect()                 # tear down

## Methods

<CardGroup cols={2}>
  <Card title="connect()" icon="function" href="../functions/RelayTransport-connect">
    Establish the relay and complete the handshake.
  </Card>

  <Card title="set_inbound_handler()" icon="function" href="../functions/RelayTransport-set_inbound_handler">
    Register the coroutine invoked for each relayed inbound message.
  </Card>

  <Card title="send_outbound()" icon="function" href="../functions/RelayTransport-send_outbound">
    Relay an outbound message to `target` via the connector.
  </Card>

  <Card title="go_dormant()" icon="function" href="../functions/RelayTransport-go_dormant">
    Pause inbound dispatch without dropping the connection.
  </Card>

  <Card title="disconnect()" icon="function" href="../functions/RelayTransport-disconnect">
    Tear down the relay connection.
  </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#L4730">
  `praisonaiagents/gateway/protocols.py` at line 4730
</Card>
