FilePersistenceStorageProvider

open class FilePersistenceStorageProvider<Path> @JvmOverloads constructor(fs: FileSystemProvider.ReadWrite<Path>, root: Path, json: Json = PersistenceUtils.defaultCheckpointJson) : PersistenceStorageProvider<AgentCheckpointPredicateFilter> (source)

A file-based implementation of PersistenceStorageProvider that stores agent checkpoints in a file system.

This implementation organizes checkpoints by agent ID and uses JSON serialization for storing and retrieving checkpoint data. It relies on FileSystemProvider.ReadWrite for file system operations.

Parameters

fs

A file system provider enabling read and write operations for file storage.

root

Root file path where the checkpoint storage will organize data.

Type Parameters

Path

Type representing the file path in the storage system.

Inheritors

Constructors

Link copied to clipboard
constructor(fs: FileSystemProvider.ReadWrite<Path>, root: Path, json: Json = PersistenceUtils.defaultCheckpointJson)

Functions

Link copied to clipboard
open suspend fun getCheckpoints(sessionId: String): List<AgentCheckpointData>

Retrieves the list of checkpoints of the AI agent with the given sessionId

open suspend override fun getCheckpoints(sessionId: String, filter: AgentCheckpointPredicateFilter?): List<AgentCheckpointData>

Retrieves the list of checkpoints of the AI agent with the given sessionId that match the provided filter

Link copied to clipboard
open suspend fun getLatestCheckpoint(sessionId: String): AgentCheckpointData?

Retrieves the latest checkpoint of the AI agent with sessionId

open suspend override fun getLatestCheckpoint(sessionId: String, filter: AgentCheckpointPredicateFilter?): AgentCheckpointData?

Retrieves the latest checkpoint of the AI agent with sessionId matching the provided filter

Link copied to clipboard
open suspend override fun saveCheckpoint(sessionId: String, agentCheckpointData: AgentCheckpointData)

Saves provided checkpoint (agentCheckpointData) of the agent with sessionId to the storage (ex: database, S3, file)