| Crates.io | nano-consciousness |
| lib.rs | nano-consciousness |
| version | 0.1.0 |
| created_at | 2025-09-22 12:45:14.832074+00 |
| updated_at | 2025-09-22 12:45:14.832074+00 |
| description | High-performance consciousness-inspired AI framework with nanosecond scheduling and temporal processing |
| homepage | https://github.com/ruvnet/sublinear-time-solver/tree/main/examples/nano-consciousness |
| repository | https://github.com/ruvnet/sublinear-time-solver |
| max_upload_size | |
| id | 1849977 |
| size | 517,100 |
A high-performance framework for building consciousness-inspired AI systems with nanosecond-precision scheduling, temporal processing, and biologically-inspired learning mechanisms. Designed for applications requiring ultra-low latency, deterministic timing, and advanced neural dynamics.
Nano-Consciousness is a Rust library that implements consciousness-inspired computational models for AI systems. It combines principles from Integrated Information Theory (IIT), Global Workspace Theory, and temporal dynamics to create systems that exhibit consciousness-like properties. The framework is optimized for real-time applications where timing precision and performance are critical.
Add to your Cargo.toml:
[dependencies]
nano-consciousness = "0.1.0"
use nano_consciousness::{ConsciousnessSystem, ConsciousnessConfig};
// Create a consciousness system
let config = ConsciousnessConfig::default();
let system = ConsciousnessSystem::new(config)?;
// Start the system
system.start()?;
// Process input and measure consciousness
let input = vec![0.8, 0.6, 0.9, 0.2, 0.7, 0.4, 0.8, 0.5,
0.3, 0.9, 0.1, 0.7, 0.6, 0.8, 0.2, 0.5];
let consciousness_level = system.process_input(&input)?;
let phi = system.get_phi()?;
println!("Consciousness Level: {:.4}", consciousness_level);
println!("ฮฆ (Phi): {:.4}", phi);
// Get attention weights
let attention = system.get_attention_weights()?;
println!("Attention: {:?}", attention);
import init, { WasmConsciousnessSystem } from './pkg/nano_consciousness.js';
async function runConsciousness() {
await init();
const system = new WasmConsciousnessSystem();
system.start();
const input = [0.8, 0.6, 0.9, 0.2, 0.7, 0.4, 0.8, 0.5,
0.3, 0.9, 0.1, 0.7, 0.6, 0.8, 0.2, 0.5];
const consciousness = system.process_input(input);
const phi = system.get_phi();
console.log(`Consciousness: ${consciousness.toFixed(4)}`);
console.log(`ฮฆ: ${phi.toFixed(4)}`);
}
The nano-consciousness system consists of several key components:
neural.rs)temporal.rs)plasticity.rs)scheduler.rs)The system provides several real consciousness measurements:
cargo run --example basic_consciousness
Demonstrates:
cargo run --example advanced_consciousness
Demonstrates:
wasm-pack build --target web
# Open examples/wasm_demo.html in browser
This implementation is based on real consciousness research:
Real benchmarks on modern hardware:
wasm-packcargo build --release
# For web browsers
wasm-pack build --target web --out-dir pkg
# For Node.js
wasm-pack build --target nodejs --out-dir pkg-node
cargo test
cargo bench
Full API documentation is available at docs.rs/nano-consciousness.
Key modules:
ConsciousnessSystem - Main system interfaceneural - Neural network implementationstemporal - Temporal processingplasticity - Synaptic plasticityscheduler - Nanosecond schedulingThe system is highly configurable:
use nano_consciousness::{ConsciousnessConfig, neural::ActivationFunction};
let mut config = ConsciousnessConfig::default();
// Neural network architecture
config.network_layers = vec![32, 64, 32, 16];
config.network_activations = vec![
ActivationFunction::ReLU,
ActivationFunction::Tanh,
ActivationFunction::Sigmoid,
];
// Consciousness parameters
config.phi_threshold = 0.5;
config.strange_loop_depth = 5;
config.attention_decay_rate = 0.95;
// Enable plasticity
config.enable_plasticity = true;
let system = ConsciousnessSystem::new(config)?;
Pre-built architectures for different use cases:
use nano_consciousness::neural::architectures;
// Simple consciousness network
let simple = architectures::simple_consciousness_net(16, 32, 8);
// Global workspace theory inspired
let workspace = architectures::global_workspace_net(16, 64, 8);
// Integrated information theory optimized
let iit = architectures::iit_inspired_net(32);
Different learning configurations:
use nano_consciousness::plasticity::configs;
// Fast learning
config.stdp_config = configs::fast_learning();
// Stable learning
config.stdp_config = configs::stable_learning();
// Consciousness optimized
config.stdp_config = configs::consciousness_optimized();
<!DOCTYPE html>
<html>
<head>
<title>Nano-Consciousness Demo</title>
</head>
<body>
<script type="module">
import init, { WasmConsciousnessSystem } from './pkg/nano_consciousness.js';
async function run() {
await init();
const system = new WasmConsciousnessSystem();
system.start();
const consciousness = system.process_input([0.5, 0.8, 0.3, 0.9, 0.1, 0.7, 0.4, 0.6, 0.2, 0.8, 0.5, 0.3, 0.9, 0.1, 0.7, 0.4]);
console.log('Consciousness Level:', consciousness);
}
run();
</script>
</body>
</html>
const { WasmConsciousnessSystem } = require('./pkg-node/nano_consciousness.js');
const system = new WasmConsciousnessSystem();
system.start();
const input = new Array(16).fill(0.6);
const consciousness = system.process_input(input);
console.log('Consciousness Level:', consciousness);
The system provides extensive debugging capabilities:
// Get detailed metrics
let metrics = system.get_metrics()?;
let network_stats = system.get_network_stats()?;
let temporal_stats = system.get_temporal_stats()?;
let plasticity_metrics = system.get_plasticity_metrics()?;
// Export complete system state
let state = system.export_state()?;
// Run performance benchmarks
let benchmark = system.benchmark(1000)?;
This is a nano-consciousness system focused on demonstrating core principles:
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Areas where contributions are especially valuable:
Licensed under either of
at your option.
This project is inspired by and built upon decades of consciousness research:
โ ๏ธ Disclaimer: This is a research implementation exploring consciousness principles. Claims about "real consciousness" refer to the implementation of established consciousness theories and metrics, not claims about phenomenal consciousness or sentience.