Skip to main content

Module cold

Module cold 

Source
Expand description

Cold storage interface for archiving memories to object storage.

Provides a trait and types for archiving memories to S3-compatible object storage. Memories can be archived from the primary database and restored when needed.

§Architecture

The ColdStorage trait defines the contract for any cold storage backend. An InMemoryColdStorage implementation is provided for testing without requiring real S3 credentials or network access.

S3 keys follow the format: {prefix}/{agent_id}/{memory_id}.json

§Example

use mnemo_core::storage::cold::{ColdStorage, InMemoryColdStorage, ColdStorageConfig};

let config = ColdStorageConfig {
    bucket: "my-bucket".to_string(),
    prefix: "memories".to_string(),
    endpoint: None,
    region: "us-east-1".to_string(),
};
let storage = InMemoryColdStorage::new(config);

Structs§

ArchiveResult
Result of an archive operation.
ColdStorageConfig
Configuration for S3-compatible cold storage.
InMemoryColdStorage
In-memory cold storage implementation for testing.
RestoreResult
Result of a restore operation.

Traits§

ColdStorage
Trait for cold storage backends.