In this study we analyze the effect of working memory capacity on the evolution of cooperation and show a case in which societies with strongly limited memory achieve higher levels of cooperation than societies with larger memory. Agents in our evolutionary model are arranged on a network and interact in a prisoner's dilemma with their neighbors. They learn from their own experience and that of their neighbors in the network about the past behavior of others and use this information when making their choices. Each agent can only process information from her last h interactions. We show that if memory (h) is too short, cooperation does not emerge in the long run. A slight increase of memory length to around 5–10 periods, though, can lead to largely cooperative societies. Longer memory, on the other hand, is detrimental to cooperation in our model.