Research Index

Join the Menttor community

Access accelerated AI inference, track progress, and collaborate on roadmaps with students worldwide.

🐢
Research Decoded/Park et al. (2023)

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
Generative Agents

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 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.

Emergent Social Life

The reasoning behind this architecture was to prove that complex social behaviors, such as information diffusion and relationship building, can emerge from simple cognitive primitives. In one experiment, a single agent was given the intent to throw a Valentine's Day party; by the end of the simulation, 12 other agents had heard about it and coordinated their schedules to attend. This revealed that believable social simulation does not require global coordination, but rather a group of individuals who can each reason about their own history and goals. It suggested that social intelligence is an emergent property of having a persistent internal world that is shared through natural language.

Dive Deeper