pub trait Checkpointer: Send + Sync {
// Required methods
fn save_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 String,
state: &'life2 AgentStateSnapshot,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 String,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentStateSnapshot>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn delete_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 String,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn list_threads<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Trait for persisting and retrieving agent state between conversation runs. This mirrors the LangGraph Checkpointer interface used in the Python implementation.
Required Methods§
Sourcefn save_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 String,
state: &'life2 AgentStateSnapshot,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn save_state<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 String,
state: &'life2 AgentStateSnapshot,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Save the current agent state for a given thread.
Sourcefn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 String,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentStateSnapshot>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn load_state<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 String,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentStateSnapshot>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Load the last saved state for a given thread. Returns None if no state exists for this thread.