{"slug": "the-7-types-of-agent-memory-a-technical-guide-for-ai-engineers", "title": "The 7 Types of Agent Memory: A Technical Guide for AI Engineers", "summary": "Large language models are stateless by default, but agents require memory to retain context across steps. A new technical guide identifies seven types of agent memory—working, semantic, episodic, procedural, retrieval, parametric, and prospective—each varying by timescale and storage location. Engineers must understand these types to build agents that can plan, learn, and act over time.", "body_md": "Large language models are stateless by default. Each API call starts fresh. The model forgets your last message once the response returns. That is fine for a single question. It breaks the moment you build an agent.\n\nAgents plan, call tools, and run across many steps. They need to remember. Memory is the infrastructure that fixes this. It turns a stateless model into a system that retains context. That system can learn from experience and act over time.\n\n**What is Agent Memory**\n\nMemory is any mechanism that carries information across a model’s reasoning. Some of it lives inside the context window. Some of it lives outside, in databases or model weights. Each type stores a different class of information for a different duration.\n\nMemory varies by form and by time. Form means parametric, stored in weights, or non-parametric, stored as text. Time means short-term or long-term. The seven types below map onto those two axes.\n\n**The Seven Types of Agent Memory**\n\n**1. In-Context / Working Memory (Short-Term)**: This is everything the model can currently see inside its context window. It includes the system prompt, recent messages, tool outputs, and reasoning steps. Think of it as RAM. It is fast and essential, but temporary and size-limited. Every other memory type competes for space here.\n\n**2. Semantic Memory (Long-Term)**: This is a persistent store of facts, preferences, and domain knowledge. It holds entries like “the user prefers Python over JavaScript.” The knowledge is decoupled from when it was learned. It is the agent’s organized encyclopedia about a user or topic.\n\n**3. Episodic Memory (Long-Term)**: This logs specific past events, full conversations, and task runs. It records what worked and what failed. The agent uses it to learn from experience. Systems like Reflexion and ExpeL write verbal post-mortems and store conclusions for future runs.\n\n**4. Procedural Memory (Long-Term)**: This is the agent’s knowledge of how to do things. It covers skills, tool usage patterns, workflows, and behavioral rules. A support agent handling its hundredth password reset does not re-reason the workflow. It executes a learned procedure instead.\n\n**5. External / Retrieval Memory (Short-Term + Long-Term)**: This is knowledge stored outside the model in a vector database. It is pulled into context at inference time using similarity search. This is RAG applied to agent history or documents. Retrieval quality becomes the bottleneck fast.\n\n**6. Parametric Memory (Long-Term)**: This is knowledge baked directly into the model’s weights during training. It holds language, reasoning patterns, and general world knowledge. The model does not look anything up. It generates from learned associations. The tradeoff is that this memory is frozen at training time.\n\n**7. Prospective Memory (Short-Term + Long-Term)**: This is the agent’s ability to remember future intentions and scheduled goals. It tracks things the agent planned but has not yet executed. It is critical for long-horizon and multi-step planning agents. Without it, an agent forgets its own commitments.\n\n**Side-by-Side: How the Seven Compare**\n\nThe table below maps each type to its timescale, location, and typical implementation.\n\n| Memory type | Timescale | Where it lives | What it stores | Common implementation |\n|---|---|---|---|---|\n| Working / In-context | Short-term | Context window | Prompt, messages, tool outputs | Native to the LLM |\n| Semantic | Long-term | External store | Facts, preferences, domain knowledge | Vector DB or profile schema |\n| Episodic | Long-term | External store | Past events, task runs, outcomes | Vector DB plus event logs |\n| Procedural | Long-term | Prompt or weights | Skills, workflows, behavioral rules | System prompt or fine-tune |\n| Retrieval / External | Both | Vector database | Documents, history chunks | RAG pipeline |\n| Parametric | Long-term | Model weights | World knowledge, language, reasoning | Pre-training or fine-tuning |\n| Prospective | Both | State store | Future intentions, scheduled goals | Task queue or scheduler |\n\n**Interactive Explainer**\n\n**Use Cases: Which Memory Solves Which Problem**\n\nEach type answers a concrete product need. Map the need to the memory.\n\n- A coding assistant inside one session uses working memory. It tracks the open files and recent edits in context. Close the session and that state is gone.\n- A personal assistant that remembers you needs semantic memory. It stores “allergic to gluten” and recalls it next week. The fact survives across sessions.\n- A research agent that improves over time needs episodic memory. It recalls that risk sections landed well last month. It repeats what worked and avoids what failed.\n- A travel-booking agent needs procedural memory. It knows the flow: search flights, compare, reserve, confirm. The sequence is a learned skill, not a fresh plan.\n- A documentation chatbot needs retrieval memory. It embeds the docs and pulls relevant chunks per query. The answer stays grounded in retrieved text.\n- A long-horizon agent managing a week-long project needs prospective memory. It remembers to send the Friday report. The intention persists until execution.\n\n**A Combined Example: All Seven in One Agent**\n\nConsider an autonomous market-analysis agent. One task exercises every memory type at once.\n\nParametric memory supplies the base reasoning and language. Retrieval memory pulls current market data from a vector store. Semantic memory provides the user’s preferred report format. Episodic memory recalls which sources proved reliable before. Procedural memory drives the section order: sizing, then landscape, then risk. Prospective memory schedules the follow-up draft for next week. Working memory assembles all of it into the active context.\n\nRemove any one layer and the agent gets weaker. Each handles a job the others cannot.\n\n**Implementation: A Minimal Memory Stack**\n\nHere is a stripped-down sketch in Python. It shows working, semantic, episodic, and procedural memory as separate stores.\n\n``` python\nfrom datetime import datetime\n\n# Semantic memory: durable facts about the user\nsemantic_memory = {\"diet\": \"vegetarian\", \"language_pref\": \"Python\"}\n\n# Episodic memory: a log of past events and outcomes\nepisodic_memory = [\n    {\"timestamp\": datetime.now(),\n     \"event\": \"recipe_request\",\n     \"result\": \"user liked a 20-minute meal\"},\n]\n\n# Procedural memory: skills the agent can execute\ndef suggest_recipe(diet):\n    return f\"a quick {diet} recipe\"\n\nprocedural_memory = {\"suggest_recipe\": suggest_recipe}\n\n# Working memory: assembled fresh for each inference call\ndef build_context(query):\n    diet = semantic_memory[\"diet\"]\n    last = episodic_memory[-1][\"result\"]\n    skill = procedural_memory[\"suggest_recipe\"]\n    return (\n        f\"Query: {query}\\n\"\n        f\"Semantic: user is {diet}\\n\"\n        f\"Episodic: last time, {last}\\n\"\n        f\"Procedural: returning {skill(diet)}\"\n    )\n\nprint(build_context(\"suggest dinner\"))\n```\n\nIn production, the long-term stores move to a vector database. The pattern stays the same. Write to long-term memory, retrieve into working memory, then reason.\n\n**How to Layer Them: A Practical Build Order**\n\nDo not build all seven at once. Add memory only when a real need justifies the complexity.\n\n- Start with working memory. It ships with the model. Most simple agents need nothing more.\n- Add semantic memory when users expect the agent to remember them across sessions. This is the first long-term layer most products require.\n- Layer in episodic, procedural, and prospective memory later. Add them only when your agent must plan ahead, learn from failure, and adapt over time.\n- Parametric and retrieval memory are often already present. Parametric memory is the base model itself. Retrieval memory arrives the moment you add RAG.\n\n**Sources:** CoALA framework (Princeton, arXiv:2309.02427); “Memory in the Age of AI Agents” survey (arXiv:2512.13564); “From Human Memory to AI Memory” survey (arXiv:2504.15965); LangChain LangMem, MongoDB, Redis, and Neo4j agent-memory documentation; original concept notes on the seven memory types.", "url": "https://wpnews.pro/news/the-7-types-of-agent-memory-a-technical-guide-for-ai-engineers", "canonical_source": "https://www.marktechpost.com/2026/06/21/the-7-types-of-agent-memory-a-technical-guide-for-ai-engineers/", "published_at": "2026-06-21 23:12:31+00:00", "updated_at": "2026-06-21 23:29:41.711054+00:00", "lang": "en", "topics": ["large-language-models", "ai-agents", "ai-infrastructure", "natural-language-processing", "ai-research"], "entities": ["Reflexion", "ExpeL", "RAG"], "alternates": {"html": "https://wpnews.pro/news/the-7-types-of-agent-memory-a-technical-guide-for-ai-engineers", "markdown": "https://wpnews.pro/news/the-7-types-of-agent-memory-a-technical-guide-for-ai-engineers.md", "text": "https://wpnews.pro/news/the-7-types-of-agent-memory-a-technical-guide-for-ai-engineers.txt", "jsonld": "https://wpnews.pro/news/the-7-types-of-agent-memory-a-technical-guide-for-ai-engineers.jsonld"}}