Artificial intelligence (AI) and Industry 4.0 are gaining ground in industry and also hold great potential in photovoltaic production. In the research project "Self-learning Photovoltaic Factory", or SelFab for short, five research institutes from Baden-Württemberg have been working together with industry for almost two years on intelligent production systems for the solar factory of the future. The aim of the project is to develop the basics of a self-learning factory for plant and mechanical engineering. Tapping into untapped potential through AI could also make it attractive again to locate photovoltaic factories in Germany and Europe. The successes to date suggest that the goals can be achieved by the end of the project in July 2021.