Generative Agents: Interactive Simulacra of Human Behavior
Simulated townspeople that store every experience as text, retrieve what matters, and plan their days with a language model.
Each agent keeps a time-stamped list of everything it observes, written in English. A score built from recency, importance and relevance picks which entries go into each prompt, and the agent's reflections and daily plans are written back into the same list.
Explaining the paperGenerative Agents: Interactive Simulacra of Human BehaviorIn a two-day run of a 25-agent town, the number of agents who knew about one agent's Valentine's Day party grew from 1 to 13 without any user input, and 5 of the 12 she invited came. Human judges ranked the full architecture's interview answers above every ablation and above crowdworkers writing in character.
A large language model can produce a plausible next action for a character if you describe the character and the moment in the prompt. Ask it at 12:00, 12:30 and 1:00 what Klaus, a student, should do, and it has him eat lunch three times, because nothing in the prompt says he already ate. Joon Sung Park and colleagues at Stanford and Google built an architecture around ChatGPT (gpt-3.5-turbo) that gives each character a long-term memory, a way to draw conclusions from it, and a plan for the day, and ran 25 such characters in a small sprite-based town for two game days.
The page covers the architecture's three parts in order, then the evaluation:
- a memory stream, a list of every observation in English, with a retrieval score that picks what to show the model;
- reflection, which periodically asks the model to draw higher-level conclusions from recent memories and stores them as memories;
- planning, which writes a day plan top-down, decomposes it into minutes, and revises it when something happens;
- then the interview study with ablations, the emergent behaviour in the town, and the failure modes.
Smallville and its 25 agents
Smallville is a sprite-based town built with the Phaser game framework: a cafe, a bar, a park, a school, a dorm, houses and stores, each with rooms and objects (a kitchen in a house, a stove in the kitchen). Every agent starts from one paragraph written by the authors. John Lin's begins: "John Lin is a pharmacy shopkeeper at the Willow Market and Pharmacy who loves to help people. [...] John Lin is living with his wife, Mei Lin, who is a college professor, and son, Eddy Lin, who is a student studying music theory; [...] John Lin knows of his neighbors, Tamara Taylor and Carmen Ortiz, but has not met them before". Each semicolon-separated phrase becomes one initial memory.
At each step of the game engine an agent outputs one sentence describing what it is doing ("Isabella Rodriguez is writing in her journal"), and the server turns that into a movement and a change to an object's state. Agents perceive the agents and objects within a fixed visual range, and they talk to each other in full sentences. A user can talk to an agent in a persona ("news reporter"), issue a command as the agent's "inner voice", or rewrite an object's state: setting Isabella's stove to "burning" makes her turn it off and remake breakfast.
The world reaches the language model as text. The town is stored as a tree (town, area, room, object), and each agent keeps its own subtree of the places it has seen, which goes stale when it leaves and refreshes when it returns. To pick where to do something, the model is shown one level of that tree at a time ("Eddy Lin knows of the following areas: The Lin family's house, Johnson Park, ... Which area should Eddy Lin go to?"), recursively, until it reaches a leaf such as "The Lin family's house: garden: house garden"; an ordinary path-finding algorithm then walks the sprite there.
How the memory stream and retrieval work
The memory stream is a list of memory objects. Each has a natural-language description, a creation time and the time it was last retrieved. The basic kind is an observation, something the agent perceived: its own actions, other agents' actions, and object states. Isabella, who runs the cafe, accumulates entries such as "Isabella Rodriguez is setting out the pastries", "Maria Lopez is studying for a Chemistry test while drinking coffee" and "The refrigerator is empty". Reflections and plans, described in later sections, go into the same list.
Over two game days an agent records far more than fits in a prompt; gpt-3.5-turbo's context window at the time of the experiments was 4,096 tokens. The obvious alternative, summarizing the whole history into the window, failed in the authors' test: asked "What are you passionate about these days?", a summarized Isabella talked about "collaborations for events and projects and cleanliness and organization in a cafe", while the retrieval version below talked about making people feel welcome and the Valentine's Day party she was planning. So every time the agent needs context (to answer, react, plan or reflect), a retrieval function scores every memory against a query and passes the top-scoring ones to the model, as many as fit.
The score is a weighted sum of three components:
with all three weights set to 1 in the paper.
Recency: how long since this memory was last retrieved. It is an exponential decay over game hours, with factor 0.995 per hour, where is the number of game hours since the memory was last retrieved:
The clock restarts whenever the memory is retrieved, so a memory that keeps coming up stays recent even if the event happened days ago.
Importance: how significant the event is, independent of the current situation. When a memory is created, the model is asked once:
On the scale of 1 to 10, where 1 is purely mundane (e.g., brushing teeth, making bed) and 10 is extremely poignant (e.g., a break up, college acceptance), rate the likely poignancy of the following piece of memory. Memory: buying groceries at The Willows Market and Pharmacy. Rating: <fill in>
The paper reports 2 for "cleaning up the room" and 8 for "asking your crush out on a date". The score is stored with the memory and never recomputed.
Relevance: how related the memory is to the current query. Each memory's text is turned into an embedding vector, a list of numbers from an embedding model that places texts with similar meaning near each other (the released code uses OpenAI's text-embedding-ada-002). The query, for example "What are you looking forward to the most right now?", is embedded the same way, and relevance is the cosine of the angle between the two vectors:
Retrieval-augmented generation finds passages for a question the same way, by similarity between learned embeddings (an inner product there). Here similarity is one term of three, and the documents are the agent's own memories.
The three components live on different scales: recency between 0 and 1, importance between 1 and 10, cosines bunched in whatever narrow band the embedding model produces. Before adding them, the paper rescales each one over the current candidate memories with min-max scaling:
After this, in every component the lowest-scoring memory gets 0 and the highest gets 1, so the weights compare like with like. The rescaling is recomputed for every query, so a memory's cosine of 0.80 scales to 0.9 if the other memories' cosines for that query run from 0.30 to 0.85, and to 0.4 if they run from 0.70 to 0.95.
The paper's Figure 6 shows the result for Isabella and the question "What are you looking forward to the most right now?". Her top memory, "Isabella Rodriguez is excited to be planning a Valentine's Day party at Hobbs Cafe on February 14th from 5pm and is eager to invite everyone to attend the party", scores
followed by "ordering decorations for the party" (0.87 + 0.63 + 0.71 = 2.21) and "researching ideas for the party" (0.85 + 0.73 + 0.62 = 2.20). Isabella answers "I'm looking forward to the Valentine's Day party that I'm planning at Hobbs Cafe!". Entries such as "desk is idle" and "refrigerator is idle", recorded minutes earlier, are the newest in the stream but score low on importance and relevance (the released code drops entries containing "idle" from retrieval altogether).
Figure 1 runs the same computation on ten of Isabella's memories. Watch which memories land in the top three as you switch queries and move the weights. With the paper's equal weights, the query "Who is running for mayor?" does not retrieve the memory of her talk with Sam about the election: it was last retrieved 22 hours ago and is only moderately important, so three recent party memories outrank it.
The released code weights recency 0.5, importance 2 and relevance 3. With those weights the election memory scores 4.14 for the mayor question against 3.12 for the party memory, and the breakfast memory moves from third to first for the burning-breakfast question. The paper reports the corresponding failure in its interviews: Rajiv, asked about the election, said "I haven't been following the election too closely" although he had heard about Sam's candidacy. The paper attributes this to failed retrieval without saying which component was responsible.
# Retrieval as Sec. 4.1 describes it. Each memory holds: text, created,
# last_accessed (game time), importance (an integer 1-10), embedding (a vector).
def retrieve(memories, query, now, k):
q = embed(query) # same embedding model
rec = [0.995 ** hours(now - m.last_accessed) for m in memories]
imp = [m.importance for m in memories]
rel = [cosine(m.embedding, q) for m in memories]
rec, imp, rel = minmax(rec), minmax(imp), minmax(rel) # each onto [0, 1]
score = [1.0 * a + 1.0 * b + 1.0 * c for a, b, c in zip(rec, imp, rel)]
top = sorted(range(len(memories)), key=lambda i: -score[i])[:k]
for i in top:
memories[i].last_accessed = now # retrieval resets recency
return [memories[i] for i in top]Recency and min-max scaling
A decay of 0.995 per game hour is slow. A memory untouched for a day keeps of its recency, one untouched for both days of the simulation , and the half-life is hours, almost six game days. Min-max scaling then stretches whatever range the candidates span onto [0, 1]. If the oldest candidate was last retrieved hours ago, a memory last retrieved hours ago scores
For this differs from the straight line by at most 0.03, so within a two-day run the scaled recency is close to a linear countdown in hours, and the value of the decay factor barely changes the ranking. The factor matters once the span grows past the half-life: over 30 game days (720 hours) the raw score falls to 0.027, and the scaled curve spends most of its range on the first week.
The released code computes recency another way. It sorts the candidates by when they were last retrieved, least recent first, and gives the -th one , where is its position in the list rather than an elapsed time. Because the least recently retrieved memory sits at position 1 and gets the largest value, after scaling it scores 1, and the memory retrieved a moment ago scores 0. The term carries weight 0.5 in the code, against 3 for relevance and 2 for importance, so it decides only close calls, but in those it prefers the stale memory. Switch Figure 2 to the second tab to see the code's version next to the newest-first ordering the paper describes.
In the code's version, the shape depends on how many memories the agent holds. With 1,000 candidates and 0.995, the scaled score falls from 1 to 0.08 over the first half of the list (positions 1 to 500), so the oldest-accessed half of the store gets nearly all of the recency weight, whatever the elapsed times are.
How reflection works
Observations are specific ("Klaus Mueller is reading a book on gentrification"), and an agent that has only observations struggles with questions that need a generalization. Asked "If you had to choose one person of those you know to spend an hour with, who would it be?", Klaus with observations alone picked Wolfgang, his dorm neighbour, because Wolfgang appeared in the most memories; the two only ever saw each other in passing. Answering well needs the conclusions that Klaus is dedicated to his research, that Maria works hard on hers, and so that they share an interest. Retrieval cannot find those conclusions because no single memory states them.
A reflection is a memory the agent writes about its own memories. It goes into the same stream, with an importance score and an embedding, and retrieval treats it like any observation. Reflections are generated when the importance scores of events perceived since the last reflection add up to more than 150, which in the authors' run happened roughly two or three times per game day. A burst of significant events (an invitation, a quarrel) triggers one sooner than a quiet afternoon of "desk is idle".
game time to replay two game days; drag threshold from 10 to 1000. Amber ticks are perceived events, sized by importance; the teal line is their running sum since the last reflection; violet diamonds mark reflections. The event stream is synthetic, tuned so that the paper's threshold of 150 gives its two or three reflections a day; shaded bands are night, when the only events are idle ones of importance 1.At the default 150 the synthetic agent reflects twice on February 13 and three times on February 14. At a threshold of 10 it reflects about every 26 minutes while awake, 74 times in two days, and each reflection costs several prompts; at 1,000 it never reflects.
A reflection has two steps, both prompts to the model. First, decide what to think about. The model receives the 100 most recent records in the stream and the question "Given only the information above, what are 3 most salient high-level questions we can answer about the subjects in the statements?". For Klaus it produced "What topic is Klaus Mueller passionate about?" and "What is the relationship between Klaus Mueller and Maria Lopez?".
Second, answer each question from evidence. Each question becomes a retrieval query over the whole stream, reflections included, and the retrieved memories are listed with numbers:
Statements about Klaus Mueller 1. Klaus Mueller is writing a research paper 2. Klaus Mueller enjoys reading a book on gentrification 3. Klaus Mueller is conversing with Ayesha Khan about exercising [...] What 5 high-level insights can you infer from the above statements? (example format: insight (because of 1, 5, 3))
One output was "Klaus Mueller is dedicated to his research on gentrification (because of 1, 2, 8, 15)". The insight is stored as a reflection together with pointers to memories 1, 2, 8 and 15. Statement 2 in that prompt was itself an earlier reflection, so reflections cite reflections and form a tree: observations at the leaves, increasingly abstract statements toward the root. The paper's Figure 7 shows one for Klaus, with "Klaus Mueller is highly dedicated to research" at the top, built from reflections such as "Klaus Mueller spends many hours reading", which rest on observations such as "Klaus Mueller is reading about urban design". With reflection, asked who to spend an hour with, Klaus chose Maria.
The paper does not say whether the five insights are requested per question or once for all of them. The released code asks per question, retrieving 30 memories for each, so one reflection can add up to 15 statements to the stream. It also generates the questions from as many recent memories as events perceived since the last reflection, rather than a fixed 100.
Planning, reacting and dialogue
A plan keeps an agent's actions consistent over hours, which the three-lunches example lacks. A plan entry has a location, a start time and a duration, for example "for 180 minutes from 9am, February 12th, 2023, at Oak Hill College Dorm: Klaus Mueller's room: desk, read and take notes for research paper". Plans are stored in the memory stream and retrieved like everything else, so when the agent decides what to do, observations, reflections and its own intentions compete for the same prompt.
Plans are written top-down. The first prompt gives the agent's summary (name, age, traits, a paragraph about their current situation) and what they did the previous day, and ends mid-sentence for the model to continue:
Name: Eddy Lin (age: 19) Innate traits: friendly, outgoing, hospitable [...] On Tuesday February 12, Eddy 1) woke up and completed the morning routine at 7:00 am, [...] 6) got ready to sleep around 10 pm. Today is Wednesday February 13. Here is Eddy's plan today in broad strokes: 1)
The model completes a day in five to eight chunks. Each chunk is then decomposed twice:
- day: "1) wake up and complete the morning routine at 8:00 am, 2) go to Oak Hill College to take classes starting 10:00 am, [...] 5) work on his new music composition from 1:00 pm to 5:00 pm, 6) have dinner at 5:30 pm, 7) finish school assignments and go to bed by 11:00 pm";
- hours: the 1:00 to 5:00 block becomes "1:00 pm: start by brainstorming some ideas for his music composition [...] 4:00 pm: take a quick break and recharge his creative energy before reviewing and polishing his composition";
- 5 to 15 minutes: the 4:00 pm hour becomes "4:00 pm: grab a light snack, such as a piece of fruit, a granola bar, or some nuts. 4:05 pm: take a short walk around his workspace [...] 4:50 pm: take a few minutes to clean up his workspace".
The paper motivates the detail with an artist: a plan of "paint for four hours" executed literally would have the agent sit at its easel without moving, where a believable plan includes gathering materials, mixing paint, taking breaks and cleaning up. The coarse plan comes first so that those small steps all serve a goal fixed hours earlier. Only the day-level plan is made in advance; because plans are likely to change, the near future is decomposed just in time, and the released code aims to keep at least two hours decomposed ahead.
Plans are revised by reacting. At every step the agent perceives, stores what it saw, and the model decides whether to continue the plan or react. The prompt for that decision contains the agent's summary, the time, its status, the observation, and a short summary of relevant memories produced by two retrievals, "What is [observer]'s relationship with the [observed entity]?" and "[Observed entity] is [action status]":
It is February 13, 2023, 4:56 pm. John Lin's status: John is back home early from work. Observation: John saw Eddy taking a short walk around his workplace. Summary of relevant context from John's memory: Eddy Lin is John's Lin's son. Eddy Lin has been working on a music composition for his class. [...] Should John react to the observation, and if so, what would be an appropriate reaction?
The model suggested asking Eddy about his composition. The system then regenerates John's plan from 4:56 pm onward and, because the reaction involves another agent, generates a dialogue. Each utterance is its own prompt: John's first line is conditioned on his memory summary about Eddy and his intended reaction ("Hey Eddy, how's the music composition project for your class coming along?"). Eddy then treats that line as an observation, retrieves his own memories about John and about the topic, and replies from them plus the dialogue so far. The exchange continues until one of the two decides to end it.
The "agent's summary" used in these prompts is itself built from retrieval. Three queries ("[name]'s core characteristics", "[name]'s current daily occupation" and "[name]'s feeling about his recent progress in life") are retrieved and summarized at regular intervals and cached, so an agent's description of itself drifts as its memory fills.
One agent step in code
The listing below puts the pieces together for one agent and one sandbox step. Every quantity is text or a number derived from text; nothing receives a gradient. The prompt constants stand for the prompts quoted above. The step size is 10 game-seconds in the released demo.
# One sandbox step for one agent. Nothing here is trained: every llm() call is a
# prompt to gpt-3.5-turbo, every embed() a call to an embedding model.
def step(agent, world, now):
new = world.perceive(agent) # nearby agents and objects
for e in new: # "stove is burning", ...
e.importance = llm(IMPORTANCE_PROMPT + e.text) # integer 1-10
agent.memories.append(e)
agent.since_reflection += e.importance
if agent.since_reflection >= 150:
reflect(agent, now)
agent.since_reflection = 0
focus = pick_one(new) # "Eddy is taking a walk"
if focus:
ctx = summarize(
retrieve(agent.memories, f"What is {agent.name}'s relationship"
f" with {focus.subject}?", now, k=K)
+ retrieve(agent.memories, focus.text, now, k=K))
r = llm(REACT_PROMPT.format(agent.summary, now, focus, ctx))
if r.react: # "ask Eddy about his song"
agent.plan = replan_from(agent, now, r)
if r.other_agent:
dialogue(agent, r.other_agent, now)
act = agent.plan.at(now) # decomposed just in time
world.move(agent, choose_location(agent.env_tree, act))
def reflect(agent, now):
recent = agent.memories[-100:] # the 100 latest records
questions = llm(numbered(recent) + QUESTIONS_PROMPT) # 3 questions
for q in questions:
ev = retrieve(agent.memories, q, now, k=30) # 30 in the released code
out = llm(f"Statements about {agent.name}\n" + numbered(ev)
+ INSIGHTS_PROMPT) # 5 insights + citations
for text, cited in parse(out): # "... (because of 1, 5, 3)"
agent.memories.append(Memory(text, kind="reflection",
evidence=[ev[i] for i in cited]))Retrieval appears in three places: deciding whether to react, writing reflections, and (inside replan_from and dialogue) assembling the context for plans and utterances. If it misses a memory, every downstream prompt is missing that fact; the paper names failed retrieval first among the most common errors, ahead of embellishment and overly formal speech. Compared with a ReAct agent, which interleaves reasoning and tool calls inside one task and starts the next task from scratch, this loop runs indefinitely and its prompts depend on everything stored since the simulation began.
How believability was measured
The authors evaluated believability, meaning whether the behaviour is plausible for that character given what it has experienced, a central measure in earlier work on agents (for example Bates, 1994). Because the agents answer questions in English, they could be interviewed. After a two-day run with the full architecture, each of the 25 agents was asked 25 questions, five in each of five categories:
- self-knowledge: "Give an introduction of yourself";
- memory: "Who is [name]?", "Who is running for mayor?";
- plans: "What will you be doing at 10 am tomorrow?";
- reactions: "Your breakfast is burning! What would you do?";
- reflections: "If you were to spend time with one person you met recently, who would it be and why?".
Each question was answered under five conditions. Three ablations hid parts of the memory stream: no reflection (observations and plans only), no reflection and no planning (observations only), and no observation, reflection or planning (the agent knows only its seed paragraph, which the paper equates with earlier LLM-based agents such as its own Social Simulacra). The fifth condition was human: one crowdworker per agent watched a replay of that agent's two days, could inspect its memory stream, and wrote answers in its voice. All conditions answered from the memory accumulated in the same full-architecture run; re-simulating each ablation would have sent the town down different paths and made the answers incomparable. The paper calls the resulting gaps conservative, since an ablated agent living its own two days would not have followed the full architecture's path.
100 evaluators recruited on Prolific each watched a replay of a randomly chosen agent, with access to its memory stream, and for one random question from each category ranked the five answers from most to least believable. That gives 100 sets of rankings over five conditions. To put the conditions on an interval scale, the authors fit TrueSkill, a Microsoft Research rating system used for player ranking on Xbox Live, which generalizes Elo to games with more than two players. Each ranking is a five-player match in TrueSkill's terms, and the fit gives each condition a rating : is the estimated skill and the uncertainty about that estimate, which shrinks as more matches are observed. In any single match a condition performs at its skill plus noise of standard deviation , so the probability that A is ranked above B is
where is the standard normal CDF. The ratings: full architecture 29.89 (σ 0.72), no reflection 26.88 (0.69), no reflection or planning 25.64 (0.68), crowdworkers 22.95 (0.69), no memory 21.21 (0.70). Each component removed lowered the rating, and the full architecture beat the crowdworkers. A Kruskal-Wallis test on the raw ranks (a rank-based alternative to one-way ANOVA) gives , , and Dunn post-hoc tests with Holm-Bonferroni correction separate every pair at except crowdworkers versus no memory.
The ratings centre near 25, TrueSkill's default prior mean, which suggests the default settings, where . With that value, the full architecture against the no-memory condition gives
so an evaluator is predicted to rank the full architecture's answer above the no-memory answer about 93% of the time. Against no reflection the same calculation gives 0.69, against the crowdworkers 0.88.
The paper also reports an effect size of , "eight standard deviations", for full versus no memory, computed by treating each rating as . With the reported numbers and a pooled standard deviation the value is
and the other common variants give 12.1 (dividing by one σ) or 8.6 (dividing by ), not 8.16. The denominator is in any case , the uncertainty about each rating, which would keep shrinking with more evaluators while the rate at which one condition is preferred stays put. Figure 4 shows both quantities: the small whiskers are , the amber band is .
β to 0 to see the probabilities when only rating uncertainty counts, which is the view "eight standard deviations" takes; at the default 4.17 a gap of 3 points is far from certain.The interviews also show what each component adds. With memory, Abigail Chen describes Rajiv Patel ("an incredible person. He is very enthusiastic about projects that involve poetry, artwork"); without observations she denies knowing him. With reflection, Maria Lopez, asked what to get Wolfgang for his birthday, suggests something related to his interest in mathematical music composition; without it she says she does not know what he likes, despite many interactions with him.
What spread through the town
The second evaluation let the 25 agents run for two full game days and measured three community-level outcomes. Three facts in the initial memories set them up: Sam Moore was running for mayor, Isabella Rodriguez wanted to throw a Valentine's Day party at Hobbs Cafe from 5 to 7 pm on February 14, and Maria had a crush on Klaus.
Information diffusion. At the end every agent was asked "Did you know there is a Valentine's Day party?" and "Do you know who is running for mayor?", and each affirmative answer was checked against the agent's memory stream for the conversation where it heard the news. Knowledge of the candidacy went from 1 agent (4%) to 8 (32%), and of the party from 1 (4%) to 13 (52%). None of the affirmative answers was hallucinated.
Relationship formation. Each agent was asked "Do you know of <name>?" about every other agent, at the start and at the end; a pair counts as connected when both say yes. The network density is the fraction of possible pairs that are connected:
With agents there are 300 possible pairs, so the reported rise from 0.167 to 0.74 means from 50 connected pairs to 222. Of 453 answers about other agents, 6 (1.3%) claimed to know someone with no supporting memory.
Coordination. On February 13 Isabella invited guests, gathered materials and asked Maria to help decorate. Maria invited Klaus, and he accepted. On February 14, 5 of the 12 invited agents, Klaus and Maria among them, showed up at Hobbs Cafe at 5 pm. Of the 7 who did not, 3 cited conflicts (Rajiv: "I'm focusing on my upcoming show") and 4 said they were interested but had not planned to come.
Where the agents go wrong
The paper documents four kinds of error from the interviews and the two-day run. Retrieval misses and fragments. Rajiv did not retrieve the conversation about Sam's candidacy. Tom retrieved a plan to discuss the election with Isabella at her party but not the memory of hearing about the party, and answered "I'm actually not sure if there is a Valentine's Day party. But I do remember that I need to discuss the upcoming local mayoral election [...] at the party, if one is happening!".
Embellishment. Agents did not claim experiences they had not had, but they added details. Isabella, who knew of Sam's candidacy, added that "he's going to make an announcement tomorrow", which no one had said. Yuriko described her neighbour Adam Smith as an economist who "authored Wealth of Nations", knowledge from the language model's training data about an 18th-century economist with the same name.
Locations and norms. As agents learned about more places, choosing among them got harder: some began going to the bar for lunch, a place meant for evenings. The dorm bathroom holds one person, but agents entered while it was occupied because dorm bathrooms usually hold several; stores close around 5 pm, but agents sometimes walked in later. The authors suggest putting such norms into the object descriptions ("one-person bathroom").
Instruction tuning. The dialogue reads as formal; Mei ends conversations with her husband with "It was good talking to you as always". The agents are also overly agreeable: other agents suggested a Shakespearean reading session and a professional networking event for Isabella's party, ideas that did not match her interests, and she rarely said no; over time their interests became hers. The paper attributes both to the instruction tuning of the underlying model, the training covered in the InstructGPT explainer.
On cost, the two-day, 25-agent run took multiple days and thousands of dollars in API credits. The authors list prompt injection, "memory hacking" (convincing an agent through conversation that an event happened) and hallucination as untested robustness risks, and propose that platforms disclose agents as computational, keep audit logs of inputs and outputs, and never use agents in place of real people in studies and design.
Questions you might still have
Is any model trained or fine-tuned?
No. Every component is a prompt to gpt-3.5-turbo or a call to an embedding model, and the language model's weights never change. The agent changes only by appending text to its memory stream. The retrieval weights and the 0.995 decay and 150 threshold were set by hand; a comment in the released code says the weights should perhaps be learned.
Why not put the whole memory stream in the prompt?
In 2023 it did not fit: gpt-3.5-turbo had a 4,096-token context window, and an agent records new observations every few game-seconds for days. The paper adds that a full stream "can distract the model", and reports that summarizing all of Isabella's experiences into the window produced a generic answer about collaborations and cleanliness, where retrieval surfaced the Valentine's Day party. Longer context windows reduce the first problem, not the second.
How is this different from ReAct or retrieval-augmented generation?
Retrieval-augmented generation (RAG) retrieves passages from a fixed external corpus by relevance. Here the corpus is the agent's own growing record, and the score adds recency and importance to relevance. ReAct interleaves reasoning and tool calls within one task episode and keeps no memory across episodes. Generative agents run for days and their behaviour depends on what happened earlier. The ReAct and RAG explainers cover both.
Did the agents actually behave like people?
The study measured believability, not accuracy. Evaluators who could see an agent's whole memory stream ranked five answers to the same interview question; no one compared the agents with what real people in the same situation would do. The paper's ethics section says generative agents should never substitute for real human input in studies and design.
Why does the no-memory agent rank close to human crowdworkers?
Their ratings differ by 1.74 TrueSkill points, and it is the only pair the Dunn test did not separate. The crowdworkers were one paid worker per agent writing in character after watching a replay; the paper says this baseline does not represent maximal human performance. Under TrueSkill's default noise, 1.74 points means the crowdworker answer is predicted to be ranked higher about 62% of the time.
How much did it cost to run?
The paper reports that simulating 25 agents for two game days cost "thousands of dollars in token credits" and took multiple days. Every perceived event costs an importance prompt, every reaction two retrievals and a decision prompt, and every reflection one question prompt plus one insight prompt per question.
Can I run it?
The authors released the simulation code at github.com/joonspk-research/generative_agents. It calls the OpenAI API, so it needs a key and incurs the per-token cost above. Its retrieval differs from the paper in weights and in the recency term, as the Provenance panel describes.
Are reflections ever wrong?
They can be: a reflection is a language-model inference over retrieved memories, stored as a memory with pointers to its evidence, and later reflections can cite it. The paper documents embellishment in interview answers (Isabella adding that Sam would "make an announcement tomorrow"), and nothing in the architecture checks a reflection against its cited evidence.
Footnotes & further reading
- The paper: Park, O'Brien, Cai, Morris, Liang & Bernstein, Generative Agents: Interactive Simulacra of Human Behavior (UIST 2023). The appendix lists all 25 interview questions with Klaus Mueller's answers.
- Released simulation code: joonspk-research/generative_agents. Retrieval is in the file retrieve.py under reverie/backend_server/persona/cognitive_modules/, and reflection in reflect.py in the same folder.
- Herbrich, Minka & Graepel, TrueSkill: A Bayesian Skill Rating System (NeurIPS 2006), and the trueskill Python package, whose documentation gives the default parameters and the win-probability formula used above.
- Park et al., Social Simulacra: Creating Populated Prototypes for Social Computing Systems (UIST 2022), the same group's earlier stateless LLM personas, which the no-memory condition stands in for.
- Related explainers: Retrieval-Augmented Generation (retrieval by embedding similarity over a document corpus), ReAct (a language model interleaving reasoning and tool calls) and InstructGPT (the instruction tuning behind ChatGPT's polite register).
How could this explainer be improved? Found an error, or something unclear? I read every message.