Memory & State Management
How agents remember things across turns, sessions, and users. Memory is what separates a chatbot from an agent — without it, every request starts from zero.
The four types of agent memory
| TYPE | SCOPE | LIFETIME | IMPLEMENTATION | EXAMPLE | GCP SERVICE |
|---|---|---|---|---|---|
| Short-term | Current conversation | Minutes-hours | Message history array in memory | Last 20 messages, tool results | In-memory (stateful service) |
| Working | Current task | Duration of task | Scratchpad dict, state machine | Intermediate calculations, partial results | Redis / Memorystore |
| Long-term | Per user/session | Days-months | Vector store + structured DB | User preferences, past interactions, learned facts | Vertex AI Vector Search + Cloud SQL |
| Org-wide | All users | Permanent | RAG over knowledge base | Company docs, policies, product info | Vertex AI Search / BigQuery |
Production-ready memory implementation
Continue Reading
This topic continues with more in-depth content, code examples, and diagrams. Sign up free to unlock the full guide with all 87 sections.
Sign Up Free to UnlockFree access · No credit card required