5 Memory and state in agentic systems
This chapter covers
- Memory in AI agents, including short-term and long-term.
- State as the dynamic status in agentic systems.
- Practical strategies for memory and state management.
Chapter 4 introduced tools as key enablers of AI agents' behavior, enabling agents to act. This chapter focuses on two additional sources of context that enable agentic behavior. First, memory, from short-term conversational to long-term persistence, enables AI agents to persist information across turns and sessions, supporting continuity, personalization, and long-running tasks. Second, state captures the dynamic status of the agent, its task, and its environment at a given moment.
5.1 Memory
Memory is a key pillar of context-aware AI agents, complementing tool use by enabling continuity over time. While tools allow an agent to acquire fresh external context, memory determines what context persists, how it is recalled, and how past information influences future reasoning. Without memory, even a tool-enabled agent remains reactive and short-lived, constrained to the current prompt and session [25].