Skip to main content

Module session

Module session 

Source
Expand description

Session persistence.

Sessions save agent Snapshots to a Storage under the layout shared with the other Strands SDKs, so agents in any of them can share a session:

<sessionId>/scopes/<scope>/<scopeId>/snapshots/
  snapshot_latest.json
  manifest.json
  immutable_history/snapshot_<uuidv7>.json

Session, scope and snapshot ids match ^[a-z0-9_-]+$; immutable snapshot ids are UUID v7s. SessionManager attaches a session to an agent.

Structs§

SessionManager
Saves and restores an agent’s session (SessionManager).
SessionManagerBuilder
Builds a SessionManager; the setters are the SessionManagerConfig keys.
SessionManagerConfig
Configuration for a SessionManager (SessionManagerConfig).
SnapshotManifest
Snapshot metadata stored next to a scope’s snapshots (SnapshotManifest), as manifest.json.
SnapshotTriggerCallback
Decides after each invocation whether to save an immutable snapshot (SnapshotTriggerCallback): true saves one.
SnapshotTriggerParams
What a SnapshotTriggerCallback sees when deciding whether to save an immutable snapshot (SnapshotTriggerParams).

Enums§

SaveLatestStrategy
When snapshot_latest is saved automatically (SaveLatestStrategy).