> ## 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 Connections • AI Agent SDK

> close_connections: Close database connections.

# close\_connections

Method

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

Close database connections.

Closes only the calling thread's STM/LTM SQLite connections (and the
process-wide MongoDB client, if any). Connections owned by other threads
are left untouched so concurrent agents are not interfered with — each
thread is responsible for calling this before terminating. For full
process shutdown, use the adapter's own bulk-close path.

## Signature

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

### Returns

**Returns** `Any`

The result of the operation.

## Uses

* `discard`
* `close`
* `logger.warning`
* `close_thread_connections`
* `logger.debug`
* `callable`

## Used By

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

## Source

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


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