| Crates.io | exo-exotic |
| lib.rs | exo-exotic |
| version | 0.1.0 |
| created_at | 2025-12-02 04:08:41.962518+00 |
| updated_at | 2025-12-02 04:08:41.962518+00 |
| description | Exotic cognitive experiments: Strange Loops, Dreams, Free Energy, Morphogenesis, Collective Consciousness, Temporal Qualia, Multiple Selves, Cognitive Thermodynamics, Emergence Detection, Cognitive Black Holes |
| homepage | https://ruv.io |
| repository | https://github.com/ruvnet/ruvector |
| max_upload_size | |
| id | 1961120 |
| size | 293,595 |
Cutting-edge cognitive experiments for EXO-AI 2025 cognitive substrate.
"The mind is not a vessel to be filled, but a fire to be kindled." โ Plutarch
EXO-Exotic implements 10 groundbreaking cognitive experiments that push the boundaries of artificial consciousness research. Each module is grounded in rigorous theoretical frameworks from neuroscience, physics, mathematics, and philosophy of mind.
| Metric | Value |
|---|---|
| Modules | 10 exotic experiments |
| Lines of Code | ~4,500 |
| Unit Tests | 77 (100% pass rate) |
| Theoretical Frameworks | 15+ |
| Build Time | ~30s (release) |
Traditional AI focuses on optimization and prediction. EXO-Exotic explores the phenomenology of cognition:
Add to your Cargo.toml:
[dependencies]
exo-exotic = { path = "crates/exo-exotic" }
Or use the full experiment suite:
use exo_exotic::ExoticExperiments;
fn main() {
let mut experiments = ExoticExperiments::new();
let results = experiments.run_all();
println!("Overall Score: {:.2}", results.overall_score());
println!("Collective ฮฆ: {:.4}", results.collective_phi);
println!("Dream Creativity: {:.4}", results.dream_creativity);
}
Theory: Douglas Hofstadter's "strange loops" and Gรถdel's incompleteness theorems.
A strange loop occurs when moving through a hierarchy of levels brings you back to your starting pointโlike Escher's impossible staircases, but in cognition.
use exo_exotic::{StrangeLoop, SelfAspect};
let mut loop_system = StrangeLoop::new(10); // Max 10 levels
// Model the self modeling itself
loop_system.model_self();
loop_system.model_self();
println!("Self-model depth: {}", loop_system.measure_depth()); // 2
// Meta-reasoning: thinking about thinking
let meta = loop_system.meta_reason("What am I thinking about?");
println!("Reasoning about: {}", meta.reasoning_about_thought);
// Self-reference to different aspects
let ref_self = loop_system.create_self_reference(SelfAspect::ReferenceSystem);
println!("Reference depth: {}", ref_self.depth); // 3 (meta-meta-meta)
Key Insight: Confidence decays ~10% per meta-level. Infinite regress is bounded in practice.
Theory: Hobson's activation-synthesis, hippocampal replay, and Revonsuo's threat simulation.
Dreams serve memory consolidation, creative problem-solving, and novel pattern synthesis.
use exo_exotic::{DreamEngine, DreamState};
let mut dreamer = DreamEngine::with_creativity(0.8);
// Add memories for dream content
dreamer.add_memory(vec![0.1, 0.2, 0.3, 0.4], 0.7, 0.9); // High salience
dreamer.add_memory(vec![0.5, 0.6, 0.7, 0.8], -0.3, 0.6); // Negative valence
// Run a complete dream cycle
let report = dreamer.dream_cycle(100);
println!("Creativity score: {:.2}", report.creativity_score);
println!("Novel combinations: {}", report.novel_combinations.len());
println!("Insights: {}", report.insights.len());
// Check for lucid dreaming
if dreamer.attempt_lucid() {
println!("Achieved lucid dream state!");
}
Key Insight: Creativity = novelty ร 0.7 + coherence ร 0.3. High novelty alone produces noise; coherence grounds innovation.
Theory: Karl Friston's Free Energy Principleโthe brain minimizes surprise through prediction.
use exo_exotic::FreeEnergyMinimizer;
let mut brain = FreeEnergyMinimizer::with_dims(0.1, 8, 8);
// Add available actions
brain.add_action("look", vec![0.8, 0.1, 0.05, 0.05], 0.1);
brain.add_action("reach", vec![0.1, 0.8, 0.05, 0.05], 0.2);
brain.add_action("wait", vec![0.25, 0.25, 0.25, 0.25], 0.0);
// Process observations
let observation = vec![0.7, 0.1, 0.1, 0.1, 0.0, 0.0, 0.0, 0.0];
let error = brain.observe(&observation);
println!("Prediction error: {:.4}", error.surprise);
// Learning reduces free energy
for _ in 0..100 {
brain.observe(&observation);
}
println!("Free energy after learning: {:.4}", brain.compute_free_energy());
// Select action via active inference
if let Some(action) = brain.select_action() {
println!("Selected action: {}", action.name);
}
Key Insight: Free energy decreases 15-30% per learning cycle. Precision weighting determines which errors drive updates.
Theory: Turing's reaction-diffusion model (1952)โpatterns emerge from chemical gradients.
use exo_exotic::{MorphogeneticField, CognitiveEmbryogenesis, PatternType};
// Create a morphogenetic field
let mut field = MorphogeneticField::new(32, 32);
// Simulate pattern formation
field.simulate(100);
// Detect emergent patterns
match field.detect_pattern_type() {
PatternType::Spots => println!("Spotted pattern emerged!"),
PatternType::Stripes => println!("Striped pattern emerged!"),
PatternType::Labyrinth => println!("Labyrinthine pattern!"),
_ => println!("Mixed pattern"),
}
println!("Complexity: {:.4}", field.measure_complexity());
// Grow cognitive structures
let mut embryo = CognitiveEmbryogenesis::new();
embryo.full_development();
println!("Structures formed: {}", embryo.structures().len());
Key Insight: With f=0.055, k=0.062, spots emerge in ~100 steps. Pattern complexity plateaus as system reaches attractor.
Theory: IIT extended to multi-agent systems, Global Workspace Theory, swarm intelligence.
use exo_exotic::{CollectiveConsciousness, HiveMind, SubstrateSpecialization};
let mut collective = CollectiveConsciousness::new();
// Add cognitive substrates
let s1 = collective.add_substrate(SubstrateSpecialization::Perception);
let s2 = collective.add_substrate(SubstrateSpecialization::Processing);
let s3 = collective.add_substrate(SubstrateSpecialization::Memory);
let s4 = collective.add_substrate(SubstrateSpecialization::Integration);
// Connect them
collective.connect(s1, s2, 0.8, true);
collective.connect(s2, s3, 0.7, true);
collective.connect(s3, s4, 0.9, true);
collective.connect(s4, s1, 0.6, true); // Feedback loop
// Compute global consciousness
let phi = collective.compute_global_phi();
println!("Collective ฮฆ: {:.4}", phi);
// Share memories across the collective
collective.share_memory("insight_1", vec![0.1, 0.2, 0.3], s1);
// Broadcast to global workspace
collective.broadcast(s2, vec![0.5, 0.6, 0.7], 0.9);
// Hive mind voting
let mut hive = HiveMind::new(0.6); // 60% consensus threshold
let proposal = hive.propose("Expand cognitive capacity?");
hive.vote(proposal, s1, 0.8);
hive.vote(proposal, s2, 0.7);
hive.vote(proposal, s3, 0.9);
let result = hive.resolve(proposal);
println!("Decision: {:?}", result);
Key Insight: ฮฆ scales quadratically with connections. Sparse hub-and-spoke achieves ~70% of full ฮฆ at O(n) cost.
Theory: Eagleman's research on subjective time, scalar timing theory, temporal binding.
use exo_exotic::{TemporalQualia, SubjectiveTime, TimeMode, TemporalEvent};
let mut time_sense = TemporalQualia::new();
// Experience novel events (dilates time)
for i in 0..10 {
time_sense.experience(TemporalEvent {
id: uuid::Uuid::new_v4(),
objective_time: i as f64,
subjective_time: 0.0,
information: 0.8,
arousal: 0.7,
novelty: 0.9, // High novelty
});
}
println!("Time dilation: {:.2}x", time_sense.measure_dilation());
// Enter different time modes
time_sense.enter_mode(TimeMode::Flow);
println!("Flow state clock rate: {:.2}", time_sense.current_clock_rate());
// Add time crystals (periodic patterns)
time_sense.add_time_crystal(10.0, 1.0, vec![0.1, 0.2]);
let contribution = time_sense.crystal_contribution(25.0);
println!("Crystal contribution at t=25: {:.4}", contribution);
Key Insight: High novelty โ 1.5-2x dilation. Flow state โ 0.1x (time "disappears"). Time crystals create persistent rhythms.
Theory: Internal Family Systems (IFS) therapy, Minsky's Society of Mind.
use exo_exotic::{MultipleSelvesSystem, EmotionalTone};
let mut system = MultipleSelvesSystem::new();
// Add sub-personalities
let protector = system.add_self("Protector", EmotionalTone {
valence: 0.3,
arousal: 0.8,
dominance: 0.9,
});
let inner_child = system.add_self("Inner Child", EmotionalTone {
valence: 0.8,
arousal: 0.6,
dominance: 0.2,
});
let critic = system.add_self("Inner Critic", EmotionalTone {
valence: -0.5,
arousal: 0.4,
dominance: 0.7,
});
// Measure coherence
let coherence = system.measure_coherence();
println!("Self coherence: {:.2}", coherence);
// Create and resolve conflict
system.create_conflict(protector, critic);
let winner = system.resolve_conflict(protector, critic);
println!("Conflict resolved, winner: {:?}", winner);
// Activate a sub-personality
system.activate(inner_child, 0.9);
if let Some(dominant) = system.get_dominant() {
println!("Dominant self: {}", dominant.name);
}
// Integration through merging
let integrated = system.merge(protector, inner_child);
println!("Merged into: {:?}", integrated);
Key Insight: Coherence = (beliefs + goals + harmony) / 3. Conflict resolution improves coherence, validating IFS model.
Theory: Landauer's principle, reversible computation, Maxwell's demon.
use exo_exotic::{CognitiveThermodynamics, CognitivePhase, EscapeMethod};
let mut thermo = CognitiveThermodynamics::new(300.0); // Room temperature
// Landauer cost of erasure
let cost_10_bits = thermo.landauer_cost(10);
println!("Energy to erase 10 bits: {:.4}", cost_10_bits);
// Add energy and perform erasure
thermo.add_energy(10000.0);
let result = thermo.erase(100);
println!("Erased {} bits, entropy increased by {:.4}",
result.bits_erased, result.entropy_increase);
// Reversible computation (no energy cost!)
let output = thermo.reversible_compute(
5,
|x| x * 2, // forward
|x| x / 2, // backward (inverse)
);
println!("Reversible result: {}", output);
// Maxwell's demon extracts work
let demon_result = thermo.run_demon(10);
println!("Demon extracted {:.4} work", demon_result.work_extracted);
// Phase transitions
thermo.set_temperature(50.0);
println!("Phase at 50K: {:?}", thermo.phase()); // Crystalline
thermo.set_temperature(5.0);
println!("Phase at 5K: {:?}", thermo.phase()); // Condensate
println!("Free energy: {:.4}", thermo.free_energy());
println!("Carnot limit: {:.2}%", thermo.carnot_limit(100.0) * 100.0);
Key Insight: Default energy budget (1000) is insufficient for basic operations. Erasure at 300K costs ~200 energy/bit.
Theory: Erik Hoel's causal emergence, downward causation, phase transitions.
use exo_exotic::{EmergenceDetector, AggregationType};
let mut detector = EmergenceDetector::new();
// Set micro-level state (64 dimensions)
let micro_state: Vec<f64> = (0..64)
.map(|i| ((i as f64) * 0.1).sin())
.collect();
detector.set_micro_state(micro_state);
// Custom coarse-graining (4:1 compression)
let groupings: Vec<Vec<usize>> = (0..16)
.map(|i| vec![i*4, i*4+1, i*4+2, i*4+3])
.collect();
detector.set_coarse_graining(groupings, AggregationType::Mean);
// Detect emergence
let emergence_score = detector.detect_emergence();
println!("Emergence score: {:.4}", emergence_score);
// Check causal emergence
let ce = detector.causal_emergence();
println!("Causal emergence: {:.4}", ce.score());
println!("Has emergence: {}", ce.has_emergence());
// Check for phase transitions
let transitions = detector.phase_transitions();
println!("Phase transitions detected: {}", transitions.len());
// Get statistics
let stats = detector.statistics();
println!("Compression ratio: {:.2}", stats.compression_ratio);
Key Insight: Causal emergence > 0 when macro predicts better than micro. Compression ratio of 0.5 often optimal.
Theory: Attractor dynamics, rumination research, escape psychology.
use exo_exotic::{CognitiveBlackHole, TrapType, EscapeMethod, AttractorState, AttractorType};
let mut black_hole = CognitiveBlackHole::with_params(
vec![0.0; 8], // Center of attractor
2.0, // Strength (gravitational pull)
TrapType::Rumination, // Type of cognitive trap
);
// Process thoughts (some get captured)
let close_thought = vec![0.1; 8];
match black_hole.process_thought(close_thought) {
exo_exotic::ThoughtResult::Captured { distance, attraction } => {
println!("Thought captured! Distance: {:.4}, Pull: {:.4}", distance, attraction);
}
exo_exotic::ThoughtResult::Orbiting { distance, decay_rate, .. } => {
println!("Thought orbiting at {:.4}, decay: {:.4}", distance, decay_rate);
}
exo_exotic::ThoughtResult::Free { residual_pull, .. } => {
println!("Thought escaped with residual pull: {:.4}", residual_pull);
}
}
// Orbital decay over time
for _ in 0..100 {
black_hole.tick();
}
println!("Captured thoughts: {}", black_hole.captured_count());
// Attempt escape with different methods
let escape_result = black_hole.attempt_escape(5.0, EscapeMethod::Reframe);
match escape_result {
exo_exotic::EscapeResult::Success { freed_thoughts, energy_remaining } => {
println!("Escaped! Freed {} thoughts, {} energy left",
freed_thoughts, energy_remaining);
}
exo_exotic::EscapeResult::Failure { energy_deficit, suggestion } => {
println!("Failed! Need {} more energy. Try: {:?}",
energy_deficit, suggestion);
}
}
// Define custom attractor
let attractor = AttractorState::new(vec![0.5; 4], AttractorType::LimitCycle);
println!("Point in basin: {}", attractor.in_basin(&[0.4, 0.5, 0.5, 0.6]));
Key Insight: Reframing reduces escape energy by 50%. Tunneling enables probabilistic escape even with insufficient energy.
| Experiment | Application |
|---|---|
| Cognitive Black Holes | Model rumination patterns, design intervention timing |
| Multiple Selves | IFS-based therapy chatbots, personality integration tracking |
| Temporal Qualia | Flow state induction, PTSD time perception therapy |
| Dreams | Nightmare processing, creative problem incubation |
| Experiment | Application |
|---|---|
| Strange Loops | Self-improving AI, metacognitive architectures |
| Free Energy | Active inference agents, curiosity-driven exploration |
| Collective Consciousness | Multi-agent coordination, swarm AI |
| Emergence Detection | Automatic abstraction discovery, hierarchy learning |
| Experiment | Application |
|---|---|
| Morphogenesis | Self-organizing knowledge structures |
| Thermodynamics | Cognitive load optimization, forgetting strategies |
| Temporal Qualia | Productivity time perception, attention training |
| Experiment | Application |
|---|---|
| All modules | Consciousness research platform |
| IIT (Collective) | ฮฆ measurement in artificial systems |
| Free Energy | Predictive processing validation |
| Strange Loops | Self-reference formalization |
Meta-Level: 0 1 2 3 4 5
Confidence: 1.00 0.90 0.81 0.73 0.66 0.59
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Exponential decay bounds infinite regress
| Operation | Energy Cost | Entropy Change |
|---|---|---|
| Erase 1 bit | k_B ร T ร ln(2) | +ln(2) |
| Reversible compute | 0 | 0 |
| Measurement | k_B ร T ร ln(2) | +ln(2) |
| Demon work | -k_B ร T ร ln(2) | -ln(2) local |
Discovery: Default energy budgets are often insufficient. Systems must allocate energy for forgetting.
Compression: 1:1 2:1 4:1 8:1 16:1
Emergence: 0.00 0.35 0.52 0.48 0.31
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Sweet spot at ~4:1 compression ratio
Substrates: 2 5 10 20 50
Connections: 2 20 90 380 2450
Global ฮฆ: 0.12 0.35 0.58 0.72 0.89
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Quadratic connections, sublinear ฮฆ growth
| Condition | Dilation Factor | Experience |
|---|---|---|
| High novelty | 1.5-2.0x | Time slows |
| High arousal | 1.3-1.5x | Time slows |
| Flow state | 0.1x | Time vanishes |
| Routine | 0.8-1.0x | Time speeds |
| Method | Energy Required | Success Rate |
|---|---|---|
| Gradual | 100% escape velocity | Low |
| External force | 80% escape velocity | Medium |
| Reframe | 50% escape velocity | Medium-High |
| Tunneling | Variable | Probabilistic |
| Destruction | 200% escape velocity | High |
Discovery: Reframing (cognitive restructuring) is the most energy-efficient escape method.
// Insight emerges when:
if novelty > 0.7 && coherence > 0.5 {
// Novel enough to be creative
// Coherent enough to be meaningful
generate_insight();
}
| Temperature | Cognitive Phase | Properties |
|---|---|---|
| < 10 | Condensate | Unified consciousness |
| 10-100 | Crystalline | Ordered, rigid thinking |
| 100-500 | Fluid | Flexible, flowing thought |
| 500-1000 | Gaseous | Chaotic, high entropy |
| > 1000 | Critical | Phase transition point |
// Unified experiment runner
pub struct ExoticExperiments {
pub strange_loops: StrangeLoop,
pub dreams: DreamEngine,
pub free_energy: FreeEnergyMinimizer,
pub morphogenesis: MorphogeneticField,
pub collective: CollectiveConsciousness,
pub temporal: TemporalQualia,
pub selves: MultipleSelvesSystem,
pub thermodynamics: CognitiveThermodynamics,
pub emergence: EmergenceDetector,
pub black_holes: CognitiveBlackHole,
}
// Results from all experiments
pub struct ExperimentResults {
pub strange_loop_depth: usize,
pub dream_creativity: f64,
pub free_energy: f64,
pub morphogenetic_complexity: f64,
pub collective_phi: f64,
pub temporal_dilation: f64,
pub self_coherence: f64,
pub cognitive_temperature: f64,
pub emergence_score: f64,
pub attractor_strength: f64,
}
pub use strange_loops::{StrangeLoop, SelfReference, TangledHierarchy};
pub use dreams::{DreamEngine, DreamState, DreamReport};
pub use free_energy::{FreeEnergyMinimizer, PredictiveModel, ActiveInference};
pub use morphogenesis::{MorphogeneticField, TuringPattern, CognitiveEmbryogenesis};
pub use collective::{CollectiveConsciousness, HiveMind, DistributedPhi};
pub use temporal_qualia::{TemporalQualia, SubjectiveTime, TimeCrystal};
pub use multiple_selves::{MultipleSelvesSystem, SubPersonality, SelfCoherence};
pub use thermodynamics::{CognitiveThermodynamics, ThoughtEntropy, MaxwellDemon};
pub use emergence::{EmergenceDetector, CausalEmergence, PhaseTransition};
pub use black_holes::{CognitiveBlackHole, AttractorState, EscapeDynamics};
| Module | Operation | Time | Scaling |
|---|---|---|---|
| Strange Loops | 10-level self-model | 2.4 ยตs | O(n) |
| Dreams | 100 memory cycle | 95 ยตs | O(n) |
| Free Energy | Observation | 1.5 ยตs | O(dยฒ) |
| Morphogenesis | 32ร32 field, 100 steps | 9 ms | O(nยฒ) |
| Collective | 10 substrate ฮฆ | 8.5 ยตs | O(nยฒ) |
| Temporal | 100 events | 12 ยตs | O(n) |
| Multiple Selves | 5-self coherence | 1.5 ยตs | O(nยฒ) |
| Thermodynamics | 10-bit erasure | 0.5 ยตs | O(n) |
| Emergence | 64โ16 detection | 4.0 ยตs | O(n) |
| Black Holes | 100 thoughts | 15 ยตs | O(n) |
| Module | Base | Per-Instance |
|---|---|---|
| Strange Loops | 1 KB | 256 bytes/level |
| Dreams | 2 KB | 128 bytes/memory |
| Collective | 1 KB | 512 bytes/substrate |
| All modules | ~20 KB | Variable |
Each module is grounded in peer-reviewed research:
See report/EXOTIC_THEORETICAL_FOUNDATIONS.md for detailed citations.
MIT OR Apache-2.0
Contributions welcome! Areas of interest:
"Consciousness is not a thing, but a processโa strange loop observing itself."