Memory and State

Generative Agents

Generative Agents turns an LLM into a persistent social simulator by logging every experience, retrieving relevant memories, reflecting over them, and planning from them.

8Claims
8Evidence

Why It Matters

This is the most influential memory architecture for agent simulations. It treats memory as an append-only natural-language database where observations, reflections, and plans all become retrievable state.

Problem

  • LLMs can generate plausible single-turn behavior, but long-running agents need consistency across memories, relationships, and plans.
  • A complete event history is too large and distracting to place directly in a prompt.
  • Raw observations alone do not support higher-level inferences such as interests, relationships, or social commitments.
  • Open-world social simulations need coordination across agents, not just isolated question answering.

Key gap: The paper asks how to build LLM-driven agents that can remain believable over multiple days of simulated life in a shared environment.

Method

Represent every agent experience as natural language, retrieve a small relevant subset for each decision, periodically synthesize high-level reflections, and generate plans that are recursively decomposed into concrete actions and dialogue.

  • Initialize each agent from a short natural-language description split into seed memories.
  • At each simulation step, convert world state into natural-language observations and append them to memory.
  • Retrieve memories using normalized recency, importance, and relevance scores with equal weights in the implementation.
  • Generate reflections when accumulated importance from recent events exceeds 150; in practice agents reflect two or three times per day.
  • Generate a broad daily plan, recursively decompose it, and store plans in memory for later retrieval.
  • Prompt the model to continue or react to observations; regenerate plans after reactions when needed.
  • Evaluate agents through human-ranked interviews and a two-day 25-agent end-to-end simulation.

Claims

C1 · paper-supported

The paper instantiates 25 ChatGPT-driven agents in an interactive Smallville sandbox where users can observe and intervene in natural language.

Scope: Introduction and Section 3.

  • E-smallville: The paper connects the architecture to gpt-3.5-turbo and populates a sandbox environment with 25 agents. Users can observe and interact with agents, and the public repository contains the simulation environment.

C2 · paper-supported

The architecture centers on a memory stream that stores observations, reflections, and plans as natural-language records for later retrieval.

Scope: Sections 4 and 4.1.

  • E-memory-stream: The memory stream is described as a database of natural-language records. It stores observations, reflections, and plans, each available for future retrieval and reasoning.

C3 · paper-supported

Memory retrieval combines recency, importance, and relevance, where importance is model-scored and relevance uses embedding cosine similarity.

Scope: Section 4.1.

  • E-retrieval: Retrieval uses recency over sandbox game hours, importance scored by an LLM on a 1-10 poignancy scale, and relevance via embedding cosine similarity. The scores are normalized and equally weighted in the implementation.

C4 · paper-supported

Reflection creates higher-level memories by asking the model to form salient questions from recent records, retrieve evidence, and synthesize cited insights.

Scope: Section 4.2.

  • E-reflection: Reflections are generated when accumulated importance of recent events exceeds 150. The model sees the 100 most recent records, proposes salient high-level questions, retrieves relevant evidence for each question, and stores generated insights with pointers to supporting records. Agents reflect roughly two or three times per day in the implementation.

C5 · paper-supported

Planning is top-down and recursive: agents create broad daily agendas, decompose them to hour-level and 5-15 minute actions, then re-plan when reactions require it.

Scope: Section 4.3.

  • E-planning: Agents generate a broad daily plan, typically divided into five to eight chunks, then recursively decompose it into hour-level and 5-15 minute actions. Plans are stored in memory and may be regenerated after reactions.

C6 · paper-supported

In the controlled interview evaluation, the full architecture was ranked most believable and each removal of observation, planning, or reflection degraded performance.

Scope: Section 6.

  • E-controlled-eval: The study used 100 Prolific evaluators to rank interview answers across five conditions. The full architecture ranked highest; removing reflection, then planning, then observation reduced believability. The paper reports an eight-standard-deviation effect between the full architecture and the no-memory/planning/reflection baseline.

C7 · paper-supported

In the two-day Smallville run, the agents produced information diffusion, relationship formation, and partial coordination around a party seeded by one agent.

Scope: Section 7.1.

  • E-end-to-end: Over two game days, knowledge of Sam's candidacy increased from 1 of 25 agents to 8 of 25, knowledge of Isabella's party increased from 1 of 25 to 13 of 25, network density increased from 0.167 to 0.74, and 5 of 12 invited agents attended the party.

C8 · paper-supported

The paper reports failures from missed retrieval, memory embellishment, location/norm misunderstanding, instruction-tuning artifacts, cost, and possible prompt or memory hacking.

Scope: Sections 6.5.2, 7.2, and 8.2.

  • E-failures: The paper describes failures from missed or incomplete memory retrieval, knowledge embellishment, agents choosing implausible locations or ignoring physical norms, overly formal/cooperative dialogue from instruction tuning, thousands of dollars in token cost for the 25-agent two-day run, and unknown robustness to prompt hacking, memory hacking, and hallucination.

Agent Infrastructure Takeaways

  • The durable object is the memory stream: observations, reflections, and plans are all persisted as queryable state.
  • Reflection is a compaction layer, not just introspection. It turns raw events into higher-level facts that can guide future behavior.
  • Planning and memory should feed each other. Plans become memories, and memories condition plan updates.
  • Social agents are distributed systems with lossy communication: information diffusion, relationship formation, and coordination all depend on retrieval quality.
  • Evaluation needs both component ablations and long-horizon traces. Interviewing agents exposes memory behavior that a final transcript can hide.
  • Agent simulations need provenance and safety policy because false memories, prompt hacking, and tailored persuasion risks are central, not peripheral.

Caveats

  • The paper optimizes for believability, not factual correctness, task success, or safety.
  • The evaluation is small and simulation-specific; the end-to-end results come from one two-day Smallville run.
  • The architecture depends on prompts and ChatGPT behavior, not a learned or verified cognitive model.
  • Memory retrieval failures and embellishments are explicitly observed.
  • The authors report high cost: the 25-agent two-day simulation took multiple days and thousands of dollars in token credits.
  • Robustness to prompt hacking, memory hacking, and hallucination is left for future work.