HippocampusManager - Overdrive77/BioSynapStudio-Public GitHub Wiki


HippocampusManager Class

Summary

Manages the long-term memory encoding and recall of a NeuralNetwork using [HippocampalMemory]-decorated properties. This system emulates hippocampal consolidation by serializing and restoring neural states and configurations to disk.


Namespace

BioSynapStudio.Net.Modules.Plasiticity

Assembly

BioSynapStudio.Net.dll


Constructor

public HippocampusManager(NeuralNetwork network)

Initializes the hippocampal memory manager for the specified NeuralNetwork.


Public Methods

void RegisterMemorySection(string tag, Action<BinaryWriter> saveCallback, Action<BinaryReader> loadCallback)

Registers custom memory sections to be serialized alongside standard properties. Useful for plugins or extended modules.

void SaveMemory()

Serializes and stores all [HippocampalMemory] fields of the associated neural network and tagged sections to a .bsm file.

void LoadMemory()

Deserializes the stored memory and restores the [HippocampalMemory]-tagged fields and tagged sections into the active network.


Internal Logic

  • Serialization markers are used to distinguish value types:

    • 1 = string
    • 2 = double
    • 3 = int
    • 4 = short
    • 5 = float
    • 6 = bool
    • 7 = Guid
    • 8 = List of complex objects with memory attributes
    • 9 = Single complex object
  • The .bsm (BioSynapStudio Memory) file uses a header signature, versioning, and timestamp for integrity and future compatibility.


File Format

Stored in: %Documents%\Hippocampus\{NetworkName}.bsm


Example Usage

var hippocampus = new HippocampusManager(myNetwork);
hippocampus.SaveMemory();  // Save current brain state
hippocampus.LoadMemory();  // Restore prior brain state

Remarks

  • Handles both simple and nested class serialization using the [HippocampalMemory] attribute.

  • Future-proofed through:

    • Header signature & versioning
    • Dynamic property mapping
    • Optional tagged sections for custom modules

See Also


Legal Notice

This software constitutes original intellectual property of the author, protected under international copyright and patent law. Patent: GB2506327.2 – Synthesized Emotional Cognition (SEC) DOI: 10.17605/OSF.IO/XERKF