Both living creatures and AI-driven machines need to act quickly and adaptively in response to situations. In psychology and neuroscience, behavior can be categorized into two types—habitual (fast and simple but inflexible), and goal-directed (flexible but complex and slower).