Session Interface
Represents a series of interactions between a user and agents. Sessions store conversation state, events, and metadata that persist across multiple agent interactions.Properties
The unique identifier of the session.
The name of the app.
The id of the user.
The state of the session. This is a key-value store that persists across events and can be updated by agents through state deltas.
Keys starting with
temp_ are treated as temporary and won’t be persisted to the session state.The events of the session, including:
- User input
- Model responses
- Function calls and responses
- Tool executions
- State changes
The last update time of the session (timestamp in milliseconds).
Usage Example
Related
- BaseSessionService - Service for managing sessions
- MemoryService - Add sessions to long-term memory
- State Management - How state is updated