Demonstrates fundamental session memory management with SQLiteSession for automatic conversation history.
Sign in to save downloads to your library and vote.
Preview
Basic Sessions
Demonstrates fundamental session memory management with SQLiteSession for automatic conversation history.
๐ฏ What This Demonstrates
- In-Memory Sessions: Temporary session storage for development
- Persistent Sessions: File-based session storage for production
- Multi-Turn Conversations: Automatic context preservation
- Session Memory: Eliminating manual
.to_input_list()handling
๐ Quick Start
-
Install OpenAI Agents SDK:
pip install openai-agents -
Set up environment:
cp ../env.example .env # Edit .env and add your OpenAI API key -
Run the agent:
import asyncio from agent import in_memory_session_example, persistent_session_example # Test in-memory sessions asyncio.run(in_memory_session_example()) # Test persistent sessions asyncio.run(persistent_session_example())
๐ก Key Concepts
- SQLiteSession: Automatic conversation memory management
- In-Memory vs Persistent: Choose storage based on use case
- Session IDs: Organizing conversations by unique identifiers
- Automatic Context: No manual conversation threading required
๐งช Available Examples
In-Memory Sessions
- Temporary conversation storage
- Lost when process ends
- Perfect for development and testing
Persistent Sessions
- File-based conversation storage
- Survives application restarts
- Essential for production applications
Multi-Turn Conversations
- Extended conversation flows
- Automatic context preservation
- Natural conversation progression
๐ Next Steps
- Memory Operations - Advanced memory manipulation
- Multi Sessions - Managing multiple conversations
Ingestion metadata
- Source catalog
- awesome-llm-apps
- Repository
- Shubhamsaboo/awesome-llm-apps ยท main
- File path
- ai_agent_framework_crash_course/openai_sdk_crash_course/7_sessions/7_1_basic_sessions/README.md
- Last refreshed
- 7/23/2026, 10:39:09 PM (4h ago)
- Refresh schedule
- Daily ยท 03:00 UTC
- Dedupe status
- Unique ยท deduped by (source, url)