Skip to main content
State provides serialization and deserialization capabilities for component state, serving as the foundation for Session persistence.

Core Interfaces

StateModule Interface

All state-aware components implement the StateModule interface:
Built-in support: ReActAgent, InMemoryMemory, PlanNotebook, etc. all implement this interface.

State Interface

State is a marker interface that identifies objects that can be stored by Session:

Usage

For most scenarios, call the state management methods directly on Agent:

Direct Session API Usage

Session provides type-safe state storage API:

Custom Components

Implement StateModule to enable persistence for custom components:

SessionKey

SessionKey identifies a session. SimpleSessionKey is the common implementation: