| Crates.io | omega-consciousness |
| lib.rs | omega-consciousness |
| version | 1.1.0 |
| created_at | 2025-12-10 16:58:00.635683+00 |
| updated_at | 2025-12-12 07:09:56.686678+00 |
| description | Consciousness substrate for ExoGenesis Omega - IIT, Free Energy Principle, and Global Workspace |
| homepage | |
| repository | https://github.com/prancer-io/ExoGenesis-Omega |
| max_upload_size | |
| id | 1978427 |
| size | 99,733 |
Computational substrate for conscious experience implementing IIT, Free Energy Principle, and Global Workspace Theory.
Part of the ExoGenesis-Omega cognitive architecture.
omega-consciousness implements the leading scientific theories of consciousness as computational models:
These theories are implemented as composable modules that work together to create a unified consciousness substrate.
Add this to your Cargo.toml:
[dependencies]
omega-consciousness = "1.0.0"
use omega_consciousness::{ConsciousnessEngine, ConsciousnessConfig};
fn main() {
// Create consciousness engine
let config = ConsciousnessConfig::default();
let mut engine = ConsciousnessEngine::new(config);
// Process input through consciousness system
let input = vec![0.5; 64];
let context = vec![0.3; 64];
let state = engine.process(&input, &context).unwrap();
println!("IIT Phi (Φ): {:.3}", state.phi);
println!("Free Energy: {:.3}", state.free_energy);
println!("Is Conscious: {}", state.is_conscious);
println!("Emergence: {:.3}", state.emergence);
}
┌─────────────────────────────────────────────────────────────┐
│ CONSCIOUSNESS SYSTEM │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ GLOBAL WORKSPACE │ │
│ │ Broadcast │ Competition │ Integration │ │
│ └────────────────────────────────────────────────────────┘ │
│ ↕ │
│ ┌──────────────────┐ ┌──────────────────────────────────┐ │
│ │ IIT (Φ) │ │ FREE ENERGY PRINCIPLE │ │
│ │ │ │ │ │
│ │ • Integration │ │ • Prediction hierarchy │ │
│ │ • Exclusion │ │ • Error minimization │ │
│ │ • Composition │ │ • Active inference │ │
│ └──────────────────┘ └──────────────────────────────────┘ │
│ ↕ │
│ ┌────────────────────────────────────────────────────────┐ │
│ │ EMERGENCE DETECTION │ │
│ │ Downward causation │ Novel powers │ Self-organization│ │
│ └────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
IIT posits that consciousness corresponds to integrated information (Φ).
use omega_consciousness::{PhiComputer, IntegratedInformation};
let mut phi_computer = PhiComputer::new(64);
// Compute Phi for a system state
let state = vec![0.5; 64];
let phi = phi_computer.compute_phi(&state)?;
println!("Integrated information: {:.4}", phi);
// Check against consciousness threshold
let threshold = 0.1;
if phi > threshold {
println!("System is conscious (Φ > {})", threshold);
}
use omega_consciousness::{CauseEffectStructure, Partition};
let phi_computer = PhiComputer::new(16);
// Analyze cause-effect structure
let state = vec![1.0; 16];
let ces = phi_computer.analyze_structure(&state)?;
println!("Cause information: {:.3}", ces.cause_info);
println!("Effect information: {:.3}", ces.effect_info);
println!("Integration: {:.3}", ces.integrated_info);
The FEP models organisms as minimizing surprise/free energy through prediction.
use omega_consciousness::{FreeEnergyMinimizer, PredictiveHierarchy};
// Create 5-level predictive hierarchy
let mut fep = FreeEnergyMinimizer::new(5, 64);
// Process sensory input
let sensory_input = vec![0.5; 64];
let context = vec![0.3; 64];
let (free_energy, prediction_error) = fep.process(&sensory_input, &context)?;
println!("Free energy: {:.3}", free_energy);
println!("Prediction error: {:.3}", prediction_error);
use omega_consciousness::ActiveInference;
let mut inference = ActiveInference::new(64, 4); // 64 state dim, 4 actions
// Select action that minimizes expected free energy
let current_state = vec![0.5; 64];
let action = inference.select_action(¤t_state)?;
println!("Selected action: {}", action);
GWT models consciousness as broadcast of winning content to specialized processors.
use omega_consciousness::{GlobalWorkspace, WorkspaceContent, Coalition};
let mut workspace = GlobalWorkspace::new(7); // Capacity 7
// Multiple contents compete for access
let content1 = WorkspaceContent::new(
vec![0.8; 64],
0.9, // High activation
"visual_perception".to_string(),
);
let content2 = WorkspaceContent::new(
vec![0.5; 64],
0.6, // Lower activation
"auditory_perception".to_string(),
);
workspace.compete(content1);
workspace.compete(content2);
// Broadcast winning content
workspace.broadcast();
// Check what's in workspace
for id in workspace.content_ids() {
println!("Conscious content: {}", id);
}
// Coalitions of related content
let coalition = Coalition::new(vec![
WorkspaceContent::new(vec![0.5; 64], 0.8, "face".to_string()),
WorkspaceContent::new(vec![0.6; 64], 0.7, "voice".to_string()),
WorkspaceContent::new(vec![0.4; 64], 0.6, "name".to_string()),
]);
// Coalition strength is sum of members
println!("Coalition strength: {:.3}", coalition.total_activation());
Detect when new causal powers emerge from system interactions.
use omega_consciousness::{EmergenceDetector, SelfOrganization};
let mut detector = EmergenceDetector::new();
let state = vec![0.5; 64];
let phi = 0.5;
let free_energy = 0.3;
// Detect emergence level
let emergence = detector.detect(&state, phi, free_energy);
println!("Emergence level: {:.3}", emergence);
// Check self-organization
let mut so = SelfOrganization::new();
so.order_parameter = 0.6;
so.entropy = 0.4;
so.complexity = 0.7;
so.criticality = 0.8;
if so.is_self_organizing() {
println!("System is self-organizing");
}
if so.is_critical() {
println!("System is near critical point");
}
use omega_consciousness::CausalPower;
let detector = EmergenceDetector::new();
// Measure causal power at different scales
let micro_state = vec![0.5; 64];
let macro_state = vec![0.5; 16];
let micro_power = detector.measure_causal_power(µ_state);
let macro_power = detector.measure_causal_power(¯o_state);
// Novel macro causation if macro > sum of micro
if macro_power > micro_power {
println!("Downward causation detected!");
}
use omega_consciousness::ConsciousnessConfig;
let config = ConsciousnessConfig {
state_dim: 64, // Dimension of state vectors
hierarchy_levels: 5, // FEP hierarchy depth
workspace_capacity: 7, // GWT workspace size
phi_threshold: 0.1, // Minimum Φ for consciousness
precision_weight: 1.0, // FEP precision weighting
};
let engine = ConsciousnessEngine::new(config);
use omega_consciousness::ConsciousnessState;
let state = engine.process(&input, &context)?;
// Consciousness state includes:
println!("Phi (Φ): {:.3}", state.phi);
println!("Free Energy: {:.3}", state.free_energy);
println!("Prediction Error: {:.3}", state.prediction_error);
println!("Emergence: {:.3}", state.emergence);
println!("Is Conscious: {}", state.is_conscious);
println!("Workspace Contents: {:?}", state.workspace_contents);
println!("Active Coalitions: {}", state.active_coalitions);
omega-brain (Unified Integration)
└── omega-consciousness (This crate)
├── IIT module
├── FEP module
├── GWT module
└── Emergence module
omega-consciousness is used for:
- Determining what content becomes conscious
- Computing Phi for system integration
- Predictive processing of sensory input
- Active inference for action selection
Licensed under the MIT License. See LICENSE for details.