Skip to main content

Module session

Module session 

Source
Expand description

Session persistence — save/load colony graph and agent state.

Serializes the knowledge graph (nodes + edges) and agent state to JSON for persistence across sessions. Agents can be fully restored with their vocabulary, fitness history, and other internal state.

Structs§

GraphState
Serializable snapshot of the knowledge graph and agent state.
SerializedEdge
Serializable edge.
SerializedNode
Serializable node.
SessionMetadata
Session metadata.

Functions§

load_session
Load a saved session from JSON.
restore_agents
Restore agents from a GraphState into a colony.
restore_into_colony
Restore a graph state into a colony. Adds all nodes and edges from the saved state.
save_session
Save the colony’s knowledge graph to a JSON file.
save_session_with_agents
Save the colony’s knowledge graph and agent state to a JSON file.
verify_fidelity
Check if save/load preserves node and edge counts.