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

# connect • AI Agent SDK

> connect: Connect to the Realtime API (sync wrapper).

# connect

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

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

Connect to the Realtime API (sync wrapper).

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def connect() -> bool
```

### Returns

<ResponseField name="Returns" type="bool">
  True if connected successfully
</ResponseField>

## Uses

* `asyncio.get_event_loop`
* `loop.is_running`
* `loop.run_until_complete`
* `aconnect`
* `asyncio.new_event_loop`
* `asyncio.set_event_loop`

## Used By

* [`RealtimeAgent.aconnect`](../functions/RealtimeAgent-aconnect)
* [`Memory.store_short_term`](../functions/Memory-store_short_term)
* [`Memory.search_short_term`](../functions/Memory-search_short_term)
* [`Memory.reset_short_term`](../functions/Memory-reset_short_term)
* [`Memory.store_long_term`](../functions/Memory-store_long_term)

## Source

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