Package com.tnsai.state
Interface Checkpointer
- All Known Implementing Classes:
FileCheckpointer,InMemoryCheckpointer
public interface Checkpointer
Checkpointer interface - LangGraph-style state checkpointing.
Enables:
- Session memory between interactions
- Human-in-the-loop workflows
- Fault tolerance and recovery
- Time-travel debugging
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordCheckpoint tuple container.static final recordWrite operation. -
Method Summary
Modifier and TypeMethodDescriptionvoidDelete checkpoints for a thread.Fetch a checkpoint.List checkpoints for a thread.voidStore a checkpoint.voidputWrites(String checkpointId, List<Checkpointer.Write> writes) Store intermediate writes.
-
Method Details
-
put
void put(String threadId, String checkpointId, Map<String, Object> state, Map<String, Object> metadata) Store a checkpoint.- Parameters:
threadId- Thread identifiercheckpointId- Checkpoint identifierstate- State datametadata- Checkpoint metadata
-
putWrites
Store intermediate writes.- Parameters:
checkpointId- Checkpoint identifierwrites- List of writes
-
getTuple
Fetch a checkpoint.- Parameters:
threadId- Thread identifiercheckpointId- Checkpoint identifier (null for latest)- Returns:
- Checkpoint tuple
-
list
List checkpoints for a thread.- Parameters:
threadId- Thread identifier- Returns:
- List of checkpoints
-
delete
Delete checkpoints for a thread.- Parameters:
threadId- Thread identifier
-