omega-brain
Unified brain-like cognitive architecture integrating all Omega components into a coherent cognitive system.
Part of the ExoGenesis-Omega cognitive architecture.
Overview
omega-brain is the central integration crate for the Omega cognitive architecture. It combines neural processing, attention, consciousness, memory, sleep, and self-awareness into a single unified system that processes information in a brain-like manner.
The cognitive cycle follows: Perception → Attention → Processing → Consciousness → Memory → Action
Features
- Neural Substrate: Self-contained spiking network with LIF neurons and STDP learning
- Attention System: 40 attention mechanisms with top-down/bottom-up processing
- Consciousness Core: IIT (Phi), Global Workspace Theory, and Free Energy Principle
- Memory System: Hippocampal pattern separation/completion with replay
- Sleep System: SWS/REM consolidation cycles with circadian rhythm
- Self-Awareness: Strange loops, meta-cognition, and self-model
- Runtime Adaptation: MicroLoRA/BaseLoRA, EWC++, and ReasoningBank
Installation
Add this to your Cargo.toml:
[]
= "1.0.0"
Quick Start
use ;
Architecture
┌─────────────────────────────────────────────────────────────────────┐
│ OMEGA BRAIN │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ COGNITIVE CYCLE │ │
│ │ Input → Neural → Attention → Consciousness → Memory → Out │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ ↕ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ NEURAL │ │ ATTENTION │ │CONSCIOUSNESS │ │
│ │ SUBSTRATE │ │ SYSTEM │ │ CORE │ │
│ │ │ │ │ │ │ │
│ │ • LIF Neurons│ │ • 40 Mechs │ │ • IIT (Φ) │ │
│ │ • STDP │ │ • Top-Down │ │ • GWT │ │
│ │ • Neuromod │ │ • Bottom-Up │ │ • Free Energy│ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ ↕ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ MEMORY │ │ SLEEP │ │ SELF │ │
│ │ SYSTEM │ │ SYSTEM │ │ AWARENESS │ │
│ │ │ │ │ │ │ │
│ │ • Hippocampus│ │ • SWS/REM │ │ • Self-Model │ │
│ │ • Replay │ │ • Spindles │ │ • Meta-Cog │ │
│ │ • Consolid. │ │ • Circadian │ │ • Loops │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ ↕ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ RUNTIME ADAPTATION │ │
│ │ MicroLoRA (instant) │ BaseLoRA (long-term) │ EWC++ │ │
│ └─────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────┘
Cognitive Processing
Full Cognitive Cycle
use OmegaBrain;
let brain = new;
// Full processing cycle
let input = vec!;
let result = brain.process?;
// Result contains:
// - output: Processed output vector
// - consciousness_level: 0-1 awareness level
// - attention_strength: How strongly input was attended
// - memory_encoded: Whether input was stored in memory
// - strange_loop_detected: Self-referential processing occurred
// - processing_time_ms: Cycle duration
Directed Cognition
// Think about a specific topic
let topic = encode;
let thought = brain.think_about?;
// Recall a memory
let cue = encode;
if let Some = brain.recall?
// Store a new memory
let content = encode;
brain.remember?; // High importance
Sleep and Consolidation
// Enter sleep mode
brain.sleep?;
// During sleep, memories are consolidated
// SWS: Declarative memory consolidation
// REM: Procedural and emotional memory
// Check if dreaming (REM sleep)
if brain.is_dreaming
// Wake up
brain.wake?;
// Force consolidation without full sleep
let consolidated = brain.consolidate_memories?;
println!;
Brain State and Metrics
State Monitoring
let state = brain.state;
println!;
println!;
println!;
println!;
println!;
println!;
println!;
println!;
if let Some = state.sleep_stage
Metrics
let metrics = brain.metrics;
println!;
println!;
println!;
println!;
println!;
println!;
println!;
println!;
Configuration
use ;
let config = BrainConfig ;
let brain = with_config;
Runtime Adaptation
The brain uses continuous learning mechanisms inspired by ruvector-sona:
MicroLoRA (Instant Adaptation)
use ;
// MicroLoRA: Rank 1-2 for immediate context adaptation
let config = LoRAConfig ;
let mut adapter = new;
// Instant adaptation
adapter.update;
let adapted = adapter.apply;
BaseLoRA (Long-Term Learning)
// BaseLoRA: Rank 4-16 for skill acquisition
let config = LoRAConfig ;
EWC++ (Preventing Catastrophic Forgetting)
use EWCPlusPlus;
let mut ewc = new; // dim=32, lambda=1000
// Update Fisher information with gradients
ewc.update_fisher;
// Store optimal weights after learning a task
ewc.store_optimal;
// Compute regularization penalty
let penalty = ewc.penalty;
ReasoningBank (Pattern Storage)
use ;
let mut bank = new; // 10 clusters, 1000 max
// Store successful reasoning patterns
let pattern = ReasoningPattern ;
bank.store;
// Retrieve similar patterns
let similar = bank.retrieve;
Self-Awareness
The brain maintains a self-model through strange loops:
// Get current self-state
let self_state = brain.self_state;
// Check consciousness level
let consciousness = brain.consciousness_level;
println!;
// Get IIT Phi value
let phi = brain.phi;
println!;
Thread Safety
OmegaBrain uses Arc<RwLock<T>> for all components, enabling safe concurrent access:
use Arc;
use thread;
let brain = new;
// Spawn multiple processing threads
let handles: = .map.collect;
for handle in handles
Integration with Omega
omega-brain is the apex integration layer:
omega-brain (This crate - Unified Integration)
├── Implements own:
│ ├── neural_substrate (LIF, STDP, neuromodulation)
│ ├── attention_system (40 mechanisms)
│ ├── consciousness_core (IIT, GWT, FEP)
│ ├── memory_system (hippocampus, replay)
│ ├── sleep_system (SWS, REM, circadian)
│ ├── self_awareness (strange loops, meta-cognition)
│ └── runtime_adaptation (LoRA, EWC++, ReasoningBank)
│
├── Uses:
│ ├── omega-core (Core types)
│ └── parking_lot (Efficient locks)
│
└── Used by:
└── omega-runtime (Production runtime)
Related Crates
- omega-snn - Standalone spiking neural networks
- omega-attention - Standalone attention mechanisms
- omega-consciousness - Standalone consciousness models
- omega-hippocampus - Standalone hippocampal memory
- omega-sleep - Standalone sleep/wake cycles
- omega-strange-loops - Standalone self-reference
- omega-runtime - Production runtime
References
- Hofstadter (2007) "I Am a Strange Loop"
- Tononi (2004) "Integrated Information Theory of Consciousness"
- Baars (1988) "A Cognitive Theory of Consciousness"
- Friston (2010) "The Free-Energy Principle"
- Diekelmann & Born (2010) "Sleep and Memory Consolidation"
- Hu et al. (2021) "LoRA: Low-Rank Adaptation of LLMs"
License
Licensed under the MIT License. See LICENSE for details.