The aromatic herb used in cooking and shown in studies to improve memory is rosemary.
Rosemary (Salvia rosmarinus) is a fragrant Mediterranean herb in the mint family. Its needle-like leaves are used with roasted vegetables, meats, breads, soups, and stews. The plant’s aroma comes largely from volatile compounds such as 1,8-cineole and camphor.
Small human studies have linked rosemary aroma or extracts with aspects of memory and alertness, although this does not mean that eating rosemary prevents memory loss or treats dementia. The effect is best understood as an area of preliminary research rather than a proven medical treatment.
Rosemary is also associated with remembrance in European literature and tradition. Shakespeare famously used it as a symbol of memory in Hamlet, and sprigs have been used in funerals and wartime commemorations. Sage, thyme, and oregano are related culinary herbs, but rosemary is the canonical answer to this question.