save_to_memory_bank

Function save_to_memory_bank 

Source
pub async fn save_to_memory_bank(
    workspace_dir: &Path,
    entry: &MemoryBankEntry,
) -> Result<PathBuf, MemoryBankError>
Expand description

Save a memory bank entry to disk as a markdown file

Creates the .gestura/memory/ directory if it doesn’t exist, then writes the entry as a markdown file with a timestamp-based filename.

§Arguments

  • workspace_dir - The workspace directory (memory will be saved to .gestura/memory/)
  • entry - The memory bank entry to save

§Returns

Path to the saved file

§Errors

Returns MemoryBankError::Io if directory creation or file write fails

§Examples

use gestura_core::memory_bank::{MemoryBankEntry, save_to_memory_bank};
use std::path::Path;

let entry = MemoryBankEntry::new(
    "session-123".to_string(),
    "Fixed bug".to_string(),
    "Conversation content...".to_string(),
);

let workspace = Path::new("/home/user/project");
let file_path = save_to_memory_bank(workspace, &entry).await?;
println!("Saved to: {}", file_path.display());