orka.orchestrator.base module
Base Orchestrator Module
This module contains the core orchestrator base class that handles initialization, configuration management, and setup of core infrastructure components including memory backends, fork management, and error tracking.
The OrchestratorBase
class serves as the foundation for the main
Orchestrator
class through multiple inheritance composition.
Core Responsibilities
- Configuration Management
Loads and validates YAML configuration files
Extracts orchestrator and agent configurations
Handles environment variable overrides
- Infrastructure Setup
Initializes memory backend (Redis or Kafka)
Configures fork group management for parallel execution
Sets up error tracking and telemetry systems
- Runtime State Management
Maintains execution queue and step counters
Generates unique run identifiers for traceability
Tracks overall execution status and metrics
- class orka.orchestrator.base.OrchestratorBase(config_path)[source]
Bases:
object
Base orchestrator class that handles initialization and configuration.
This class provides the foundational infrastructure for the OrKa orchestration framework, including configuration loading, memory backend setup, and core state management. It is designed to be composed with other specialized classes through multiple inheritance.
The class automatically configures the appropriate backend based on environment variables and provides comprehensive error tracking capabilities for monitoring and debugging orchestration runs.
- loader
Configuration file loader and validator
- Type:
- orchestrator_cfg
Orchestrator-specific configuration settings
- Type:
dict
- agent_cfgs
List of agent configuration objects
- Type:
list
- memory
Memory backend instance (Redis or Kafka)
- fork_manager
Fork group manager for parallel execution
- queue
Current agent execution queue
- Type:
list
- run_id
Unique identifier for this orchestration run
- Type:
str
- step_index
Current step counter for traceability
- Type:
int
- error_telemetry
Comprehensive error tracking and metrics
- Type:
dict
- __init__(config_path)[source]
Initialize the Orchestrator with a YAML config file.
Sets up all core infrastructure including configuration loading, memory backend selection, fork management, and error tracking systems.
- Parameters:
config_path (str) – Path to the YAML configuration file
- Environment Variables:
ORKA_MEMORY_BACKEND: Memory backend type (‘redis’ or ‘kafka’, default: ‘redis’) ORKA_DEBUG_KEEP_PREVIOUS_OUTPUTS: Keep previous outputs for debugging (‘true’/’false’) KAFKA_BOOTSTRAP_SERVERS: Kafka broker addresses (for Kafka backend) KAFKA_TOPIC_PREFIX: Topic prefix for Kafka topics (default: ‘orka-memory’) REDIS_URL: Redis connection URL (default: ‘redis://localhost:6380/0’)