Generative Agents: Simulacra of Believable Human Behaviors
Generative Agents provides an LLM-based agent architecture designed to simulate human behaviors within a sandbox environment. Because human behavior is inherently vast, dynamic, and contextdependent, traditional agents often struggle to produce behavior that appears genuinely human believable. Generative Agents address this by memorizing past experiences, reflecting on them, and generating plans and actions that remain coherent in the moment and over time. They can wake up at fixed times, prepare meals, and go to work; they can also initiate conversations with others, make plans for the future, and coordinate a party.
We will now use examples and prompt templates to illustrate how Generative Agents leverage role-play, memory, planning, and reflection to perform credible social simulations.
Role-Play
This capability is crucial for generative agents, as their high-level agent descriptions shape the types of agents they become. The agent descriptions are composed of three aspects: (i) basic information, which specifies attributes such as the agent's name, age, and innate traits; (ii) current state, which indicates what the agent is presently engaged in, for example, hosting a Valentine's Day party; (iii) lifestyle, which outlines the agent's daily routines, such as when it wakes up and goes to sleep. These aspects are not fixed and can be adapted based on different tasks. To illustrate, we present the description of generative agent Isabella Rodriguez, showing what such a high-level description looks like in practice. These agent descriptions guide their behavior in role-playing, such as by enabling them to generate conversations that reflect their characteristics and make decisions consistent with their preferences.
Example of an agent description
Basic information:
"name": "Isabella Rodriguez",
"age": 34,
"innate": "friendly, outgoing, hospitable",
"learned": "Isabella Rodriguez is a café owner of Hobbs Cafe who loves to make people feel
welcome."
Current state: "Today is the day! Isabella Rodriguez is filled with excitement as the Valentine's Day party at Hobbs Cafe is finally here… Isabella is confident that her efforts will pay off and that the party will be a great success."
Lifestyle: "Isabella Rodriguez goes to bed around 11 pm, awakes up around 6 am."
Memory
Memory in generative agents is stored in a JSON-format database that records and retrieves past information, ensuring consistency with prior experiences. Agent memory consists of three types: (i) event, which records observations of the environment or other agents (e.g., "Isabella Rodriguez is packing her bag"); (ii) chat, which captures conversations with other agents; and (iii) thought, which stores an agent's reflections (e.g., "Maria Lopez is planning something"). Retaining every detail of past history is impractical for LLMs. Generative Agents therefore retrieve memories based on three factors: recency, relevance, and importance. Recency, modeled with an exponential decay function, prioritizes recently accessed memories so that the most recent events remain salient. Relevance, computed via cosine similarity, assigns higher scores to memories related to the current situation. Importance distinguishes mundane from significant experiences by prompting LLMs to rate how meaningful a memory is. We provide an example that demonstrates how to instruct LLMs to assess importance.
Example of rating memory importance
INPUT:
Task: On a scale of 1 to 10, where 1 is purely mundane (e.g., brushing teeth, making the bed) and 10 is extremely poignant (e.g., a breakup, college acceptance), rate the likely poignancy of the following piece of memory.
Memory: buying groceries at The Willows Market and Pharmacy
Rating: <Completed by LLMs>
OUTPUT:
3
Reflection
Over time, an agent's memory may accumulate excessive and redundant records; to address this, the agent can reflect on extended chats and summarizes them into higher-level thoughts. Below is a prompt template for condensing the conversation between Isabella and Francisco about preparing for the Valentine's Day party into one sentence.
Example of reflecting on chats to yield high-level thoughts
INPUT:
Chat:
(Isabella Rodriguez): Francisco! I'm so glad you're here early. The decorations are all set, and the
guests are already asking about tonight's party. How are you feeling?
(Francisco Lopez): Honestly, Isabella, I'm thrilled! This is my first Valentine's event at Hobbs Cafe, and
the atmosphere is perfect. I can't wait ......
Currently: "Today is the day! Isabella Rodriguez is filled with excitement as the Valentine's Day party at Hobbs Cafe is finally here. ...... Isabella is confident that her efforts will pay off and that the party will be a great success."
Task: Summarize the most relevant statements above that can inform (Isabella Rodriguez) in their conversation with Francisco Lopez.
OUTPUT:
Isabella Rodriguez and Francisco Lopez are discussing their excitement for
the
Valentine's Day party at Hobbs Cafe and working together to make his performance engaging and memorable.
Planning
Plans specify a future sequence of actions that promote consistent behavior over time. In generative agents, a daily plan is generated based on the agent's character profile, covering its basic attributes, current state, and lifestyle. Each daily plan comprises ordered entries, each with a location, start time, and duration. After the plan list is generated, the agent executes the entries sequentially and, when circumstances change, adjusts it dynamically based on the current state. Below, we illustrate how Isabella Rodriguez's plan on the Valentine's Day can be generated and represented.
Example of Isabella Rodriguez's planning for Valentine's Day
INPUT:
Character:
Basic Information:
Name: Isabella Rodriguez
Age: 34......
Current State: Today is the day! Isabella Rodriguez is filled with excitement as the
Valentine's Day party at Hobbs Cafe is finally here...
Lifestyle: Isabella Rodriguez goes to bed around 11pm, wakes up around 6am.
Current Date: "Today is the day! Isabella Rodriguez is filled with excitement as the Valentine's Day party at Hobbs Cafe is finally here. ...... Isabella is confident that her efforts will pay off and that the party will be a great success."
Task: Today is (current date). Here is (agent's name)'s plan today in broad strokes
(with times, e.g., lunch at 12:00 p.m., watch TV 7–8 p.m.):
OUTPUT:
06:00 AM: Wake up and complete morning routine
07:00 AM: Prepare breakfast and review final details for the Valentine's Day party
08:00 AM: Open Hobbs Cafe and greet early customers
......
11:00 PM: Clean up with staff and reflect on the success of the event before going to bed
If you find this work helpful, please consider citing our paper:
@article{hu2025hands,
title={Hands-on LLM-based Agents: A Tutorial for General Audiences},
author={Hu, Shuyue and Ren, Siyue and Chen, Yang and Mu, Chunjiang and Liu, Jinyi and Cui, Zhiyao and Zhang, Yiqun and Li, Hao and Zhou, Dongzhan and Xu, Jia and others},
journal={Hands-on},
volume={21},
pages={6},
year={2025}
}