Cyclic adenosine monophosphate (cAMP) is a pivotal second messenger in neuronal signaling and plays a central role in the molecular mechanisms underlying learning and memory. cAMP also regulates synaptic plasticity (i.e. long-term potentiation and long-term depression) via protein kinase A (PKA) activation. Our studies suggest that cAMP signaling also controls learning generalization, a cognitive capacity that allows the individual to apply specific knowledge learned in a certain circumstance in a similar one. In this study, we utilized the GAL4/UAS system in Drosophila to express a photoactivatable adenylyl cyclase specifically in distinct neuronal components, including mushroom bodies via OK107-GAL4. This approach enabled precise optogenetic manipulation of adenylyl cyclase activity in freely behaving flies. To test our hypothesis, double transgenic flies and parental controls were exposed to a context and then tested in the same context, in a similar or a different one. By measuring the distance traveled through these contexts, it was possible to assess the memory recall in each one, understanding normal behavior as recognition memory in the same context, generalization in the similar context, and no recalling in the different context. Contrary to our expectations, preliminary results show us that the groups stimulated by light have poor recognition memory, which could mean that the massive increase in cAMP has a detrimental effect on the PKA signaling and poor memory.