Skip to main content

Crate thermogram

Crate thermogram 

Source
Expand description

§Thermogram

A plastic memory capsule with 4-temperature tensor states (hot/warm/cool/cold), rule-governed deltas, and hash-chained auditability.

§Core Concept

Traditional storage is either:

  • Mutable (databases, files) - fast but no audit trail
  • Immutable (Engram, Git) - auditable but can’t evolve

Thermogram combines both with 4 thermal states that mimic biological memory:

§4-Temperature Model

TemperatureAnalogDecay RateBehavior
HotWorking memoryFast (0.1/tick)Volatile, immediate task
WarmShort-termMedium (0.01/tick)Session learning, persists
CoolProcedural/skillSlow (0.001/tick)Expertise, long-term
ColdCore identityGlacial (0.0001/tick)Personality backbone

§Bidirectional Flow

HOT ←→ WARM ←→ COOL ←→ COLD
 ↑        ↑        ↑        ↑
fast    medium   slow    glacial
decay   decay    decay   decay
  • Cement forward: Reinforcement strengthens, promotes to colder layer
  • Degrade backward: Lack of use weakens, demotes to hotter layer

§Features

  • Delta chain (append-only) - fast writes with audit trail
  • Plasticity rules (STDP-like) - when to update vs create new
  • Hash chain - cryptographic audit trail
  • Thermal transitions - automatic promotion/demotion based on strength
  • Colonies - multiple thermograms per mesh that grow, split, merge
  • Distillation - share semantic deltas across instances
  • Engram export - archive without deletion

§Use Cases

  1. LLM Activation Mining - Cluster centroids evolve as new patterns discovered
  2. Agent Memory - Episodic memory with replay and consolidation
  3. Knowledge Graphs - Concepts strengthen/weaken over time
  4. Neural Weights - Save checkpoints with full training history
  5. Personality Substrate - Synaptic weights that define identity

§Example

use thermogram::{Thermogram, PlasticityRule, Delta, PackedSignal, Signal};

// Create new thermogram for neural weight storage
let mut thermo = Thermogram::new("neural_weights", PlasticityRule::stdp_like());

// Apply delta (weight vector update using PackedSignal values)
let weights: Vec<PackedSignal> = (0..64).map(|i| PackedSignal::pack(1, i as u8, 1)).collect();
let delta = Delta::update(
    "layer_0",
    weights,
    "training",
    Signal::positive(204), // ~0.8 strength
    thermo.dirty_chain.head_hash.clone(),
);
thermo.apply_delta(delta)?;

// Read current state (hot tensors take priority)
let stored = thermo.read("layer_0")?;

// Consolidate (crystallize hot → cold, prune weak)
thermo.consolidate()?;

// Export to JSON
thermo.export_to_json("neural_knowledge_v1.json")?;

Re-exports§

pub use crate::colony::ColonyConfig;
pub use crate::colony::ColonyConsolidationResult;
pub use crate::colony::ColonyStats;
pub use crate::colony::ThermogramColony;
pub use crate::consolidation::ConsolidatedEntry;
pub use crate::consolidation::ConsolidationPolicy;
pub use crate::consolidation::ConsolidationResult;
pub use crate::consolidation::ConsolidationTrigger;
pub use crate::core::CrystallizationResult;
pub use crate::core::ThermalConfig;
pub use crate::core::ThermalState;
pub use crate::core::Thermogram;
pub use crate::core::ThermogramStats;
pub use crate::delta::Delta;
pub use crate::delta::DeltaType;
pub use crate::distillation::apply_delta_to_embedding;
pub use crate::distillation::cosine_similarity;
pub use crate::distillation::distill_learning;
pub use crate::distillation::DeltaBatch;
pub use crate::distillation::DeltaSource;
pub use crate::distillation::DistillationConfig;
pub use crate::distillation::SemanticDelta;
pub use crate::distillation::ThermogramSnapshot;
pub use crate::embedded_snn::EmbeddedSNN;
pub use crate::embedded_snn::EmbeddedSNNConfig;
pub use crate::error::Error;
pub use crate::error::Result;
pub use crate::hash_chain::HashChain;
pub use crate::plasticity::PlasticityRule;
pub use crate::plasticity::UpdatePolicy;
pub use crate::plasticity_engine::NeuromodState;
pub use crate::plasticity_engine::NeuromodSyncConfig;
pub use crate::plasticity_engine::PlasticityEngine;
pub use crate::ternary::TernaryWeight;

Modules§

codec
Binary Codec — .thermo v2 format
colony
Thermogram Colony
consolidation
Consolidation - Dirty → Clean state transitions
core
Core Thermogram implementation
delta
Delta - Represents a change to the Thermogram state
distillation
Distillation - Semantic Delta Sharing
embedded_snn
Embedded SNN - Small spiking neural network for Thermogram plasticity
error
Error types for Thermogram
export
Export - Archive Thermogram to Engram
hash_chain
Hash Chain - Cryptographic audit trail for deltas
plasticity
Plasticity Rules - STDP-like policies for memory updates
plasticity_engine
Plasticity Engine - SNN-based delta generation
ternary
Ternary Weight type for embedded SNN plasticity

Structs§

PackedSignal
Compact 1-byte signal: [pol:2|mag:3|mul:3]
Signal
Signal: polarity × magnitude × multiplier (s = p × m × k)

Enums§

Polarity
Polarity of a neural signal — strictly {-1, 0, +1}