omega-loops
7 temporal cognitive loops from Reflexive (1ms) to Transcendent (10y) for multi-scale intelligence processing.
Part of the ExoGenesis-Omega cognitive architecture.
Overview
omega-loops implements a hierarchical system of 7 nested temporal loops that enable intelligence systems to operate coherently across vastly different timescales. From millisecond reflexes to decade-long transformations, each loop processes information at its natural temporal scale while coordinating with faster and slower loops.
Inspired by biological cognitive architectures (from reflexes to strategic planning) and extended to cosmic scales, this system enables AI to be simultaneously reactive, adaptive, deliberative, and transformative.
Features
- 7 Temporal Loops: Reflexive (100ms), Reactive (5s), Adaptive (30min), Deliberative (24h), Evolutionary (7d), Transformative (1y), Transcendent (10y)
- Nested Architecture: Faster loops provide input to slower loops
- Cycle Management: Track cycle execution, metrics, and outputs
- Message Bus: Inter-loop communication and coordination
- Loop Executor: Async execution with processors for each loop type
- Metrics Tracking: Cycle count, success rate, average duration
- Graceful Shutdown: Proper cleanup of all running loops
Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
Quick Start
use ;
use HashMap;
async
Core Concepts
The 7 Temporal Loops
Each loop operates at a specific timescale:
-
Reflexive (100ms)
- Immediate sensory-motor coupling
- Reflex actions, emergency responses
- Examples: Collision avoidance, error handling
-
Reactive (5 seconds)
- Fast decision-making
- Pattern recognition, quick responses
- Examples: User interaction, real-time adaptation
-
Adaptive (30 minutes)
- Learning from recent experience
- Short-term optimization
- Examples: Session learning, tactic adjustment
-
Deliberative (24 hours)
- Strategic planning and reasoning
- Goal-directed behavior
- Examples: Daily planning, project management
-
Evolutionary (7 days)
- Systematic improvement and growth
- Habit formation, skill development
- Examples: Weekly retrospectives, skill practice
-
Transformative (1 year)
- Fundamental architectural changes
- Paradigm shifts in capabilities
- Examples: Annual reviews, major upgrades
-
Transcendent (10 years)
- Long-term vision and legacy
- Civilizational-scale patterns
- Examples: Decade planning, generational knowledge
Loop Coordination
Loops interact through:
- Message Bus: Asynchronous communication between loops
- Nested Execution: Faster loops execute within slower loop cycles
- State Sharing: Shared context and memory across loops
- Metrics Propagation: Performance metrics flow between loops
Cycle Execution
Each cycle follows a standard flow:
- Input: Receive context, data, and objectives
- Process: Execute loop-specific logic
- Output: Return results and state changes
- Metrics: Update success rate and timing
Use Cases
1. Real-Time Agent with Multi-Scale Planning
use ;
use HashMap;
let mut engine = new;
engine.initialize.await?;
// Reflexive loop handles immediate responses
spawn;
// Adaptive loop runs every 30 minutes for learning
spawn;
// Deliberative loop runs daily for strategic planning
spawn;
2. Learning System with Hierarchical Consolidation
use ;
let mut engine = new;
engine.initialize.await?;
// Reactive loop: Immediate pattern recognition
let reactive_input = CycleInput ;
engine.execute_cycle.await?;
// Adaptive loop: Consolidate patterns into rules
let adaptive_input = CycleInput ;
engine.execute_cycle.await?;
// Evolutionary loop: Refine and generalize rules
let evolutionary_input = CycleInput ;
engine.execute_cycle.await?;
3. Self-Improving Architecture
use ;
let mut engine = new;
engine.initialize.await?;
// Evolutionary loop: Weekly performance review
let weekly_input = CycleInput ;
engine.execute_cycle.await?;
// Transformative loop: Annual architecture evolution
let yearly_input = CycleInput ;
engine.execute_cycle.await?;
4. Multi-Agent Coordination
use ;
// Each agent has its own loop engine
let mut agent1_engine = new;
let mut agent2_engine = new;
agent1_engine.initialize.await?;
agent2_engine.initialize.await?;
// Reactive coordination between agents
let coord_input = CycleInput ;
agent1_engine.execute_cycle.await?;
agent2_engine.execute_cycle.await?;
// Deliberative planning for collaborative tasks
let planning_input = CycleInput ;
agent1_engine.execute_cycle.await?;
agent2_engine.execute_cycle.await?;
5. Monitoring and Diagnostics
use ;
let mut engine = new;
engine.initialize.await?;
// Run some cycles...
// Check which loops are active
println!;
// Get detailed statistics
let stats = engine.get_stats.await;
for in stats
// Access coordinator for direct loop management
let coordinator = engine.coordinator;
let coord = coordinator.read.await;
for loop_type in all_loops
Examples
Custom Loop Processor
use ;
// Create custom processor for specific loop type
;
Loop Engine with Custom Configuration
use ;
let mut engine = new;
// Access coordinator to customize loop behavior
let coordinator = engine.coordinator;
let mut coord = coordinator.write.await;
// Create loops with custom configurations
for loop_type in all_loops
Architecture
The loop system is structured hierarchically:
┌──────────────────────────────────────────┐
│ LoopEngine │
│ - Initialization & shutdown │
│ - Statistics aggregation │
└────────────┬─────────────────────────────┘
│
▼
┌──────────────────────────────────────────┐
│ LoopCoordinator │
│ - Loop creation & management │
│ - State tracking │
│ - Message bus coordination │
└────────────┬─────────────────────────────┘
│
▼
┌──────────────────────────────────────────┐
│ LoopExecutors (7) │
│ - Reflexive executor │
│ - Reactive executor │
│ - Adaptive executor │
│ - Deliberative executor │
│ - Evolutionary executor │
│ - Transformative executor │
│ - Transcendent executor │
└──────────────────────────────────────────┘
Performance
Loop system performance characteristics:
- Reflexive: <1ms execution overhead
- Reactive: <10ms execution overhead
- Adaptive: <100ms execution overhead
- Higher Loops: Dominated by processing logic
Memory usage: ~1KB per loop + cycle state
Related Crates
- omega-core - Core loop types and traits
- omega-memory - Memory consolidation across loops
- omega-agentdb - Skill and reflexion storage
- omega-meta-sona - Architecture evolution in transformative loop
- omega-runtime - Production orchestration
- omega-persistence - Loop state persistence
- omega-brain - Unified cognitive processing
- omega-sleep - Sleep/wake cycle integration
License
Licensed under the MIT License. See LICENSE for details.