Generative agents are computational characters driven by a large language model and wrapped in an architecture of memory, reflection and planning, designed to produce believable, human-like behavior over long periods inside a simulated environment. Among AI agents, they are the main reference design for social simulation, where the goal is plausible conduct rather than the completion of a user task.
The concept was introduced in 2023 by researchers from Stanford University and Google in a study that placed 25 agents in a sandbox town called Smallville. The agents woke up, went to work, formed opinions, remembered conversations and coordinated a party without being scripted to do so. The approach is also described as generative agent simulation.
How the generative agent architecture works
A generative agent turns a stateless language model into a persistent character by surrounding it with three cooperating modules: a memory stream, a reflection process and a planner. At each time step, the agent perceives its surroundings, retrieves relevant memories, and asks the model to decide its next action in natural language.
The memory stream is a time-stamped log of every observation in natural language, such as a conversation or seeing a stove burning. Because the log quickly exceeds any context window, only a small, ranked subset is placed in the prompt for each decision. The table summarizes the components.
| Component | Content | Purpose |
|---|---|---|
| Memory stream | Time-stamped natural-language records | Complete history of experience |
| Retrieval function | Ranked subset of memories | Fits relevant history into the prompt |
| Reflection | Higher-level inferences | Forms beliefs and generalizations |
| Planning | Daily and hourly action plans | Keeps behavior coherent over time |
| Seed description | Identity, occupation, relationships | Defines the initial character |
Memory retrieval: recency, importance and relevance
Retrieval decides which memories the agent recalls, and it combines three weighted scores into one ranking. Recency decays exponentially with the time since a memory was last accessed, importance is a 1-to-10 rating the language model assigns when the memory is created, and relevance is the embedding similarity between the memory and the current situation.
| Signal | How it is computed | What it favors |
|---|---|---|
| Recency | Exponential decay per game hour | Recent events |
| Importance | Model rating from 1 to 10 | Significant life events |
| Relevance | Cosine similarity of embeddings | Memories related to the moment |
The scores are normalized and summed, and the top memories fill the available prompt budget. This scheme explains why an agent remembers both a recent breakfast and an old breakup when asked about its love life: the second memory scores high on importance and relevance even though it is old.
Reflection and planning
Reflection gives generative agents beliefs that go beyond raw observations. When the summed importance of recent events passes a threshold, the agent asks the model which questions those events raise, retrieves evidence, and writes higher-level insights such as noticing that a neighbor is passionate about research. Reflections are stored back into the memory stream and can themselves be reflected upon, forming a tree of abstractions.
Planning works top-down. The agent first drafts a broad plan for the day, then recursively breaks it into hour-long and five-to-fifteen-minute actions. Plans remain revisable: when an observation is important enough, the agent decides whether to react and re-plan, for example interrupting cooking to deal with a burning pan.
In the original evaluation, removing reflection, planning or observation memory each lowered the believability rated by human evaluators, and the full architecture scored highest. This ablation is the main evidence that each module contributes to coherent behavior.
Generative agents compared with other agent types
Generative agents differ from task-oriented AI agents mainly in their objective. A coding agent or a browser agent is judged by whether it completes a goal; a generative agent is judged by whether its behavior is believable and socially consistent.
| Agent type | Primary objective | Memory model | Typical setting |
|---|---|---|---|
| Generative agents | Believable social behavior | Memory stream with reflection | Simulated towns and games |
| Task-oriented LLM agent | Complete a user goal | Scratchpad and tool results | Software, web, data tasks |
| BDI agent | Rational goal pursuit | Symbolic beliefs and intentions | Classical multi-agent systems |
| Scripted NPC | Fixed game behavior | Hand-authored state machine | Conventional video games |
The memory stream design later influenced practical agent memory systems, which now separate episodic memory, semantic memory and summaries in a similar way, even when the agents pursue ordinary tasks.
Applications and research uses
Generative agents are used wherever plausible human behavior must be produced at scale without hand scripting. Main application areas include:
- Game and virtual world characters that hold memories across sessions and react to player history.
- Social science prototyping, where researchers test how information or norms spread in a population.
- User experience research, simulating personas before recruiting real participants.
- Training and rehearsal environments, such as negotiation or customer-service practice partners.
- Policy and urban scenario exploration, run as qualitative pilots rather than forecasts.
Limitations and risks
The architecture produces believable behavior, not validated human behavior. Simulated populations inherit the language model’s biases, tend toward unusually polite and cooperative conduct, and can hallucinate memories or embellish facts. Treating simulation output as evidence about real people without calibration is a serious methodological error.
Cost is the other major constraint. Every perception, retrieval, reflection and plan step calls the model, so a town of 25 agents running for two simulated days already required substantial compute. Practical systems reduce cost with smaller models, cached plans, batched calls and coarser time steps, each with some loss of fidelity.
Evaluation remains an open problem. Believability is usually judged by human raters or interviews with the agents, which are subjective and hard to reproduce, and long simulations can drift out of character as summaries compress earlier memories. Responsible use therefore pairs simulation with real-world validation and documents the model, prompts and seed personas used.
Stripped to the essentials
A generative agent is a computer character with a diary. It writes down everything it sees and hears. Before it acts, it looks up the most useful diary entries. Sometimes it stops and thinks about what those entries mean.
It also makes a plan for the day and adjusts it when something surprising happens. Put many such characters in one virtual town, and they start to talk, gossip and organize events together. The key point is simple: memory plus reflection plus planning makes a language model act like a consistent person over time.
Where it is applied
A design team for an online community platform wants to test a new moderation and notification policy before launch. It builds a simulation of 200 generative agents, each seeded with a short persona describing age, interests, posting habits and attitude toward rules.
Over a simulated two-week period, the agents post, reply, report content and react to notifications. Their memory streams let them recall earlier conflicts, and reflection produces beliefs such as feeling that the platform is too strict. The team runs the simulation under two policy variants and compares agent complaints and posting rates.
The simulation reveals that frequent warning notifications cause many agents to disengage, a pattern the team then verifies in a small pilot with real users. The outcome is a revised policy with fewer automated warnings, chosen at a fraction of the cost of a full user study.