Module migration

Module migration 

Source
Expand description

Migration utilities for transitioning from sync to async APIs

This module provides tools and helpers for migrating from the synchronous MemoryGraph API to the asynchronous AsyncMemoryGraph API.

§Migration Strategies

Start by identifying async boundaries in your application and migrate one component at a time:

// Old sync code
use llm_memory_graph::MemoryGraph;

fn process_sync() -> Result<(), Box<dyn std::error::Error>> {
    let graph = MemoryGraph::open(Default::default())?;
    let session = graph.create_session()?;
    Ok(())
}

// New async code
use llm_memory_graph::AsyncMemoryGraph;

async fn process_async() -> Result<(), Box<dyn std::error::Error>> {
    let graph = AsyncMemoryGraph::open(Default::default()).await?;
    let session = graph.create_session().await?;
    Ok(())
}

§2. Parallel APIs

Both APIs can coexist during migration. The sync and async versions use the same storage format and are fully compatible.

§Data Compatibility

  • Same storage format (Sled-based)
  • No data migration required
  • Can switch between sync and async at any time
  • Node IDs and edge IDs are compatible

Structs§

CheckpointVerification
Result of verifying a migration checkpoint
CompatibilityReport
Report on database compatibility between sync and async APIs
MigrationCheckpoint
Snapshot of database state for migration checkpoints
MigrationHelper
Migration helper providing utilities for transitioning between sync and async APIs
MigrationTestReport
Report from running a complete migration test