The organization and coordination of fish schools provide a valuable model to investigate the genetic architecture of affiliative behaviors, providing a valuable model to determine the molecular mechanisms underlying social behaviours and personalities. We used quantitative genetic methods to phenotype the sociability of guppy selection lines that vary in group alignment and schooling propensity. We found that the two major traits forming the sociability personality axis in this species showed heritability estimates in the high-range of previous estimates across social behaviors, with important cross sex genetic differences. Additionally, we found that evolution of higher coordinated motion increases the sociability of female, but not male, guppies when swimming with unfamiliar conspecifics, a highly relevant trait in a species with fission-fusion social systems in natural populations. We used PoolSeq and RNASeq to assess the molecular mechanisms underlying sociability in this species and find that regulation of genes involved in neuron migration and synaptic function within the social decision network are key in the evolution of schooling, highlighting a crucial role of glutamatergic synaptic function and calcium-dependent signaling processes.