Energy optimization with AI