Economically viable water treatment process plants for drinking water purification are a prerequisite for sustainable supply of safe drinking water in the future. However, modern membrane process development experiences a disconnect in this domain: the synthesis of the membrane and the design of the process are decoupled. We propose an optimization strategy to simultaneously design the performance of layer-by-layer nanofiltration membrane modules and the separation process. This approach achieves overall optimal performance by extending the search space and thus exploiting synergies. Better separation performances at a lower cost as compared to conventional optimization strategies can be achieved. The key feature of this optimization framework is the integration of artificial neural networks. This machine-learning technique describes membrane performance as a function of its synthesis protocol. We optimize the design problem rigorously by a deterministic global nonlinear optimization method. Thus, this framework yields membrane synthesis protocols and membrane processes that are optimally tailored to the desired separation task. In a showcase, the simultaneous membrane synthesis and process optimization design achieve immediately favorable results with lower impurities at comparable costs. The process investment and operation costs are compared to a state of the art commercially available membrane for nanofiltration.