@@ -117,27 +117,6 @@ print(f"Agent: {result.final_output}")
117117
118118The SDK provides several session implementations for different use cases:
119119
120- ### SQLite sessions
121-
122- The default, lightweight session implementation using SQLite:
123-
124- ``` python
125- from agents import SQLiteSession
126-
127- # In-memory database (lost when process ends)
128- session = SQLiteSession(" user_123" )
129-
130- # Persistent file-based database
131- session = SQLiteSession(" user_123" , " conversations.db" )
132-
133- # Use the session
134- result = await Runner.run(
135- agent,
136- " Hello" ,
137- session = session
138- )
139- ```
140-
141120### OpenAI Conversations API sessions
142121
143122Use [ OpenAI's Conversations API] ( https://platform.openai.com/docs/api-reference/conversations ) through ` OpenAIConversationsSession ` .
@@ -174,6 +153,27 @@ result = await Runner.run(
174153print (result.final_output) # "California"
175154```
176155
156+ ### SQLite sessions
157+
158+ The default, lightweight session implementation using SQLite:
159+
160+ ``` python
161+ from agents import SQLiteSession
162+
163+ # In-memory database (lost when process ends)
164+ session = SQLiteSession(" user_123" )
165+
166+ # Persistent file-based database
167+ session = SQLiteSession(" user_123" , " conversations.db" )
168+
169+ # Use the session
170+ result = await Runner.run(
171+ agent,
172+ " Hello" ,
173+ session = session
174+ )
175+ ```
176+
177177### SQLAlchemy sessions
178178
179179Production-ready sessions using any SQLAlchemy-supported database:
@@ -423,8 +423,8 @@ result = await Runner.run(
423423For detailed API documentation, see:
424424
425425- [ ` Session ` ] [ agents.memory.session.Session ] - Protocol interface
426- - [ ` SQLiteSession ` ] [ agents.memory.sqlite_session.SQLiteSession ] - Basic SQLite implementation
427426- [ ` OpenAIConversationsSession ` ] [ agents.memory.OpenAIConversationsSession ] - OpenAI Conversations API implementation
427+ - [ ` SQLiteSession ` ] [ agents.memory.sqlite_session.SQLiteSession ] - Basic SQLite implementation
428428- [ ` SQLAlchemySession ` ] [ agents.extensions.memory.sqlalchemy_session.SQLAlchemySession ] - SQLAlchemy-powered implementation
429429- [ ` AdvancedSQLiteSession ` ] [ agents.extensions.memory.advanced_sqlite_session.AdvancedSQLiteSession ] - Enhanced SQLite with branching and analytics
430430- [ ` EncryptedSession ` ] [ agents.extensions.memory.encrypt_session.EncryptedSession ] - Encrypted wrapper for any session
0 commit comments