pub trait ColdStorage: Send + Sync {
// Required methods
fn archive<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 MemoryRecord,
) -> Pin<Box<dyn Future<Output = Result<ArchiveResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn restore<'life0, 'async_trait>(
&'life0 self,
memory_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<RestoreResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_archived<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: Option<&'life1 str>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn delete_archived<'life0, 'async_trait>(
&'life0 self,
memory_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn is_archived<'life0, 'async_trait>(
&'life0 self,
memory_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Trait for cold storage backends.
Implementations handle archiving memory records to durable object storage (e.g., S3, MinIO, GCS) and restoring them on demand.
Required Methods§
Sourcefn archive<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 MemoryRecord,
) -> Pin<Box<dyn Future<Output = Result<ArchiveResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn archive<'life0, 'life1, 'async_trait>(
&'life0 self,
record: &'life1 MemoryRecord,
) -> Pin<Box<dyn Future<Output = Result<ArchiveResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Archive a memory record to cold storage.
Serializes the record to JSON and writes it to the configured bucket
under the key {prefix}/{agent_id}/{memory_id}.json.
Sourcefn restore<'life0, 'async_trait>(
&'life0 self,
memory_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<RestoreResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn restore<'life0, 'async_trait>(
&'life0 self,
memory_id: Uuid,
) -> Pin<Box<dyn Future<Output = Result<RestoreResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Restore a memory from cold storage by ID.
Returns an error if the memory is not found in cold storage.
Sourcefn list_archived<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: Option<&'life1 str>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_archived<'life0, 'life1, 'async_trait>(
&'life0 self,
agent_id: Option<&'life1 str>,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Uuid>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List archived memory IDs with optional agent filter.
If agent_id is provided, only memories belonging to that agent are
returned. Results are capped at limit.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".