GANDI (Genetic Algorithm-based de Novo Design of Inhibitors) is a computational tool for automatic fragment-based design of molecules within a protein binding site of known structure. A genetic algorithm and a tabu search act in concert to join predocked fragments with a user-supplied list of fragments. A novel feature of GANDI is the simultaneous optimization of force field energy and a term enforcing 2D-similarity to known inhibitor(s) or 3D-overlap to known binding mode(s). Scaffold hopping can be promoted by tuning the relative weights of these terms. The performance of GANDI is tested on cyclin-dependent kinase 2 (CDK2) using a library of about 14 000 fragments and the binding mode of a known oxindole inhibitor to bias the design. Top ranking GANDI molecules are involved in one to three hydrogen bonds with the backbone polar groups in the hinge region of CDK2, an interaction pattern observed in potent kinase inhibitors. Notably, a GANDI molecule with very favorable predicted binding affinity shares a 2-N-phenyl-1,3-thiazole-2,4-diamine moiety with a known nanomolar inhibitor of CDK2. Importantly, molecules with a favorable GANDI score are synthetic accessible. In fact, eight of the 1809 molecules designed by GANDI for CDK2 are found in the ZINC database of commercially available compounds which also contains about 600 compounds with identical scaffolds as those in the top ranking GANDI molecules.