Caffeine occurs naturally in the nectar of coffee and citrus flowers. A study of honeybees has revealed that those fed on caffeinated nectar were three times more likely to remember a flower's scent than bees fed sugar alone, after 24 hours. After three days, they were still twice as likely to remember the flower than those fed sugar alone.
This is not only evidence for the cognitive powers of caffeine, but (amusingly) evidence of “how plants can manipulate animals' memories to improve their odds of pollination” (never thought of it that way!). This is not, of course, the primary purpose of caffeine, which plants use as a defense mechanism against insects.
(2013). Caffeine in Floral Nectar Enhances a Pollinator's Memory of Reward.
Science. 339(6124), 1202 - 1204.