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

# Receive Loop • AI Agent SDK

> receive_loop: Main receive loop for processing incoming events.

# receive\_loop

<div className="flex items-center gap-2">
  <Badge color="blue">Async</Badge>
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**RealtimeAgent**](../classes/RealtimeAgent) class in the [**realtime\_agent**](../modules/realtime_agent) module.

Main receive loop for processing incoming events.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def receive_loop() -> None
```

## Uses

* `json.loads`
* `callback`
* `base64.b64decode`
* `Exception`

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/realtime_agent.py#L377">
  `praisonaiagents/agent/realtime_agent.py` at line 377
</Card>
