The nematode C. elegans is an important model for the study of social behaviors. Recent investigations have shown that a family of small molecule signals, the ascarosides, controls population density sensing and mating behavior. However, despite extensive studies of C. elegans aggregation behaviors, no intraspecific signals promoting attraction or aggregation of wild-type hermaphrodites have been identified. Using comparative metabolomics, we show that the known ascarosides are accompanied by a series of derivatives featuring a tryptophan-derived indole moiety. Behavioral assays demonstrate that these indole ascarosides serve as potent intraspecific attraction and aggregation signals for hermaphrodites, in contrast to ascarosides lacking the indole group, which are repulsive. Hermaphrodite attraction to indole ascarosides depends on the ASK amphid sensory neurons. Downstream of the ASK sensory neuron, the interneuron AIA is required for mediating attraction to indole ascarosides instead of the RMG interneurons, which previous studies have shown to integrate attraction and aggregation signals from ASK and other sensory neurons. The role of the RMG interneuron in mediating aggregation and attraction is thought to depend on the neuropeptide Y-like receptor NPR-1, because solitary and social C. elegans strains are distinguished by different npr-1 variants. We show that indole ascarosides promote attraction and aggregation in both solitary and social C. elegans strains. The identification of indole ascarosides as aggregation signals reveals unexpected complexity of social signaling in C. elegans, which appears to be based on a modular library of ascarosides integrating building blocks derived from lipid β-oxidation and amino-acid metabolism. Variation of modules results in strongly altered signaling content, as addition of a tryptophan-derived indole unit to repellent ascarosides produces strongly attractive indole ascarosides. Our findings show that the library of ascarosides represents a highly developed chemical language integrating different neurophysiological pathways to mediate social communication in C. elegans.