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

# close • AI Agent SDK

> close: Synchronously close the agent and clean up resources.

# close

Method

> This is a method of the [**Agent**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/Agent.md) class in the [**agent**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/agent.md) module.

Synchronously close the agent and clean up resources.

## Signature

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

## Uses

* `memory.close_connections`
* `logger.warning`
* `asyncio.iscoroutinefunction`
* `run_coroutine_from_any_context`
* `aclose`
* `close`
* `llm_client.close`
* `t.shutdown`
* `task.cancel`
* `lock.sync`

## Used By

* [`Agent.close`](../functions/Agent-close)
* [`Agent.close`](../functions/Agent-close)
* [`Agent.aclose`](../functions/Agent-aclose)
* [`Agent.aclose`](../functions/Agent-aclose)
* [`Agent.aclose`](../functions/Agent-aclose)

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/agent/agent.py#L8101)
>
> `praisonaiagents/agent/agent.py` at line 8101


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