Join the Menttor community
Access accelerated AI inference, track progress, and collaborate on roadmaps with students worldwide.
Generative Agents
Park, J. S., O'Brien, J. C., Cai, C. J., Morris, M. R., Liang, P., & Bernstein, M. S. (2023). Generative agents: Interactive simulacra of human behavior. arXiv preprint arXiv:2304.03442.
Read Original Paper
In 2023, the 'Generative Agents' paper from Stanford and Google introduced a way to create believable digital characters that can plan their days, form relationships, and coordinate activities autonomously. While previous non-player characters (NPCs) in games relied on rigid scripts or simple state machines, these agents used large language models to simulate the complexity of human life. The researchers populated a sandbox world with 25 agents and observed how individual actions coalesced into social dynamics. It was a shift from programming behaviors to architecting memories.
The Ranked Memory Stream

The generative agent architecture: perceiving, remembering, reflecting, and planning in a continuous loop.
The primary technical shift in Generative Agents was an architecture that prioritized the storage and retrieval of long-term experience via a 'Memory Stream.' Because the context window of a language model is finite, the researchers developed a ranking function to decide which memories to inject into the agent's current prompt. This function weights three specific components: recency, importance, and relevance. Recency uses an exponential decay to prioritize fresh observations, while importance is a score (1â10) generated by the model itself to distinguish mundane tasks from significant life events. Relevance is calculated using cosine similarity between the current situation and historical text. This system revealed that believable behavior is not a result of complex logic, but of a model's ability to recall the right information at the right time.
The Reflection mechanism
To enable agents to generalize from raw observations, the researchers introduced a 'Reflection' mechanism. Without reflection, an agent might remember 'Sam is eating breakfast' multiple times but never realize 'Sam likes to sleep late.' This process is triggered when the importance scores of recent memories exceed a threshold. The agent generates salient questions based on its history, retrieves related memories, and then prompts the model to extract high-level 'insights' or reflections. These reflections are stored back in the Memory Stream as new experiences, effectively creating a deeper layer of personal identity. It proved that intelligence requires a periodic pause to synthesize raw data into abstract concepts, mimicking the human process of self-discovery.
Recursive Planning and Action
Long-term coherence in agent behavior was achieved through a top-down planning system. Agents first generate a broad schedule for the day, which is then recursively refined into detailed 15-minute blocks. This allows an agent to maintain a consistent goalâlike going to workâwhile remaining reactive to immediate environment changes. For instance, if an agent perceives a fire or starts a conversation, it can choose to 're-plan,' adjusting its entire future schedule based on the new context. This approach proved that 'believability' in a simulation is a product of balancing rigid long-term plans with flexible, moment-to-moment reactions. It suggested that the future of agentic systems lies in the ability to bridge the gap between high-level intent and low-level execution.
Dive Deeper
Generative Agents Demo
Stanford ⢠docs
Explore ResourceGenerative Agents Paper on arXiv
arXiv ⢠article
Explore Resource