liveBook · Manning

Working memory

As explained in AI Agents in Action, Second Edition

Short-term memory is the recent interaction history of the current session that remains directly in the model's context window.

Working memory is the agent’s active workspace for the current session. In its simplest form, it is the recent conversation: what the user and agent said, plus tool calls. These turns remain directly in the model’s context window so the agent can use them when responding. section 1.3.4 section 6.4.1

Think of working memory as what is on the desk now, and long-term memory as what can be fetched later. Long-term memory persists across sessions and can supply relevant preferences, decisions, or project history. An agent may use both, but a stored fact is not in working memory until it is brought into the current context. section 1.3.4 section 6.6

A conversation with a tool call

Suppose a user asks a question and the agent calls a tool before answering. The recent question, tool call, and response can form the current conversational record. Keeping that record available helps the agent respond in light of what just happened; it does not require every older interaction to remain in the window. section 1.3.4 section 6.4.1

The context window sets a hard limit on this workspace. As a conversation grows, choose which older turns to retain, summarize, or evict. Tool output may also need filtering or chunking before it is added. A larger window eases the pressure but can increase cost and latency, so more context is not always better. section 1.3.4

For a simple agent, the workspace can be a conversation thread; a more complex agent may use a shared blackboard. In deployed systems, conversational turns are commonly kept in fast storage such as Redis or PostgreSQL, while long-term facts are typically accessed through search indexes. The practical question is which information the agent needs immediately, rather than which information it might need someday. section 6.4.1 section 8.3.4

How AI Agents in Action, Second Edition covers it

How deep it goes
Defines the active buffer and explains context-window trade-offs, while deferring detailed memory architectures and context strategies.
Examples
Uses conversation turns and tool calls as the basic record, with Redis or PostgreSQL as deployment storage examples.
What you can do after
Operate/configure it by deciding which turns and tool outputs to retain, summarize, filter, or evict.
How it connects
Connects conversational memory to long-term memory, context windows, tool output, and blackboard workspaces.

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 AI Agents in Action, Second Edition. The section links point to the parts of the book it draws on.