When a complex earthquake source process is studied using broadband body waveforms, a common problem is finding an adequate layered velocity model for the near-source structure. Tests with several existing crustal models are not sufficient or objective, but an enumerative search scheme to search through a whole possible model space is not practical. We study the feasibility of applying genetic algorithms (GA) to rapidly and effectively explore the model space to find an optimal model for the near-source structure. Our data set consists of multi-station broadband body waveforms of a simple event recorded at teleseismic distances. The near-source velocity structure is approximated by a layered model, and the model parameters include the layer thicknesses and velocities as well as the source depth forming a multi-parameter search space. Test results with synthetic data indicate that optimal models can be found using GA depending on the noise level. When the noise level is low, optimal models are well recovered with small uncertainty. Results with the data of the 1989 earthquakes of Sichuan Province, China, indicate that a three-layer velocity model obtained with GA is in agreement with regional models and better explains the observed waveforms.