Class AgentCheckpoint

java.lang.Object
com.tnsai.agents.interrupt.AgentCheckpoint
All Implemented Interfaces:
Serializable

public final class AgentCheckpoint extends Object implements Serializable
Represents a checkpoint of agent state for interrupt/resume functionality.

A checkpoint captures the complete state of an agent at a point in time, including BDI state, conversation history, and execution context.

See Also:
  • Method Details

    • getCheckpointId

      public String getCheckpointId()
      Gets the checkpoint identifier.
    • getAgentId

      public String getAgentId()
      Gets the agent identifier.
    • getCreatedAt

      public Instant getCreatedAt()
      Gets the creation timestamp.
    • getTrigger

      public Optional<InterruptEvent> getTrigger()
      Gets the trigger event that caused this checkpoint.
    • getBeliefs

      public List<Belief> getBeliefs()
      Gets the beliefs at checkpoint time.
    • getDesires

      public List<Desire> getDesires()
      Gets the desires at checkpoint time.
    • getIntentions

      public List<Intention> getIntentions()
      Gets the intentions at checkpoint time.
    • getConversationHistory

      public List<Map<String,Object>> getConversationHistory()
      Gets the conversation history.
    • getPendingPrompt

      public Optional<String> getPendingPrompt()
      Gets the pending prompt (if execution was interrupted mid-prompt).
    • getVariables

      public Map<String,Object> getVariables()
      Gets custom variables.
    • getVariable

      public <T> Optional<T> getVariable(String name, Class<T> type)
      Gets a specific variable.
    • getExecutionStep

      public int getExecutionStep()
      Gets the execution step number.
    • getCurrentAction

      public Optional<String> getCurrentAction()
      Gets the current action being executed (if any).
    • toBytes

      public byte[] toBytes() throws IOException
      Serializes this checkpoint to bytes.
      Throws:
      IOException
    • fromBytes

      public static AgentCheckpoint fromBytes(byte[] data) throws IOException, ClassNotFoundException
      Deserializes a checkpoint from bytes.
      Throws:
      IOException
      ClassNotFoundException
    • builder

      public static AgentCheckpoint.Builder builder()
      Creates a new builder for AgentCheckpoint.
    • toString

      public String toString()
      Overrides:
      toString in class Object