0

Basic Sessions

awesome-llm-apps7_1_basic_sessions

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

  1. Install OpenAI Agents SDK:

    pip install openai-agents
    
  2. Set up environment:

    cp ../env.example .env
    # Edit .env and add your OpenAI API key
    
  3. 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

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)