Close Connections • AI Agent SDK

close_connections: Close database connections.

close_connections

Method

</div>

This is a method of the Memory class in the 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
def close_connections() -> Any

Returns

ResponseField Any

The result of the operation.

Uses

  • discard
  • close
  • logger.warning
  • close_thread_connections
  • logger.debug
  • callable

Used By

Source

View on GitHub

praisonaiagents/memory/memory.py at line 2527