Package-level declarations

Types

Link copied to clipboard
data class AgentCheckpointData(val checkpointId: String, val createdAt: Instant, val nodePath: String, val lastInput: JSONElement? = null, val lastOutput: JSONElement? = null, val messageHistory: List<Message>, val version: Long, val properties: JSONObject? = null)

Represents the checkpoint data for an agent's state during a session.

Link copied to clipboard
class Persistence(persistenceStorageProvider: PersistenceStorageProvider<*>, clock: Clock = Clock.System)

A feature that provides checkpoint functionality for AI agents.

Link copied to clipboard

Configuration class for the Snapshot feature.

Link copied to clipboard
Link copied to clipboard
annotation class Reverts
Annotation used to mark a method that serves as a rollback or revert tool for a specified primary tool.
Link copied to clipboard

A registry for managing and retrieving rollback tools associated with specific tools. This class allows for the association of tools that have rollback counterparts and provides mechanisms for retrieval and addition of such tools.

Link copied to clipboard

A builder class responsible for creating a RollbackToolRegistry while managing associations between tools and their corresponding rollback tools.

A builder class responsible for creating a RollbackToolRegistry while managing associations between tools and their corresponding rollback tools.

A builder class responsible for creating a RollbackToolRegistry while managing associations between tools and their corresponding rollback tools.

A builder class responsible for creating a RollbackToolRegistry while managing associations between tools and their corresponding rollback tools.

Link copied to clipboard
interface RollbackToolSet

Represents a set of tools that can perform rollback or reversal operations for a given tool and toolset. This interface provides a mechanism to locate and retrieve tools that revert specific operations.

Functions

Link copied to clipboard
fun RollbackToolRegistry.add(toolFunction: KFunction<*>, rollbackToolFunction: KFunction<*>)

Adds a tool and its corresponding rollback tool to the registry. This convenience method converts both toolFunction and rollbackToolFunction into Tool objects before adding them.

Link copied to clipboard

Checks whether the AgentCheckpointData instance is marked as a tombstone.

Link copied to clipboard

Extension function to access the checkpoint feature from an agent context.

Extension function to access the checkpoint feature from a session.

Link copied to clipboard
inline fun <T> serializeInput(input: T?): String?
Link copied to clipboard
fun AgentCheckpointData.toAgentContextData(rollbackStrategy: RollbackStrategy, additionalRollbackAction: suspend (AIAgentContext) -> Unit = {}): AgentContextData

Converts an instance of AgentCheckpointData to AgentContextData.

Link copied to clipboard

Creates a tombstone checkpoint for an agent's session. A tombstone checkpoint represents a placeholder state with no real interactions or messages, intended to mark a terminated or invalid session.

Link copied to clipboard
suspend fun <T> AIAgentContext.withPersistence(action: suspend Persistence.(AIAgentContext) -> T): T

Executes the provided action within the context of the AI agent's persistence layer.

Executes the provided action within the context of the session's persistence layer if the session is in a running state.