7 · Memory & State Management
The four memory layers that make agents reliable.

Memory gives agents context; state management makes them consistent, personalized and reliable. This diagram lays out the memory layers an agent needs and where each is stored.
In simple terms
The four memory layers — short-term, long-term, user and semantic — that make agents reliable.
How it works
- 1Short-term (working) memory: the current conversation, held in the context window.
- 2Long-term (persistent) memory: stored outside the context, retrieved when needed via embeddings.
- 3User memory: profile and preferences, enabling personalization.
- 4Semantic memory: domain knowledge, documents, FAQs and policies.
- 5LangGraph injects the right memories into prompts each turn.
Key points
- Different memories are stored in different systems (key-value, relational, vector, cache).
- Best practices: store only what's necessary, separate user vs app data, use TTLs and encryption.
- Memory turns a one-shot model into a coherent, personalized agent.
- AgentCore Memory provides this at enterprise scale.
Why it matters
Without memory, agents forget everything between steps. Layered memory is what makes them consistent, personalized and reliable over long tasks and sessions.
Frequently asked questions
- What are the memory types?
- Short-term (working), long-term (persistent), user (profile/preferences) and semantic (knowledge).
- Where is long-term memory stored?
- Outside the context window, usually in a vector database, and retrieved when relevant.
More in Production AI Stack (2026)
1 · The Big Picture
The complete end-to-end production AI stack (2026).
2 · User Request Lifecycle
How one request flows through the whole system.
3 · LangChain Ecosystem
How LangChain, LangGraph, LangServe and LangSmith fit together.
4 · LangGraph Orchestration
Stateful, multi-step agent workflows.
5 · AWS Bedrock Integration
How LangChain talks to models through Amazon Bedrock.
6 · Amazon AgentCore
The enterprise runtime for LangChain/LangGraph agents.