liveBook · Manning

Working memory

As explained in Introduction to Generative AI, Second Edition

Short-term memory is an agent capability for retaining relevant intermediate information from the current task or interaction.

Working memory lets an agent retain relevant intermediate information during a task or interaction. As tool calls accumulate, the agent must preserve what matters, discard unnecessary results, and sometimes remember earlier interactions. section 8.12

The boundary between useful and excessive context is application-dependent and usually determined empirically. An agent might keep only each search’s final result rather than every retrieved document, storing reusable state for later steps. section 8.12

Multiple searches

During a sequence of searches, working memory can retain each query’s final result while dropping the documents that no longer matter. section 8.12

Figure 8.7 The general agent architecture allowing for multiple actions per response
A diagram of a diagram

AI-generated content may be incorrect.

Use the agent architecture diagram to see where retained state supports multiple actions in one task. section 8.12

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Explains selective retention and application-dependent context choices, but stops short of implementation detail.
Examples
Uses chained searches, retained final results, discarded documents, and LangGraph state as examples.
What it assumes
Assumes familiarity with agents, tool calls, and model context while distinguishing short-term from long-term memory.
What you can do after
Evaluate which intermediate results an agent should retain or discard during multistep tasks.
How it connects
Connects short-term memory with long-term memory, agent architectures, tool calls, context, and planning.

Also explained in

Compare how 7 books explain working memory →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.