Commensal bacteria are believed to have important roles in human health. The mechanisms by which they affect mammalian physiology remain poorly understood, but bacterial metabolites are likely to be key components of host interactions. Here we use bioinformatics and synthetic biology to mine the human microbiota for N-acyl amides that interact with G-protein-coupled receptors (GPCRs). We found that N-acyl amide synthase genes are enriched in gastrointestinal bacteria and the lipids that they encode interact with GPCRs that regulate gastrointestinal tract physiology. Mouse and cell-based models demonstrate that commensal GPR119 agonists regulate metabolic hormones and glucose homeostasis as efficiently as human ligands, although future studies are needed to define their potential physiological role in humans. Our results suggest that chemical mimicry of eukaryotic signalling molecules may be common among commensal bacteria and that manipulation of microbiota genes encoding metabolites that elicit host cellular responses represents a possible small-molecule therapeutic modality (microbiome-biosynthetic gene therapy).