Five very different agents, SayCan, ReAct, Voyager, Generative Agents and Tree of Thoughts, fit one blueprint: four kinds of memory and four kinds of action.
Pick an agent and press Run. Watch which memories it reads, which it writes, and what it does to the world. Then we build, piece by piece, the blueprint that describes them all.
You need what a language model is and the idea of an agent that acts in a loop. We build the rest from zero.
Pick an agent. Its available paths light up on the blueprint, and Run walks one episode along them.
The table of which memories, actions and decision steps each agent has is the paper's Table 2 and its Section 5 case studies. The step-by-step order of each episode is a schematic reading of the paper's descriptions, not a trace from the real systems. Framework by Sumers, Yao, Narasimhan and Griffiths (Princeton), arXiv 2309.02427, Transactions on Machine Learning Research, February 2024.
Chapter 0
See why a field that builds agents every week still has no shared way to describe them, and what a blueprint would fix
Read three agent papers in one afternoon. The first says its agent uses tools. The second says it grounds language in the world. The third says it takes actions. Are these three ideas, or one idea with three names? The papers do not say, and each one uses its own words.
That is the problem this paper sets out to fix. Its authors, Theodore Sumers, Shunyu Yao, Karthik Narasimhan and Thomas Griffiths at Princeton, noticed that agents built on large language models were multiplying fast. Each came with custom terminology. It was hard to compare two of them, hard to see how the field was changing, and hard to build a new one from clean parts.
Their answer is a map. It is called CoALA, short for Cognitive Architectures for Language Agents. This chapter explains what problem the map solves. The rest of the lesson builds it, one piece at a time.
First, two words. A language model is a program that reads text and predicts what text comes next. Think of the next-word suggestions on a phone keyboard, scaled up enormously. An agent is a system that repeats a loop: it looks at its situation, picks an action, does it, and looks again. A thermostat is a very small agent. A language agent uses a language model to pick the actions.
The paper draws three levels of this, in its Figure 1. Level A is the plain use. You give the model text and it gives text back. That is how most of natural language processing works, and there is no loop at all.
Level B puts the model in a loop with the outside world. Something turns what the agent sees into text. The model reads it and writes an action. The action runs, the world changes, and the loop turns again. The paper cites SayCan and Inner Monologue as examples.
Level C does something new. The model also manages the agent’s own insides: what it remembers, what it reasons about, what it retrieves, what it learns. The paper calls these cognitive language agents and cites ReAct, Reflexion and Voyager. Switch between the three levels below.
Each level adds one thing to the one before. Choose a level and watch its parts appear in order, from the model outward.
This redraws the paper’s Figure 1 (panels A, B and C) as a build-up. The four internal processes in panel C are the ones the figure names: memory, reasoning, retrieval and learning.
Notice what changed between B and C. In B the model is a decision-maker inside one loop. In C the agent has a second, private loop with its own memory. That second loop is the part the paper sets out to name, because it had no shared vocabulary.
The authors did not invent a new vocabulary from scratch. They noticed that an older field had faced the same problem. For decades, researchers built cognitive architectures: blueprints for a whole thinking machine, naming its memories, its actions and its decision procedure. Those machines were built from production systems, which are collections of if-then rules that rewrite a string of symbols.
The paper’s bet is that a language model is a production system of a new kind. A rule-based system holds a limited set of hand-written rules. A language model holds a huge, learned, fuzzy set of them. If that is true, then the old blueprints should still fit. Chapters 1 to 3 check this bet. Chapters 4 to 8 build the blueprint itself.
This is a conceptual framework. It does not train a model, run a benchmark or report a score. It makes two claims. Looking back, the framework can describe a large body of existing agents in the same few terms. Looking forward, the gaps it exposes point to what has not been tried. Keep this in mind when you read the case studies in Chapter 8: they are descriptions, not measurements.
The framework organizes every agent along three dimensions. First, information storage: a short-term working memory and several long-term memories. Second, an action space: actions that touch the outside world and actions that touch the agent’s own memory. Third, a decision procedure: the loop that chooses the next action. The hero at the top of this page draws all three for five real agents.
Chapter 1
Learn the oldest idea in the paper: a few find-and-replace rules, run in the right order, can compute anything
Open a text editor and use find-and-replace. You tell it: wherever you see cat, write dog. Now imagine you wrote a hundred such rules and let the editor run them over and over until none of them matches. Would that be a computer? Surprisingly, yes. This chapter shows how, because the paper’s whole framework grows from it.
A string is just a row of symbols, like XYZ. A production system is a set of rules that rewrite strings. Each rule has a precondition (what to look for) and an action (what to write instead). The word “production” comes from the logician Emil Post, who in 1943 described logic itself this way: one string “produces” another. The paper writes the simplest rule like this.
On its own, a pile of rules only tells you which strings can be reached from a starting string. It does not say which rule to run first. To turn the pile into an algorithm, you add control flow: a policy that picks one rule when several could fire.
The paper’s example is a Markov algorithm, named for the mathematician Markov. The control flow is simple. List the rules in priority order. At each step, find the first rule on the list that matches anywhere in the string, and apply it to the leftmost match. Some rules also say “halt after this”. The example divides a number by 5. The number is written as strokes, so 11 is eleven vertical bars, and the answer comes out as a quotient and a remainder.
| Priority | Rule | What it does |
|---|---|---|
| 1 | ∗||||| → |∗ | If five strokes follow the star, remove them and drop one stroke on the left. That is one subtraction of 5. |
| 2 | ∗ → ∗, then halt | If a star exists and rule 1 failed, fewer than five strokes remain. Stop. |
| 3 | (the empty string) → ∗ | If no star exists yet, put one at the front. The empty string matches everywhere, so this is the fallback. |
Work the paper’s input, 11 strokes, by hand. Each line is the string, with the rule that made it.
||||||||||| → (rule 3) → ∗||||||||||| → (rule 1) → |∗|||||| → (rule 1) → ||∗| → (rule 2) → halt
Read the final string ||∗| in two halves. Strokes left of the star count how many times we subtracted 5: that is the quotient, 2. Strokes right of the star are what is left over: the remainder, 1. So 11 divided by 5 is 2 remainder 1, which is correct. The whole run took 4 rule applications: one star, two subtractions, one halt.
Now try it yourself with any number from 0 to 27.
Set how many strokes to divide, then press Step to apply one rule, or Run to watch them all. Each row is the string after one rule fires.
The three rules and the input 11 are the paper’s Section 2.2 example. The device applies the rules exactly as listed, so other inputs are real runs of the same algorithm, not drawings.
Look at what the device shows. Nothing in the three rules mentions division. The division is a property of the order in which they fire. A rule that matches too early would break it, which is why the priority list matters. The paper notes that simple productions like these can produce complex behaviour, and that Markov algorithms are Turing complete: given enough rules, they can compute anything a computer can.
Swap rule 3 to the top of the list. The empty string matches every string, so rule 3 now fires first, every time. The algorithm adds a star, then another star, then another, and never reaches the other rules. It does not halt. The rules are the same and the result is a runaway loop. This is the first lesson to carry forward: a rule set is only as good as the policy that chooses among its rules. Later chapters call that policy the decision procedure, and the paper argues that language agents have under-built it.
The idea has a long family tree. Linguists such as Noam Chomsky used string rewriting to describe grammar: a sentence rewrites into a noun phrase and a verb phrase, and so on down to words. Logicians used it to define proof. In the 1960s and 70s, Allen Newell and Herbert Simon took the idea from strings of symbols to rules about goals and the state of the world. That step turns a rewriting system into an agent, and it is the subject of the next chapter.
The device is a few lines of Python. It makes the point that a production system is an ordinary loop: scan the rules in order, apply the first match, repeat.
RULES = [("*|||||", "|*", False), # rule 1: subtract five
("*", "*", True), # rule 2: stop
("", "*", False)] # rule 3: add a star
def run(s): # s is a string of strokes
while True:
for lhs, rhs, halt in RULES: # priority order
if lhs in s:
s = s.replace(lhs, rhs, 1) # leftmost match
if halt:
return s # "||*|" means 2 remainder 1
break
Production systems have three properties that the rest of the paper keeps using. They have state: the current string. They have rules that read the state and change it. And they have control flow that decides which rule runs. Swap strings for text, rules for a language model, and priority order for a program that calls the model, and you have a language agent. Chapter 3 makes that swap exact. First, Chapter 2 shows what happened when researchers added memory and goals to production systems.
Chapter 2
Follow how researchers added memory and a decision cycle to production rules, and see why those architectures faded
Picture a thermostat on your wall. It has no brain, yet it behaves sensibly: it turns the furnace on when the room is cold and off when it is warm. How would you write down what it knows? As rules. Allen Newell and Herbert Simon did exactly that in their 1972 book Human Problem Solving, and the paper reproduces their thermostat as four rules.
Each rule has a precondition about the world and an action. The symbol ∧ means “and”.
| # | Precondition | Action |
|---|---|---|
| 1 | temperature above 70° and below 72° | stop |
| 2 | temperature below 32° | call for repairs, turn on the electric heater |
| 3 | temperature below 70° and the furnace is off | turn on the furnace |
| 4 | temperature above 72° and the furnace is on | turn off the furnace |
This differs from Chapter 1 in one way that matters. The preconditions no longer look at a string. They look at the state of the world: a temperature reading and a furnace switch. The agent needs a place to hold those two facts while it checks the rules. That place is its first piece of memory.
A cognitive architecture is a production system plus the machinery around it that makes it behave like a whole agent: senses, memories and a procedure for choosing what to do. Hundreds of them were built, for psychology models, robots, military simulations and tutoring programs. The paper walks through the best known, Soar, designed by John Laird and colleagues.
Soar splits memory into four kinds, borrowed from psychology. Each has an everyday analogy that is worth holding on to, because the whole paper reuses them.
| Memory | Soar stores | Think of it as |
|---|---|---|
| Working | Current perception, goals, results of recent reasoning | The desk you are working at right now |
| Procedural | The production rules themselves | Habits and skills: how to ride a bike |
| Semantic | Facts about the world | An encyclopaedia you can look things up in |
| Episodic | Sequences of the agent’s past behaviour | A diary of what happened and when |
Only working memory is the “now”. The other three are long-term memory: they persist between decisions. Rules in procedural memory are checked against what is on the desk.
Soar runs one loop, over and over, called the decision cycle. It has three stages, shown in the device below. First, proposal and evaluation: every rule whose precondition matches working memory proposes an action, and other rules rank the proposals. Second, selection: the best proposal is chosen. Third, application: other rules carry the chosen action out, which may change working memory or send a motor command.
Try it on the thermostat. Move the temperature and flip the furnace, and see which rules match.
Set working memory with the slider and the switch. Matching rules light up. Press Apply to run one decision cycle and watch working memory change.
The four rules are the paper’s thermostat example. The cycle (proposal, selection, application) and the impasse behaviour follow the paper’s description of Soar, which creates a subgoal when no action is valid or several tie. Applying rule 3 or 4 flips the furnace; applying rule 1 or 2 changes nothing in this toy.
Drag the temperature to exactly 70 with the furnace off. No rule matches, because rule 3 needs below 70. Soar calls this an impasse: when no action is valid, or several tie, Soar creates a subgoal to resolve it, which is how it breaks a big task into smaller ones. Now set 31 with the furnace off. Rules 2 and 3 both match. The architecture needs a way to rank them, and that is the job of evaluation.
Here is one full cycle, step by step. Working memory says temperature 68 and furnace off. Proposal: rule 1 needs more than 70, so no. Rule 2 needs less than 32, so no. Rule 3 needs less than 70 and furnace off, so yes. Rule 4 needs the furnace on, so no. One proposal. Selection: with only one candidate, there is nothing to rank, so rule 3 wins. Application: the furnace turns on, and working memory is rewritten to say furnace on. On the next cycle, rule 3 no longer matches. The loop has changed the state that drives the next loop.
Two more pieces complete the picture. Grounding connects the architecture to the world: sensors stream perception into working memory, and actuators carry actions out. Soar has run in simulations and on real robots.
And Soar learns, in three ways. It can write facts and experiences straight into semantic and episodic memory, to be retrieved later. It can use reinforcement learning to up-weight rules that gave good results. Most strikingly, it can write brand-new rules into procedural memory, which the paper describes as effectively updating its own source code. Keep that last one in mind. Chapter 6 returns to it as the riskiest thing an agent can do.
Cognitive architectures became less popular in AI over the following decades. The paper names two reasons. They only work in domains you can describe with logical predicates (statements that are plainly true or false), such as “temperature above 70”. And they need many rules written by hand before they do anything useful.
A language model attacks both problems at once. It reads and writes arbitrary text, so the domain does not have to be a tidy logic. And it already holds a vast head start of learned habits (a prior) over what to write next, gained from pre-training on internet text, so nobody has to write the rules. The authors do not claim to put an LLM inside Soar. They import Soar’s design principles, memory, actions and a decision cycle, to organize LLM-based agents.
Chapter 3
See why a prompt is a string, a completion is a rewrite, and every prompting trick is control flow in disguise
Type “I went to the” into your phone. The keyboard suggests market, beach, store. It does not know which one you mean. It knows only that several continuations are plausible, and some are more likely than others. That is the whole job of a language model, and it is also the key to the paper’s central analogy.
Formally, a language model learns a probability for each next token (a word or word piece) given all the tokens before it. The paper writes this as P(wi | w<i). To generate text, you sample one token from that distribution, add it to the text, and repeat. Because there are many ways to continue a text, a language model is a probabilistic input-output system.
Now look at this through the lens of Chapter 1. Call the prompt X and a continuation Y. Completing the text is a rewrite: X becomes X followed by Y. A rule-based system has a fixed set of such rewrites. A language model has an enormous one, and it assigns each possible Y a probability.
The paper therefore calls a language model a probabilistic production system: each time you call it, it samples one rewrite. It draws this as X with a wavy arrow to X Y, where the wave means “sampled”.
The trade is clear. The cost: a production system is made of rules a person can read. A language model is billions of numbers nobody can read, and its randomness makes it hard to analyse or control. The gain: a model pre-trained on internet text arrives with a strong prior, a head start of learned habits, over what to write next, so it solves many tasks out of the box. No one has to write the rules.
Take a small made-up case, with illustrative numbers. For the prompt X = “I went to the”, suppose the model gives market a probability of 0.40, beach 0.30, store 0.20 and everything else together 0.10. Those four numbers add to 1.00. One call draws once from this list. About four calls in ten return market, but any call can return any of them. This is why the same agent, given the same task twice, can take two different paths. Control code wrapped around the model has to expect that.
Here is the paper’s sharpest observation. The model’s weights define a ranking over possible outputs, conditioned on the prompt. So changing the prompt changes the ranking. Early prompt engineers found that adding text before the question, such as a few worked examples, pushed the model toward better answers. Adding text to a string is itself a production. So each prompting method is a sequence of productions. The paper’s Table 1 lists five. Step through them below.
Choose a method, then press Step. Each row is the string after one production. The label on the right says who or what wrote the new part.
The five sequences are the paper’s Table 1: Q is the question, A the answer, O an observation, C a critique. Retrieval is retrieval-augmented generation: look up a Wikipedia passage, then answer. Socratic Models use a vision-language model (VLM) to turn the question’s scene into an observation.
Read the table the way a programmer would. Zero-shot is one sampled rewrite. Few-shot first adds worked examples by a fixed rule, then samples. Retrieval looks up a passage and adds it, then samples. Socratic Models use a second model to describe an image, then the language model reads that description. Self-critique chains three samples: answer, critique the answer, answer again. None of these changes the model. Each only changes the string that the model sees next.
Look at self-critique in the device. It is the first time the control flow lives outside the model: some code decides to call the model again with a longer string. That is a tiny program, and a program is exactly what Chapter 1 called control flow.
The paper builds up in three steps, in its Figure 3. The basic LLM call has four parts: construct a prompt by filling a template with variables, call the model, parse the output string into an action, and execute it. Parsing means cutting a string like Action: search[Paris] into a name and an argument.
def llm_call(template, memory):
prompt = template.format(**memory) # prompt construction
text = llm(prompt) # one sampled rewrite
name, args = parse(text) # string into an action
return execute(name, args) # answer, tool call, motor command
Next, prompt chaining runs a fixed sequence of such calls, as Self-Critique and Selection-Inference do. Finally, a language agent closes the loop with the world: the result of each action becomes part of the next prompt, as in Inner Monologue and ReAct. Each step adds one thing: first more calls, then feedback from outside.
This is the foothold the paper needs. If prompting is control flow, then the old question “what control flow should a production-system agent have?” becomes a new question: what control flow should a language agent have? Cognitive architectures spent decades answering the old one. The next chapters take their answer.
Chapter 4
Sort what an agent knows into working, episodic, semantic and procedural memory, and see why a model alone remembers nothing
Imagine a colleague who wakes up every morning with no memory of yesterday. To get any work done, they read a note on their desk. The note says what they are doing today, what they learned last week, and how their job works. A language model is that colleague. It is stateless: it keeps nothing between calls. Everything it “knows” about your task must be written into the prompt each time.
An agent that works over many steps therefore needs somewhere to keep things between calls. CoALA gives that somewhere a structure. It names four memories. This chapter defines each, with one real example from the paper.
Working memory holds what is active right now, as named variables. It contains the latest perception, the current goal, results of recent reasoning, and anything retrieved from long-term storage. The paper stresses one point. Working memory is a data structure that persists across language model calls, and it is not the same as the context window.
Here is the difference. On each call, the system builds the model’s input from a subset of working memory: a prompt template plus the relevant variables. The model’s output is parsed back into other variables, such as an action name and its arguments, which are stored in working memory again. So working memory is the hub. It connects the model, the long-term memories and the outside world.
working_memory = {
"goal": "bring the user a drink and a snack",
"observation": "kitchen: fridge, table, apple on counter",
"retrieved": [], # filled by retrieval actions
"thought": None, # filled by reasoning actions
}
prompt = TEMPLATE.format(goal=working_memory["goal"], # only a subset
obs=working_memory["observation"])
out = llm(prompt) # stateless call
working_memory["thought"], working_memory["action"] = parse(out) # written back
Notice what the code decides. The template reads only the goal and the observation, not the whole dictionary. That choice is a design decision with a price. Every extra field you copy into the prompt adds its tokens to every call, so the call gets slower and costlier, and more text competes for the model’s attention. Leave a field out and the model cannot use it. Working memory is where an agent’s designer decides what the model gets to see.
Everything that outlives one decision cycle lives in long-term memory. There are three kinds, borrowed from the architectures of Chapter 2.
Episodic memory stores experience from earlier decision cycles: a game trajectory from a past episode, a list of events that happened, a stored input-output example. In Generative Agents, simulated townspeople keep a running list of everything they saw and did. During planning, relevant episodes can be retrieved into working memory.
Semantic memory stores knowledge about the world and about the agent itself. Retrieval-augmented generation, where a model looks up passages from Wikipedia, is a read-only semantic memory in this view. But agents can also write to it. Reflexion has the model reflect on a failed attempt and store a lesson such as “there is no dishwasher in the kitchen”, which is then attached to later prompts.
Procedural memory stores how to do things. The paper says it comes in two forms. One is implicit: the knowledge inside the language model’s weights. The other is explicit: the agent’s own code. That code splits again into procedures that implement actions (reasoning, retrieval, grounding, learning) and the procedure that decides among them. A skill library, like Voyager’s saved Minecraft skills, is explicit procedural memory.
The three differ in how they start. Episodic and semantic memory may begin empty or may not exist at all. Procedural memory cannot: the designer must write enough code to bootstrap the agent. It also differs in risk. The paper warns that writing to procedural memory is significantly riskier than writing to the other two, because one bad write can introduce a bug or let the agent subvert what its designers meant.
Now test your sense of the boundaries. Each card below is a real kind of thing from the paper. Decide where it belongs.
Read the card, then press the memory that holds it. You see the reason after each answer.
The eight items are the paper’s own examples from Section 4.1: Generative Agents, Reflexion, retrieval-augmented generation, Voyager, Soar-style working memory and the LLM weights. Where the paper says a thing is both (the weights are implicit procedural memory), the card follows the paper.
If you hesitated on the weights, that is the paper’s point. A model’s parameters are a form of procedural memory: stored know-how, applied without looking anything up. Changing them is a learning action, covered in Chapter 6.
Why split memory this way? Because each kind answers a different question, and each wants a different store and a different way to read it. “What is happening now?” is working memory. “What did I do last time?” is episodic. “What is true?” is semantic. “How do I do this?” is procedural. Mixing them in one pile of text is what makes many agents hard to reason about.
Chapter 5
Split everything an agent can do into one outside kind and three inside kinds, defined by what each reads and writes
A cook is making soup. She glances at the recipe card. She thinks, “it tastes flat, so it needs salt”. She pencils “less water next time” in the margin. Then she stirs the pot. Four things happened, and only the last one touched the soup. The first three happened inside her head and her notebook.
CoALA makes exactly this split for agents. The action space is the set of everything an agent can do. It has an external part, which acts on the world, and an internal part, which acts on the agent’s own memory. The internal part has three kinds. What separates the four is simple: which place each one reads from and which place it writes to.
| Kind | Reads from | Writes to | The cook |
|---|---|---|---|
| Retrieval | long-term memory | working memory | glances at the recipe |
| Reasoning | working memory | working memory | thinks “it needs salt” |
| Learning | working memory | long-term memory | pencils a note |
| Grounding | working memory | the world (and observations back) | stirs the pot |
Pick one and see where its arrows go on the blueprint.
Choose a kind of action. The lit arrows show what it reads and what it writes. Working memory is always in the middle.
This is the paper’s Figures 4 and 5 redrawn. Which memory a given agent actually reads or writes differs by agent: see the hero and Chapter 8.
Grounding actions connect the agent to something outside itself. The paper’s trick is to treat all of them as a text game: the agent sends a text action and gets a text observation back. A camera image becomes a caption. A robot command is a sentence. It names three kinds of environment. Physical environments mean robots, where a vision-language model turns images into text. Dialogue means talking to humans or other agents, to take instructions, ask for help, or debate. Digital means games, websites, code and APIs. Digital grounding is cheaper and faster than the other two, so it is the usual testbed. A tool, such as a calculator or a search call, is a special single-use digital environment with no state.
A tiny text game shows the shape of it. The observation arrives as a string: You are in a kitchen. You see a fridge, a table and an apple. The agent writes an action string: pick up the apple. The environment replies with a new observation: You now hold the apple. Every grounding exchange has the same two beats. One string goes out and one string comes back. The cost of this simplicity is that anything not expressible as text, such as the exact force of a grip, must be handled by the code or the model that sits between the string and the machine.
A retrieval procedure copies information from a long-term memory into working memory. It can be rule-based, sparse (keyword matching) or dense (matching by meaning with embeddings). Voyager retrieves code skills by dense search. Generative Agents scores each stored event on three things: recency (a rule), importance (the model reasons about it) and relevance (an embedding match).
Take three remembered events and rank them, with illustrative scores from 0 to 1. Event A is old and trivial but on topic: recency 0.2, importance 0.1, relevance 0.9, total 1.2. Event B is yesterday and a big deal but off topic: 0.9, 0.9, 0.2, total 2.0. Event C is recent, mildly important and on topic: 0.8, 0.5, 0.8, total 2.1. The agent retrieves C first, then B. A pure similarity search would have chosen A. This is why the paper calls adaptive, context-specific recall understudied: the right mix depends on the situation.
A reasoning action reads working memory and writes new information back into it. It is the internal action where the language model does the work. The model can summarize the latest observation (ReAct), the latest trajectory (Reflexion) or something it has just retrieved (Generative Agents). The result is used in one of two ways: as extra context for later calls, which helps a decision, or as the thing to be written into long-term memory, which becomes learning.
Reasoning is what the LLM adds to the old cognitive architectures. In Soar, a person had to write the rule that produced each new fact. Here a model call does it, and it can produce new knowledge and heuristics for almost any purpose.
A learning action writes from working memory into long-term memory. It is where an agent changes itself. Chapter 6 takes this up on its own, because the four places an agent can write have very different risks.
One design idea ties the four together. Reasoning and retrieval are the supporting actions. They exist to help the agent choose a grounding action or a learning action, which are the ones that change something that lasts. The decision cycle of Chapter 7 is built around this. Reasoning and retrieval prepare, then one of the other two commits.
Chapter 6
Climb the ladder of places an agent can store what it learned, from a diary entry to its own source code, and see where the risk grows
You finish a hard day at work. What can you do with what you learned? You can jot down what happened in a diary. You can write a rule of thumb on a sticky note. You can practice until the skill is in your hands. Or you can rewrite the company handbook so that everyone does it differently from now on. These four are not equally safe. A wrong diary entry misleads you once. A wrong line in the handbook changes how everything runs.
That is the idea behind CoALA’s learning actions. Learning is defined as writing information to long-term memory. The paper lists a spectrum of what can be written, and the spectrum is also a ladder of rising risk.
Working from the safest rung upward, the paper describes these.
Episodic memory gets new experiences. This is the oldest habit: reinforcement learning agents already store past trajectories. A language agent stores them as text, to retrieve later as examples. Semantic memory gets knowledge distilled from experience. Reflexion has the model reflect on a failed episode and stores “there is no dishwasher in the kitchen”. Generative Agents store reflections such as “I like to ski now”. See the Reflexion lesson for how that loop works in detail.
Next comes the model weights, which the paper counts as implicit procedural memory. Fine-tuning (training the model a little more) can use supervised or imitation learning, reinforcement learning from environment feedback, human feedback or AI feedback. It is costly, so current systems fix a learning schedule. The paper expects agents to decide when and how to fine-tune on their own as training gets cheaper.
The top four rungs are all about agent code, which is explicit procedural memory. The agent can rewrite its reasoning code, such as prompt templates (the APE method infers prompt instructions from examples). It can rewrite its grounding code, such as a library of skills (Voyager). It could rewrite its retrieval code, though the paper says it knows of no recent agent that does. And it could rewrite its learning and decision-making code, which no language agent does today. Try the ladder.
Press a rung number, or tap a row, to see what the agent writes there, which agent does it, and what the paper says about the risk.
The seven rungs and their examples are from the paper’s Section 4.5. The order of risk follows its statements that writing to procedural memory is significantly riskier than to episodic or semantic memory, and that updating learning or decision-making procedures is risky for both function and alignment. The paper does not give a numeric risk score, so the ladder is ordinal, not measured.
Here is a worked case, with illustrative numbers. An agent in a game tries a locked door and fails after 12 steps. At the end of the episode it makes two writes. The first goes to episodic memory: it stores the 12-step trajectory as it happened. That is 1 write and 0 model calls. The second goes to semantic memory: one model call reads the trajectory and produces “the key is in the drawer”, and that sentence is stored. That is 1 write and 1 call. Neither write changed any code or weight, and both can be inspected and deleted. After 50 such episodes, a scheduled fine-tune could fold the best trajectories into the weights, which is a much bigger and slower write.
Pick rung 5, grounding code. Voyager writes a new Minecraft skill as code, but only after the game feedback says the task succeeded. That check guards the library. The paper warns that writing to procedural memory can easily introduce bugs.
Now pick rung 7. An agent that rewrites its own learning or decision code changes the loop that governs everything else. The paper states that updates to these procedures are risky for both the agent’s functionality and its alignment. The same warning covers procedural writes in general. They can introduce bugs, or let an agent subvert what its designers intended. Soar could write new productions. The paper knows of no language agent that updates its learning or decision code, and none that learns better retrieval.
def learn(target, wm):
if target == "episodic": # safest: append what happened
episodic.append(wm["trajectory"])
elif target == "semantic": # distill, then store
semantic.append(reflect(llm, wm["trajectory"]))
elif target == "skill_code": # riskiest of the three: gate on success
if wm["feedback"] == "task succeeded":
skills[wm["name"]] = wm["code"]
Two more points from the paper. First, an RL agent usually fixes one way of learning (such as Q-learning or PPO, two standard methods) and updates parameters. A language agent can pick from many learning procedures, and storing a sentence is far cheaper and quicker than a parameter update. Second, the paper notes that most work adds to memory, while modifying and deleting are understudied. Deleting is a form of unlearning. We return to when an agent should learn in Chapter 10.
Chapter 7
Learn the loop that picks the next action: think of options, score them, choose one, then do it
You are standing in a kitchen, and someone says, “bring me a drink and a snack.” You do not act at random. In a blink you think of options: grab the apple, check the fridge, look for water. You sense which are possible from where you stand. You choose one. Then you do it, look again, and repeat. That small loop is the last piece of CoALA. The paper compares it to a program’s main procedure. This is a routine with no return value that runs in a loop, takes in new perception and calls other procedures.
Each pass through the loop is a decision cycle. Every cycle ends by choosing exactly one committing action: a grounding action that changes the world, or a learning action that changes long-term memory. Before that, the agent plans. During planning, the agent may use reasoning and retrieval as often as it likes, to prepare. The paper splits planning into three sub-stages.
Proposal generates candidate actions. Usually a reasoning call samples one or several grounding actions from the model, sometimes helped by retrieval. In a simple domain, the agent may simply list every action it has. Evaluation assigns a value to each candidate. It may use fixed rules, the model’s own probability for the text (the paper calls it perplexity), a learned value function, or the model reasoning about what would happen. Selection takes the candidates and values and either picks one or rejects them all and goes back to proposal.
After planning comes execution: the chosen action runs through the agent’s code, an observation comes back, and the cycle starts again. Here is the loop as code.
while True:
# planning: reasoning and retrieval prepare the choice
candidates = propose(working_memory) # may call llm, may retrieve
values = evaluate(candidates, working_memory) # rules, LLM value, simulation
action = select(candidates, values) # argmax, softmax or vote
if action is None: # reject all: plan again
continue
# execution: one committing action
observation = execute(action) # grounding or learning
working_memory.update(observation)
The paper names three ways to select. The simplest is to take the highest value. If the candidates are called a and their values v(a), that is the argmax.
The second is a softmax: turn values into probabilities and draw one, so that good candidates are likely but not certain. The third is a majority vote, used when you sample many proposals and keep the most common. The device shows the first two on the kitchen scene.
The robot stands at the kitchen door and was asked for a drink and a snack. Pick how it decides. Bars show the language model’s score, how doable the action is from here, and the two multiplied.
The five actions and every score are illustrative, invented to show the mechanism. The paper says SayCan scores a fixed set of 551 skills with a language model value and a learned value function; multiplying the two is one simple way to combine them, not a claim about SayCan’s exact formula.
Work the numbers once by hand. The five scores from the language model add up to 1.00: water bottle 0.38, apple 0.24, table 0.20, fridge 0.12, sponge 0.06. How doable each is from the door: bottle 0.20 (not in sight), apple 0.90, table 0.95, fridge 0.50, sponge 0.90. Multiply each pair. Bottle: 0.38 × 0.20 = 0.076. Apple: 0.24 × 0.90 = 0.216. Table: 0.20 × 0.95 = 0.190. Fridge: 0.12 × 0.50 = 0.060. Sponge: 0.06 × 0.90 = 0.054.
Look at what changed. If the agent only proposes, it takes the model’s favourite, the water bottle, which it cannot reach. If it evaluates, the apple wins with 0.216. The language model supplied the usefulness, and the second score supplied groundedness. Neither alone chose well. The paper describes this as SayCan balancing a skill’s usefulness against whether it can be done.
Deliberation is not free, and the cost is easy to count. Suppose, as an illustration, that each cycle proposes 5 candidates with 1 call and then evaluates each with 1 call. That is 1 + 5 = 6 model calls per cycle, where propose-only takes 1. Over a 10-step task, deliberate agents make 60 calls against 10. The paper flags this directly: language model calls are slow and expensive, so the benefit of a better plan must be weighed against the price of making it. It calls the weighing metareasoning, and we return to it in Chapter 10.
The paper reads the history of language agents as steady growth of this loop. The first agents just had the model propose an action, or a sequence of actions, or score a fixed set of actions, with no reasoning in between. Next came ReAct, Reflexion, Voyager and Generative Agents, which added reasoning and retrieval before proposing. Most recently, agents began to propose several candidates and evaluate them. Tree of Thoughts and RAP use the model to run breadth-first, depth-first and Monte Carlo tree search, which are standard ways to explore a tree of options. The model proposes thoughts, simulates what follows, and values the outcome.
The paper’s bet is that this is the most underexplored axis. Most work today stops at proposing a single action. Cycles that deliberately propose, evaluate and select are just starting. Chapter 10 returns to what that could buy and what it costs.
Chapter 8
Describe SayCan, ReAct, Voyager, Generative Agents and Tree of Thoughts in the same four terms, and see what each leaves out
A framework is only worth having if it describes things you did not build it for. The paper tests CoALA on five well-known agents from very different corners of the field. They are a kitchen robot, a web question answerer, a Minecraft explorer, a town of simulated people, and a puzzle solver. For each, it asks four questions. What long-term memory can it write? What does it ground to? Which internal actions does it have? How does its decision cycle work?
The results are descriptions, not benchmark scores. The paper does not re-run any of these agents. It re-reads them. So you can try the same exercise. Choose an agent, set the twelve switches you believe describe it, then check against the paper’s Table 2.
Pick an agent. Turn on every cell you think applies. The diagram redraws from your guesses. Press Check to compare with the paper.
The answers are the paper’s Table 2 and its Section 5 text. As in the paper, the memory row lists only writable long-term memory, because every agent also has procedural memory in its code and weights. Generative Agents are grounded to the digital world and to other agents.
SayCan puts a language model on a kitchen robot. A user says, “I just worked out, can you bring me a drink and a snack to recover?” The robot has a fixed menu of 551 grounding skills, such as “find the apple” or “go to the table”. It has no reasoning, retrieval or learning actions. Its only long-term memory is procedural: the language model plus a learned value function. Its decision cycle is evaluation alone: score every skill for usefulness and for whether it can be done now. The paper calls the model a single-step planner, which is what you built in Chapter 7.
ReAct works in digital environments such as the Wikipedia API, a text game or a website. It has no episodic or semantic memory, so it never retrieves or learns. Its action space is reasoning plus grounding, and its cycle is fixed: one reasoning action to analyze and plan, then one grounding action, with no evaluation or selection. The paper calls it the simplest language agent that uses both internal and external actions, and the first to show them working together: reasoning guides acting, and acting supplies feedback that supports the next reasoning. See the ReAct lesson for the full method.
Voyager plays Minecraft through text. Its long-term memory is procedural: a hierarchical library of code skills, such as combatZombie, which may call simpler skills like craftStoneSword. It is the one agent here with all four action kinds. In one cycle it reasons to propose a task and then reasons to write code for it. In the next cycle it reasons over the game feedback. If the task succeeded, it chooses a learning action that adds the code to the library. If not, it refines the code and runs it again. The paper reports that comparisons with ReAct, AutoGPT and ablations without procedural memory verify that long-term memory matters: Voyager explores more, masters the tech tree, and generalizes zero-shot to unseen tasks.
Generative Agents are simulated townspeople in a sandbox game. They also use all four kinds of action. Each keeps an episodic list of events. It retrieves from that list and reasons to form reflections such as “I like to ski now”, which it writes to semantic memory. To decide, it retrieves relevant reflections and reasons to plan its day. While acting it reads a stream of observations and can adjust the plan. It is the only one of the five that writes to two long-term memories, and it learns by chaining two kinds of learning.
Tree of Thoughts (ToT) looks like the opposite of Voyager. It has no long-term memory and only one external action: submitting a final answer to a puzzle such as the game of 24, creative writing or crosswords. Everything it does is reasoning. What sets it apart is the decision procedure: it proposes, evaluates and selects “thoughts” with a tree search, so it can look ahead and back up. It is the only one of the five that uses all three planning sub-stages.
| Agent | Writable long-term memory | External | Internal | Decision |
|---|---|---|---|---|
| SayCan | none | physical | none | evaluate |
| ReAct | none | digital | reason | propose |
| Voyager | procedural | digital | reason, retrieve, learn | propose |
| Generative Agents | episodic, semantic | digital, agent | reason, retrieve, learn | propose |
| Tree of Thoughts | none | digital (submit answer) | reason | propose, evaluate, select |
Count the cells. Of the five agents, 3 have no writable long-term memory, only 2 have a learning action, and 2 evaluate their options, with just 1 of those also selecting among them. Read down the columns and you see the paper’s claim about the field. The memory column is mostly empty, the learning action is rare, and only one agent evaluates and selects among alternatives. The blueprint makes the gaps visible. For the older, closely related memory system, see the MemGPT lesson, and for a broader tour of agent designs, the Agent Architectures lesson.
Chapter 9
Use the blueprint as a checklist: choose the memories, set who may write to each, then design the decision loop
Your team asks you to build a shopping assistant. A customer types what they want, and the assistant finds items in the store’s catalogue. Where do you start? Most people open a prompt file and begin writing. The paper suggests starting somewhere else: with the blueprint. Section 6 turns CoALA from a way of describing agents into a way of designing them, and it does so in three steps.
The paper’s most important suggestion is that agents should be modular, not monoliths. It points to what standard parts did elsewhere. The Markov decision process gave reinforcement learning a shared set of terms (state, action, reward, transition). OpenAI Gym added a shared interface, obs, reward, done, info = env.step(action), so that algorithms and environments could be swapped freely. The paper argues for the same kind of abstractions for language agents: Memory, Action and Agent classes. In a company, one agent library would cut technical debt, because tests and components get reused across teams.
There is a second design choice that runs through everything: what to do with code and what to leave to the model. The agent has two forms of procedural memory. Agent code is deterministic, readable and easy to extend, but brittle when things go in ways the designer did not foresee. Model weights are unreadable but flexible in new situations. The paper’s advice is to use code sparingly, for generic algorithms that cover a language model’s known weaknesses. Its example is tree search, to fix the short-sightedness of generating one word at a time.
Step 1: decide which memories you need. The assistant should know the catalogue, so it needs a semantic memory of items for sale. It should remember each customer’s past purchases and chats, so it needs an episodic memory. It needs procedural memory with functions that query these stores. And it needs working memory to track the current dialogue.
Step 2: define read and write access. For each memory, ask: may the agent read it? May it write? The paper’s answer is precise. The assistant should be able to read and write episodic memory, so it can record new interactions. It should only read semantic and procedural memory, because it should not change the inventory or its own code. Every write you leave switched on is a risk you have accepted.
Step 3: define the decision procedure. This is a trade between performance and generalization. A complex procedure fits one problem better (Voyager for Minecraft). A simple one carries over to other domains (ReAct). For the shop, the paper suggests encouraging retrieval of the customer’s past interactions, as a prior on what they are probably looking for. It suggests an explicit evaluation step that reasons about whether a set of search results will satisfy that intent. And it suggests deferring learning to the end of the interaction, summarizing the whole episode before storing it in episodic memory, which is simpler than learning at every step.
Try the recipe. Eight switches, and the diagram redraws from your design.
Switch on the parts you want. Memories you add appear on the blueprint. A memory the agent may write to gets a warning if writing could damage something.
The recommended settings are the ones the paper gives for its retail assistant in Section 6. They are semantic and episodic memory, write access to episodic only, retrieval of past interactions, an evaluation step, and learning deferred to the end of the chat. The warnings are the paper’s stated reasons: the assistant should not update the inventory or its own code.
Flip the procedural-write switch on. A warning appears on the procedural box. That is the paper’s point about the code rung of Chapter 6: an assistant that can rewrite its own query functions can also break them. Now switch the evaluation step off. The diagram loses the “scores results” tag, and the assistant will return whatever the first search gives. Nothing crashes. The assistant just gets worse in a way that is hard to see, which is the usual price of cutting a stage.
Notice that none of these choices was about the prompt. They were about structure: what is stored, who may change it, and how the loop runs. That is the shift the paper wants. Prompt wording matters, but it sits inside a design, and a design with the wrong write access cannot be rescued by a better prompt.
The paper adds two cautions about the action space. First, a bigger action space means a harder decision problem. More capable agents like Voyager and Generative Agents have more actions and need more hand-built decision procedures. So take the minimal action space that solves the task. Second, some actions are riskier than others. Learning actions, especially modifying or deleting procedures, can harm the agent from inside. Grounding actions, such as rm in a terminal or harmful speech, can harm the world. Today’s safeguards are mostly task-specific heuristics, and the paper says richer agents may need the action space specified and tested for worst cases.
class Memory: # sketch, not the paper's code
def __init__(self, readable=True, writable=False): ...
def read(self, query): ...
def write(self, item):
assert self.writable, "this agent may not write here"
shop = Agent(
working = Memory(readable=True, writable=True),
semantic = Memory(readable=True, writable=False), # the catalogue
procedural= Memory(readable=True, writable=False), # query functions
episodic = Memory(readable=True, writable=True), # customer history
decision = [retrieve_history, propose, evaluate, select],
learn_at = "end_of_interaction",
)
Chapter 10
Test the framework at its edges: the line between agent and world, what a stronger model changes, and what the paper does not claim
A good blueprint should say where it stops working. The paper does, in its Discussion. It raises five open questions, and each one is a place where the neat boxes of the last nine chapters blur. We take them in turn, then list what the paper does not claim.
For a robot, the line is easy: the metal body is the agent and the kitchen is the world. For a digital agent it is not. Is a copy of Wikipedia that the agent searches part of its semantic memory, or part of an external environment? If an agent runs its own code before answering, is that run an internal reasoning action or an external grounding action? If a method uses one prompt to propose and another to evaluate, is it one agent or two cooperating agents?
The paper answers with two tests: controllability and coupling. Something is internal if only the agent can change it. Wikipedia is not controllable, since other people can edit it at any time, so it is an external environment. An offline copy that only the agent writes to is controllable, so it counts as internal memory. Code run in a private virtual environment is an internal reasoning action. Code run on an outside machine, which might have security holes, is an external grounding action. Two prompts that are designed for and depend on each other are tightly coupled and best seen as one agent. If the steps are independently useful, the multi-agent view fits better.
Choose an example, then flip its test. The item moves across the agent’s boundary when the test passes.
The three examples and the two tests (controllability and coupling) are from the paper’s Discussion. The paper adds that practitioners may simply choose a framing, as long as it is consistent and useful for their work.
The paper is candid that these are mostly conceptual dilemmas. But the answers change real design choices. Treat live Wikipedia as an external environment, and you must expect it to change between two reads, so a fact stored last week could be out of date. Treat a frozen offline copy as internal memory, and you can index it, version it and test against it. Treat code execution as external, and you would want to ask what the worst command could do. The label decides what you secure, what you can cache, and what you can test separately.
Language only, or pictures too? Most agents reason over text and use a separate captioning model to turn images into words. Newer models read images directly. The modular route loses information in the conversion. The integrated route keeps it, but ties reasoning to one set of input types and makes the agent harder to update. CoALA applies to both.
One life or a million? An animal lives once in the physical world. A digital agent can be reset, or cloned to try a million web pages in parallel. The paper suggests this may push decision procedures away from ones inspired by human cognition.
When should an agent learn? In CoALA, learning is an action the cycle chooses, just like grounding. Most agents instead follow a fixed schedule. Biological agents must trade learning against acting. The paper suggests treating learning as one more candidate action, so that an agent can defer it until the right moment.
What if the model gets much stronger? Agent design is a moving target. The paper observes that GPT-2 needed reinforcement learning to generate actions, GPT-3 allowed flexible few-shot reasoning, and only GPT-4 began to afford reliable self-evaluation. In a thought experiment, a very strong future model might simulate memory, grounding, learning and decision-making in one long context, or even inside its neurons. A longer context could shrink the role of long-term memory, and stronger reasoning could allow longer-horizon planning. The authors still expect the blueprint to help: it would organize where agents fail, and could help interpret circuits that implement these functions implicitly.
Be careful with four things. First, CoALA has no experiments of its own. Table 2 and the case studies are a reading of other people’s papers, so the neatness of the fit is partly the authors’ choice of what to emphasize. Second, several statements are limited by the phrase “to our knowledge”, such as the claim that no language agent learns its own retrieval or decision code. Third, it does not report that agents built this way outperform agents built another way. Fourth, the paper gives no rule for choosing between designs. It names the trade-offs and leaves the choice to the builder.
| Open direction | What the paper suggests |
|---|---|
| Metareasoning | Estimate whether planning is worth its cost, by amortization (training the model on the results of earlier planning), routing among sub-procedures, or updating the procedure. |
| Calibration and alignment | Overconfidence, bias and self-evaluation errors currently bottleneck complex decision-making. |
| Mixing language and code planning | Agents may write and run simulation code on the fly to test plans. |
| Meta-learning | Learning better retrieval or decision code, understudied because it is hard and risky. |
| Unlearning | Deleting memory items; modifying and deleting are both understudied. |
Chapter 11
Keep the numbers, the terms, the core code and the way onward, all on one page
CoALA is a blueprint with three dimensions. An agent stores information in memory: one short-term working memory and three long-term memories, episodic, semantic and procedural. It has an action space: one outside kind, grounding, and three inside kinds, reasoning, retrieval and learning. And it follows a decision cycle that plans by proposing, evaluating and selecting, then executes exactly one grounding or learning action. The paper borrows all of this from production systems and cognitive architectures. It argues that a language model is a probabilistic production system. Then it uses the blueprint to describe five existing agents and to point at what nobody has built yet.
| Fact | Value | Source |
|---|---|---|
| Memories in the framework | 4: working, episodic, semantic, procedural | Section 4.1 |
| Kinds of action | 4: grounding (external); reasoning, retrieval, learning (internal) | Figure 5 |
| Kinds of external environment | 3: physical, dialogue, digital | Section 4.2 |
| Sub-stages of planning | 3: proposal, evaluation, selection | Section 4.6 |
| Places an agent can write (counted from the section) | 7: episodic, semantic, weights, and four kinds of agent code | Section 4.5 |
| Of those 7, with no known language agent | 2: retrieval code, learning or decision code | Section 4.5 |
| Prompting methods rewritten as productions | 5: zero-shot, few-shot, retrieval, Socratic Models, self-critique | Table 1 |
| Agents cast into the framework | 5: SayCan, ReAct, Voyager, Generative Agents, Tree of Thoughts | Table 2 |
| Skills in SayCan’s fixed menu | 551 | Section 5 |
| Steps in the design recipe | 3: memories, internal action space, decision procedure | Section 6 |
| Strokes example: 11 divided by 5 | 2 remainder 1, in 4 rule applications | Section 2.2 |
| Term | Meaning |
|---|---|
| Production system | A set of rules, each with a precondition and an action, that rewrite a state. |
| Cognitive architecture | A production system plus memory, grounding and a decision cycle. Soar is the example. |
| Working memory | The data structure for the current decision cycle; the hub the model reads from and writes to. |
| Episodic memory | Stored experience from earlier cycles. |
| Semantic memory | Stored knowledge about the world and the agent. |
| Procedural memory | Know-how: the model weights (implicit) and the agent code (explicit). |
| Grounding | An external action that acts on the world and brings back an observation as text. |
| Retrieval | Reads long-term memory into working memory. |
| Reasoning | Reads working memory and writes new content back into it, using the model. |
| Learning | Writes to long-term memory. |
| Decision cycle | The agent’s main loop: plan, then execute one grounding or learning action. |
| Impasse | In Soar, no valid action or a tie; it creates a subgoal. |
| Controllability, coupling | The paper’s tests for where an agent ends and for one agent versus two. |
This is the whole blueprint as one runnable sketch. Every method name matches a term above. It is our illustration, not code from the paper.
class Memory:
def __init__(self, writable):
self.items, self.writable = [], writable
def read(self, query, k=2): # retrieval: toy keyword overlap
score = lambda it: len(set(query.split()) & set(it.split()))
return sorted(self.items, key=score, reverse=True)[:k]
def write(self, item): # learning: gated by access
if not self.writable:
raise PermissionError("this memory is read-only")
self.items.append(item)
class Agent:
def __init__(self, llm, env):
self.llm, self.env = llm, env
self.wm = {"goal": "", "obs": "", "retrieved": [], "thought": ""} # working memory
self.episodic = Memory(writable=True)
self.semantic = Memory(writable=False)
# procedural memory = this code + the llm weights
# internal actions
def retrieve(self, mem): self.wm["retrieved"] = mem.read(self.wm["goal"])
def reason(self, ask): self.wm["thought"] = self.llm(ask.format(**self.wm))
def learn(self, mem, x): mem.write(x)
# external action
def ground(self, action): self.wm["obs"] = self.env(action)
def decision_cycle(self):
# planning: reasoning and retrieval prepare the choice
self.retrieve(self.episodic)
cands = [self.llm("propose: {goal} {retrieved}".format(**self.wm)) for _ in range(3)]
scores = [self.llm("score: " + c) for c in cands] # evaluation
best = cands[max(range(3), key=lambda i: scores[i])] # selection (argmax)
# execution: one committing action
self.ground(best)
self.learn(self.episodic, f"did {best}, saw {self.wm['obs']}")
CoALA is a map, so its value shows when you read other agent papers and place them on it. Start with the ones this lesson already touches. The ReAct lesson covers the simplest agent that mixes reasoning and acting. The Reflexion lesson shows semantic memory written from failures. The MemGPT lesson shows a system that lets the model itself manage which memories sit in its working context. For a wider look at agent designs and how memory works in a production gateway, see the Agent Architectures lesson and the OpenClaw agent memory lesson.
The paper expects models to keep changing: a longer context could shrink the role of long-term memory, and stronger reasoning could allow longer plans. Its own advice is to treat the four memories and four actions as questions to ask of any agent, not as a fixed recipe.
Sumers, T. R., Yao, S., Narasimhan, K., and Griffiths, T. L. Cognitive Architectures for Language Agents. Transactions on Machine Learning Research, February 2024. arXiv 2309.02427. The authors also keep a list of language agent work organized by the framework at github.com/ysymyth/awesome-language-agents. Every claim about the paper in this lesson comes from that text. Examples marked illustrative, such as the shopping scene scores and the retrieval scores, are ours.