Microbes detect and respond to a variety of environmental signals. Despite lacking a nervous system, microorganisms sense, compute and store information on their external world. Using a combination of computational and experimental approaches, we study how sensory systems evolve, and how memory and learning are implemented in single cells.