The purpose of this study is to devise a Direction Comparison (DC) model that focuses on the agent's memory and investigate the relationship between the search pattern and the memory-related parameter. The DC model compares two directions, the previous one and the current one, and changes the way it moves. As a result, the Lévy walk appears when comparing with new memories, while the Levy walk does not appear when comparing with old memories. We also found that these results were related to the frequency of the rule change.