MH-FLOCKE MH-FLOCKE
HomeDocsGitHubBlogPaperYouTubeReddit𝕏

Brain Persistence

Brain Persistence — Save & Load Complete Brain State

The brain persistence system serializes the ENTIRE cognitive state of a creature — SNN weights, world model, emotions, memories, concept graph, and all module states — into a single .pt file.

What Gets Saved

  • SNN — Membrane potentials, weights, eligibility traces, thresholds, neuromodulator levels, population definitions
  • World Model — Internal SNN weights, prediction history
  • GWT — Module activations, broadcast history, winning module
  • Emotions — Valence/arousal state, emotional history
  • Body Schema — Forward model weights, joint confidences
  • Memory — All stored episodes with sensor/motor/reward sequences
  • Drives — Drive levels (survival, exploration, comfort, social)
  • Metacognition — PE history, fitness history, consciousness level
  • Synaptogenesis — Complete concept graph + experience buffer
  • Astrocytes — Calcium levels per cluster
  • Dream Engine — Replay buffer
  • Skills — Active/frozen skills with EWC protection weights

Separate from Checkpoint

Brain state (.pt) stores accumulated cognitive state. Checkpoint stores training-loop state (step counter, CPG phases, competence gate). Both are needed for full resume.

API Reference

save_brain(brain, snn, path, metadata=None)

Serialize complete CognitiveBrain + SNN state to .pt file.

load_brain(brain, snn, path) → dict

Restore all module states. Brain and SNN must be pre-initialized. Returns metadata dict.

brain_info(path) → dict

Quick metadata read without loading full state. Returns version, step_count, consciousness_level, module presence flags, n_synapses, n_episodes, n_concepts.