Skip to main content
Sessions allow you to maintain conversation history across page loads, app restarts, and reconnections.

Session Basics

Each conversation has a unique session ID:
Sessions are created automatically when you send your first message.

Persisting Sessions

Web (localStorage)

React Native (AsyncStorage)

Loading a Session

Use loadSession to restore a previous conversation:

Listing Sessions

View all sessions for the current user:

Session Details

Get full session information:

Updating Sessions

Update session metadata:

Deleting Sessions

Clearing Current Session

Start a new conversation without deleting the old one:

Reconnection

If streaming was interrupted, reconnect to resume:

Session State

Check session streaming state:

Multi-Session UI

Build a chat interface with session history:

Best Practices

Save session ID to persistent storage after it’s created
Check session status before reconnecting
Provide UI to switch between sessions
Allow users to rename and organize sessions
Implement session cleanup for old/unused sessions
Handle session loading errors gracefully