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