agent-readings / Memory and State
The memory stream behind Smallville
The one sentence
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.
Before this paper
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.
The paper asks how to build LLM-driven agents that can remain believable over multiple days of simulated life in a shared environment.
Core idea
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.
Action grammar
Perceive: the agent observes nearby environment, objects, and other agents.
Record: each perception is appended as an observation in the memory stream.
Retrieve: current context queries the stream using recency, importance, and relevance.
Reflect: when recent importance passes a threshold, the model generates questions and insights from retrieved memories.
Executable shape
Evidence
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...
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.
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...
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...
Claim map
The paper instantiates 25 ChatGPT-driven agents in an interactive Smallville sandbox where users can observe and intervene in natural language.
The architecture centers on a memory stream that stores observations, reflections, and plans as natural-language records for later retrieval.
Memory retrieval combines recency, importance, and relevance, where importance is model-scored and relevance uses embedding cosine similarity.
Reflection creates higher-level memories by asking the model to form salient questions from recent records, retrieve evidence, and synthesize cited insights.
Agent infrastructure
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...
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.
Run it
No PoC yet - contributions welcome. A useful local PoC would implement a tiny memory stream with recency/importance/relevance retrieval, periodic reflection, and a two-agent event loop over mocked LLM responses.