diff --git a/docs/sessions/index.md b/docs/sessions/index.md index 10fd1dd264..dc9165ca99 100644 --- a/docs/sessions/index.md +++ b/docs/sessions/index.md @@ -345,8 +345,13 @@ from agents.extensions.memory import AsyncSQLiteSession agent = Agent(name="Assistant") session = AsyncSQLiteSession("user_123", db_path="conversations.db") result = await Runner.run(agent, "Hello", session=session) +await session.close() ``` +Call `close()` when the application is finished with the session. This closes +any opened owned `aiosqlite` connection and makes the session terminal; +subsequent history operations raise `RuntimeError`. + ### Redis sessions Use `RedisSession` for shared session memory across multiple workers or services.