Red Bull and Mexican racing driver Sergio Perez have reached an agreement to part ways with immediate effect after four seasons, both announced on Wednesday.