Skip to content

Persistence

The Akashic Records layer provides durable persistence using sled, a Rust-native embedded database.

flowchart TB
    subgraph Core["MindFry Core"]
        PA[Psyche Arena]
        BG[Bond Graph]
        CX[Cortex]
    end

    subgraph Akashic["Akashic Records"]
        SN[Snapshots<br/><small>bincode</small>]
        IX[Lineage Index<br/><small>key → id</small>]
    end

    subgraph Storage["Disk"]
        SL[(sled)]
    end

    Core -->|Snapshot| Akashic
    Akashic -->|Restore| Core
    Akashic --> SL
ComponentFormatContents
Psyche ArenabincodeAll active lineages
Bond GraphbincodeAll bonds
CortexbincodeMood + Personality
MetadataJSONTimestamp, name, version

On startup, MindFry automatically restores state:

flowchart LR
    A[Boot] --> B{Snapshot exists?}
    B -->|Yes| C[Deserialize Arenas]
    B -->|No| D[Fresh Start]
    C --> E[Rebuild Index]
    E --> F[Resume Operations]
    D --> F
// Resurrection on boot
let mut db = MindFry::with_config(config);
db.resurrect()?; // Returns Ok(true) if restored
CommandDescription
SYS.SNAPSHOT "name"Create named checkpoint
SYS.RESTORE "name"Hot-swap to checkpoint

See Deployment for production persistence configuration.