We are using the Koog Persistence Snapshot feature...
# koog-agentic-framework
c
We are using the Koog Persistence Snapshot feature. If I look into the AgentCheckPointData I don't see the restoration of the "context.storage" (AIAgentStorage):
Copy code
public class AIAgentStorage {
    private val mutex = Mutex()
    private val storage = mutableMapOf<AIAgentStorageKey<*>, Any>()
Copy code
@Serializable
public data class AgentCheckpointData(
    val checkpointId: String,
    val createdAt: Instant,
    val nodePath: String,
    val lastInput: JsonElement,
    val messageHistory: List<Message>,
    val version: Long,
    val properties: Map<String, JsonElement>? = null
)
What happens now if the app crashes inbetween nodes and Node 1 stored one data model output into the storage which Node 2 wants to use? The data is lost as I understand it?
a
Hi Mark! Indeed, seems like the data will be lost.@Mark Tkachenko as far as I understand, it's hard to serialize the storage and add it to the checkpoint. But can we have a workaround for such cases?
c
Seems to be related to https://kotlinlang.slack.com/archives/C08SLB97W23/p1770728379017899. The AIAgentStorageKey is the main issue I think because its not persistable.
v
Actually I think we should be able to fix this by serializing storage as a map of “String -> Serializable object” (or skipping with a warning log if some object is not serializable)… WDYT @Mark Tkachenko
upd — thought about it and see the issue now… probably we’d need to request some explicit serializers module, for example in order for it to work…
upd 2: apparently, the upcoming serialization change that @Andrey Bragin is working on would partially fix this issue. we’ll come back with some updates
👍 1