Skip to main content
Get the session attributes for the current agent invocation. Retrieves session attributes that were previously set using set_session_attributes(). Works in both synchronous and asynchronous contexts automatically.

Parameters

agent
Agent
required
The Strands Agent instance to retrieve session attributes from

Returns

Dictionary of session attribute key-value pairs, or empty dict if none exist