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

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

> This is a method of the [**Memory**](../classes/Memory) class in the [**memory**](../modules/memory) 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

<ResponseField name="Returns" type="Any">
  The result of the operation.
</ResponseField>

## Uses

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

## Used By

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

## Source

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