export_to_msgpack

Function export_to_msgpack 

Source
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 from
  • agent_id - The agent ID whose memories to export
  • file_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();
}