feagi-serialization 0.0.1-beta.2

Adds serialization and deserialization to select Feagi Data Structures.
Documentation

feagi-serialization

Efficient serialization and deserialization for FEAGI data structures

Crates.io Documentation License

Overview

feagi-serialization provides high-performance serialization and deserialization for FEAGI data structures. This crate implements the FEAGI Byte Container (FBC) format for efficient binary encoding of neural data.

Features

  • FEAGI Byte Container (FBC): Efficient binary container format
  • Multiple Structure Types: Support for JSON, raw images, and XYZP neuron data
  • Cortical Mapped Data: Serialization for cortical-area-mapped neuron voxels
  • Zero-Copy Operations: Where possible, for maximum performance
  • Type-Safe Deserialization: Strongly typed structure identification

Installation

Add this to your Cargo.toml:

[dependencies]
feagi-serialization = "0.0.1-beta.1"
feagi-structures = "0.0.1-beta.1"

Usage

FEAGI Byte Container

use feagi_serialization::{FeagiByteContainer, FeagiByteStructureType};

// Create a container with JSON data
let json_data = br#"{"cortical_id": "ipu000", "data": [1,2,3]}"#;
let container = FeagiByteContainer::new(
    FeagiByteStructureType::Json,
    json_data.to_vec()
);

// Serialize to bytes
let bytes = container.to_bytes();

// Deserialize from bytes
let decoded = FeagiByteContainer::from_bytes(&bytes)?;

Cortical Mapped XYZP Data

use feagi_serialization::implementations::cortical_mapped_xyzp_neuron_data::CorticalMappedXYZPNeuronVoxels;
use feagi_structures::genomic::cortical_area::CorticalID;

// Create neuron data mapped to cortical areas
let cortical_id = CorticalID::from_base_64("aXB1MDAw")?;
let mut data = CorticalMappedXYZPNeuronVoxels::new();

// Add voxels for a cortical area
data.insert(cortical_id, vec![(10, 20, 5, 128)]);

// Serialize efficiently
let bytes = data.serialize_to_bytes();

Supported Structure Types

  • JSON (Type 0x01): Standard JSON encoding
  • Single Raw Image (Type 0x08): Raw image data
  • XYZP Neuron Data (Type 0x0B): Neuron voxel potential data

See documentation for the complete format specification.

Performance

The FBC format is designed for high-throughput neural data transmission:

  • Minimal overhead (8-byte header)
  • Type identification for fast routing
  • Optional compression support
  • Efficient for large batches of neuron data

Documentation

For detailed API documentation, visit docs.rs/feagi-serialization.

For format specifications, see the docs/ directory.

Part of FEAGI Ecosystem

This crate is part of the FEAGI project:

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Contributing

Contributions are welcome! Please see the main repository for contribution guidelines.

Links