pub async fn export_to_msgpack<P: Into<PathBuf>>(
source: &dyn Memory,
agent_id: &str,
file_path: P,
) -> Result<usize, String>Expand description
Exports all memory entries to a MessagePack file.
§Arguments
source- The source memory backend to read fromagent_id- The agent ID whose memories to exportfile_path- Path to the output MessagePack file
§Examples
use ceylon_next::memory::{InMemoryStore, export_to_msgpack};
use std::sync::Arc;
#[tokio::main]
async fn main() {
let memory = Arc::new(InMemoryStore::new());
export_to_msgpack(&*memory, "agent-123", "backup.msgpack").await.unwrap();
}