Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/ref/memory/openai_conversations_session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `Openai Conversations Session`

::: agents.memory.openai_conversations_session
3 changes: 3 additions & 0 deletions docs/ref/memory/sqlite_session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `Sqlite Session`

::: agents.memory.sqlite_session
3 changes: 3 additions & 0 deletions docs/ref/models/default_models.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `Default Models`

::: agents.models.default_models
25 changes: 24 additions & 1 deletion docs/sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,27 @@ print(f"Agent: {result.final_output}")
result = await Runner.run(agent, "Hello")
```

### OpenAI Conversations API memory

Use the [OpenAI Conversations API](https://platform.openai.com/docs/guides/conversational-agents/conversations-api) to persist

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a non-existent page. Where is this supposed to point?

conversation state without managing your own database. This is helpful when you already rely on OpenAI-hosted infrastructure
for storing conversation history.

```python
from agents import OpenAIConversationsSession

session = OpenAIConversationsSession()

# Optionally resume a previous conversation by passing a conversation ID
# session = OpenAIConversationsSession(conversation_id="conv_123")

result = await Runner.run(
agent,
"Hello",
session=session,
)
```

### SQLite memory

```python
Expand Down Expand Up @@ -282,6 +303,7 @@ Use meaningful session IDs that help you organize conversations:
- Use in-memory SQLite (`SQLiteSession("session_id")`) for temporary conversations
- Use file-based SQLite (`SQLiteSession("session_id", "path/to/db.sqlite")`) for persistent conversations
- Use SQLAlchemy-powered sessions (`SQLAlchemySession("session_id", engine=engine, create_tables=True)`) for production systems with existing databases supported by SQLAlchemy
- Use OpenAI-hosted storage (`OpenAIConversationsSession()`) when you prefer to store history in the OpenAI Conversations API
- Consider implementing custom session backends for other production systems (Redis, Django, etc.) for more advanced use cases

### Session management
Expand Down Expand Up @@ -378,4 +400,5 @@ For detailed API documentation, see:

- [`Session`][agents.memory.Session] - Protocol interface
- [`SQLiteSession`][agents.memory.SQLiteSession] - SQLite implementation
- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - SQLAlchemy-powered implementation
- [`OpenAIConversationsSession`](ref/memory/openai_conversations_session.md) - OpenAI Conversations API implementation
- [`SQLAlchemySession`][agents.extensions.memory.sqlalchemy_session.SQLAlchemySession] - SQLAlchemy-powered implementation