7 Types of AI Agent Memory Every AI Engineer Should Know | CodeConductor
AI Coding
7 Types of AI Agent Memory Every AI Engineer Should Know
Learn the 7 types of AI agent memory, including working, semantic, episodic, procedural, retrieval, parametric, and prospective memory. Discover how modern AI agents remember users, retain context, reduce token costs, and build production-ready memory architectures.
1Why LLM agents are stateless, and why memory infrastructure is required.
2The seven distinct memory types, their roles, timescales, and interactions.
3How working memory differs from semantic and episodic memory in production.
4Where vector databases fit, and what problems they do not solve.
What happens to an AI agent the moment a conversation ends?
For many production agents today, the answer is: the conversation context disappears unless something explicitly persists it.
By the end of 2026, Gartner predicts that 40% of enterprise applications will feature task-specific AI agents, up from less than 5% in 2025 (Source).
Salesforce’s 2026 Connectivity Benchmark Report also suggests that many enterprise agents still operate in isolation, with integration and data fragmentation remaining major blockers to coordinated work (Source).
That's not a deployment problem. It's a memory problem.
Most developers think "Ai agent memory" means a vector database. In reality, production AI agents rely on several fundamentally different kinds of memory, each solving a different problem.
This guide explains the seven memory types that appear in modern agent systems and how they work together.
Why does AI Agent Memory matter?
LLMs are stateless by default. Every API call is a fresh start: the model has no memory of the previous message unless something explicitly resends it. What feels like a “conversation” with ChatGPT or any agent is maintained by software outside the model, which repackages history and feeds it back in on each turn.
That illusion breaks fast once an agent has to do real work. The median payback period for enterprise agent deployments is in months, and agents without real memory rarely clear that bar. A few examples of what breaks without it:
A support agent who forgets a customer's issue between messages, forcing them to repeat themselves
A coding agent that can't recall earlier decisions in a codebase and contradicts its own prior work
A research agent that can't learn from what worked last time and repeats the same mistakes indefinitely
Memory is what turns a stateless model into a system that retains context, learns from experience, and acts over time. It's infrastructure, not a feature. The seven types below are the building blocks that infrastructure is made of.
The 7 Types of AI Agent Memory (With Examples)
An AI Agent memory isn't one system; it's seven distinct types, each built for a different job and a different timescale. Some live for a single turn, others persist indefinitely, and one isn't stored anywhere at all. Here's what each one does and where it shows up in a real agent.
1. Working Memory
Everything an agent can see right now lives entirely inside the context window.
What it holds: System prompt, current conversation, recent tool outputs, in-progress reasoning
Key trait: The only memory type the model directly reads; every other type loads into this one
Constraint: Bounded by context window size, older content gets evicted or summarized
Cost factor: The full window re-sends on every turn, so a long conversation re-pays for early messages repeatedly
Example: A travel-booking agent holds the destination, dates, and budget just given to it; none of it survives the session unless another memory type captures it first
2. Semantic Memory
Stable facts and preferences, decoupled from when the agent learned them, the "know-what."
What it holds: User plan tier, role, stated preferences, domain context
Key trait: Persists across sessions and applies automatically, no re-deriving each time
Built from: A structured store for clean fields + a vector store for fuzzier recall
Example: A financial advisory agent recalls a client has moderate risk tolerance and avoids structured products, pulled into every relevant conversation, not re-learned
The log of specific past events, the "what happened," is distinct from semantics' "what's true."
What it holds: Individual cases, decisions made, and their outcomes
Key trait: Enables case-based reasoning, not rule lookup
Sensitivity: The greatest data-retention concern of all seven, since it logs real user interactions
Example: A fraud-detection agent records each flagged case and whether it was real fraud or a false positive, then pulls the closest past matches when a similar pattern appears
4. Procedural Memory
Workflows, tool-use sequences, and operating rules are the "know-how," not facts or events.
What it holds: Step-by-step processes, approval thresholds, escalation logic
Lives in: a tuned system prompt, an external rules store, or both
Critical detail: Lookups should be exact-match, not similarity-based. A threshold pulled by "closest match" can quietly return the wrong number
Retrieval Memory (RAG) is a delivery mechanism that pulls external knowledge into the context window at inference time via similarity search.
How it works: Embed the query → search a vector store → inject top matches
Important distinction: It is a delivery mechanism, not a memory type on its own. It is the pipe, not the store
Main failure mode: Similarity isn't relevance; the highest-scoring match isn't always the correct one
Example: A compliance agent keeps regulatory text in a vector store and retrieves only the passages relevant to a specific question
6. Parametric Memory
Knowledge is baked directly into the model's weights during training.
What it holds: Grammar, general world knowledge, broad reasoning patterns
Key trait: Instant and always available, no retrieval step
Limitation: It is not directly writable at runtime; updates typically require fine-tuning, retraining, or model editing
Example: A model "knows" what a loan-to-value ratio is without retrieving anything, but the current interest rate must come from an external store, confusing the two, leading to confidently outdated answers
7. Prospective Memory
The ability to remember a future intention, something planned but not yet executed.
What it holds: Scheduled actions, deferred tasks, goal triggers
Key trait: Triggered by a clock or event, not a query. It is structurally different from the other six
Built with: Prospective memory is usually implemented with a scheduler or job queue, not search.
Example: An agent told to "review this account's contract renewal in September" needs prospective memory to act on that months later, with no user prompting it
AI Agent Memory Types: Side-by-Side Comparison
Reading through the seven types one by one makes the differences easy to lose. This table puts them side by side so you can compare duration, storage, and use case in one glance.
Type
Duration
Where It Lives
One-Line Example
Working
Short-term
Context window
Holds the destination and dates mid-booking
Semantic
Long-term
Structured store + vector DB
Recalls a client's risk tolerance
Episodic
Long-term
Event log + vector index
Logs whether a fraud flag was correct
Procedural
Long-term
System prompt + rules store
Encodes the claims approval workflow
Retrieval (RAG)
Both
Vector database
Pulls relevant compliance passages on demand
Parametric
Long-term (frozen)
Model weights
Knows what "loan-to-value" means
Prospective
Both
Task scheduler/job queue
Triggers a contract renewal review in September
Get insights in your inbox!!
Weekly tips on building smarter apps. Join 8,200+ founders and builders.
No spam. Unsubscribe anytime. We respect your privacy.
A quick way to read this table:
Short-term types (working) reset every session, built for speed, not persistence
Long-term types (semantic, episodic, procedural, parametric) need a real storage and retrieval strategy
The two trigger-style types behave differently from everything else: retrieval is a delivery mechanism, not a store, and prospective memory runs on triggers, not queries.
A Real-World Use Case: How All 7 Memory Types Work Together
A returning customer messages a support agent: "My refund still hasn't come through." Here's what happens behind that one message, and which memory type handles each step.
The agent first checks working memory for the current message plus the last few exchanges in this thread and sees there's no prior context on a refund. It needs more.
It queries semantic memory and learns that this customer is on the Enterprise plan and prefers email over phone follow-ups, a fact stored from past interactions, not re-asked now.
It checks episodic memory and finds something useful: this same customer had a near-identical billing dispute four months ago. That past case shows what resolution worked then.
To confirm the current policy, it pulls from retrieval memory (RAG) just the two relevant paragraphs from the billing policy doc, not the whole document.
It checks procedural memory for the organization's handling guidelines. Since the request meets the predefined criteria, the agent resolves it directly without escalating it.
Throughout, parametric memory is doing quiet, invisible work on the agent's basic grasp of language and how refunds work in general, with nothing retrieved for any of it.
Before closing the ticket, the agent uses prospective memory to schedule a check-in seven days out to confirm the refund actually posted without anyone asking it to.
Notice the order this happened in: Working memory first, then a semantic lookup, then a history check, then a policy pull, then a rule check, and only at the end, a scheduled action.
Skip a step or check things out of order, pulling policy before checking history, for instance, and the agent risks giving an answer that ignores what already happened with this customer. Sequence matters as much as the types themselves.
Common AI Agent Memory Mistakes (And How to Avoid Them)
Most memory failures trace back to one of three decisions made early and never revisited.
Mistake 1: Collapsing everything into one vector database
Treating semantic, episodic, and procedural memory as one undifferentiated blob in a single vector store is the most common shortcut and the hardest to unwind later.
Facts, past events, and operating rules all get fuzzy-matched the same way, even though they answer different questions.
Updating what an agent knows risks corrupting what it did or how it operates, because nothing separates the three
Fix: keep at least three stores, one for facts, one for event logs, and one for rules, even if they share the same underlying database.
Mistake 2: Using similarity search for exact lookups
Procedural rules, thresholds, and policies need an exact match, not a "closest" one.
A vector search for “approval threshold” can return something similar, but not necessarily the exact rule or number required.
This failure is silent; the agent doesn't error out; it just acts on the wrong rule.
Fix: structured rules get a direct key lookup; similarity search is reserved for genuinely fuzzy recall, like preferences or past discussions.
Mistake 3: No eviction or summarization strategy for working memory
Treating a larger context window as a substitute for real memory management is a cost problem disguised as a capability upgrade.
Every turn re-sends the full conversation history, so cost grows with every message added, not just the latest one.
Saving a session so it survives a restart isn't the same as paying less; the full window still ships on every call.
Fix: decide on an eviction or summarization strategy before scaling conversation length, not after the token bill arrives.
What AI Agent Memory Actually Costs You
Each memory type carries a different cost profile in tokens, storage, or query operations. Here's what that looks like with real numbers.
Working memory token cost (paid every turn):Claude Sonnet 4.6 costs $3 per million input tokens and $15 per million output tokens. In a 50-turn conversation that resends full history on every call, early messages are paid for repeatedly because they are included again and again in later requests. Summarizing older turns instead of re-sending them in full is the direct lever against this.
Semantic & episodic memory (storage cost, paid continuously): Using Pinecone as a reference point, storage runs $0.33 per GB per month, with $4 per million write units and $16 per million read units on the Standard plan. A million stored facts or logged events at a modest vector size can land in the low tens of dollars per month, but it compounds with every user and every event logged, since nothing here is paid once.
Retrieval cost paid per query (not per byte stored): Every retrieval call consumes read units in addition to whatever the search returns, plus the token cost of injecting those results into the next model call. At scale, query volume, not storage size, is usually the bigger line item.
Procedural memory (low cost if implemented correctly): Exact-key lookups against a structured store cost a fraction of a vector read unit. Cost only spikes when procedural rules get mistakenly routed through similarity search instead of a direct lookup, paying retrieval pricing for what should be a near-free operation.
Parametric memory has zero marginal cost (fixed upfront cost): No storage fee, no per-query charge; it's already in the weights. The cost was paid once, during training or fine-tuning, and updating it later means paying that cost again.
Prospective memory (minimal ongoing cost): A scheduler or job queue costs little to run continuously; the real cost only appears when a scheduled action fires and triggers a full agent run, at which point it's billed like any other working-memory turn.
The practical takeaway: Working memory is usually the first place cost gets out of hand, because it's the only type billed on every single turn rather than once per stored fact or event.
How to Choose the Right Memory Types for Your Agent?
Not every agent needs all seven. The right starting point depends on what the agent actually does.
Simple Q&A or single-session chatbot → Working memory only. No persistence is needed if the agent doesn't need to recall anything once the session ends.
Personalized assistant across sessions (remembers user preferences, plan tier, past requests) → Add semantic memory. Usually, the highest-value addition once working memory alone stops being enough.
Agent that should learn from outcomes (support, fraud review, recommendations) → Add episodic memory, plus the promotion step that turns repeated patterns into semantic rules; without it, episodic memory just accumulates as an unused log.
Agent answering from a large knowledge base (policy docs, product catalogs, internal wikis) → Add retrieval memory (RAG), scoped narrowly to what the query actually needs.
Agent with long-horizon or multi-step responsibilities (scheduled reviews, follow-ups, deferred actions) → Add prospective memory last, once the rest of the system reliably acts on a trigger.
Parametric memory isn't something you build for an agent; it comes bundled with whichever model you choose, not as a separate system to implement.
Conclusion
Most agents don't have a memory problem because memory is hard to build. They have one because teams default to a single vector store and call it done, skipping the five other types doing the real work of making an agent reliable, personalized, and capable of learning from what it's already done.
If you're building agents that need to actually remember across sessions, across tasks, across a codebase that keeps changing, that's exactly the gap Harmony was built to close. Instead of bolting a vector DB onto a stateless agent, Harmony gives coding agents structured, persistent memory out of the box: working context that survives long sessions, decisions and patterns that carry forward instead of resetting, and recall that doesn't degrade as a project grows.
AI agents waste time rediscovering your codebase.
Harmony gives them high-performance agentic memory so they spend more time coding.
Long-term memory is any information that persists beyond a single session: semantic facts, logged events, procedural rules, and the model's own parametric knowledge. Unlike working memory, it survives after the conversation ends.
What is the difference between semantic and episodic memory?
Semantic memory stores stable facts and preferences, the "know-what." Episodic memory stores specific past events and their outcomes, the "what happened." One answers what's true; the other answers what occurred.
How do AI agents remember users?
Through semantic memory, which stores user preferences, plan details, and stated facts in a structured store or vector database. The agent then retrieves and applies them automatically in future interactions without the user repeating themselves.
Does AI agent memory reduce token usage?
It can, when used correctly. Retrieving only relevant facts or summarizing past context costs far fewer tokens than re-sending full conversation history on every turn. Poorly scoped memory, however, can add retrieval overhead instead of saving it.
What is the best memory architecture for AI agents?
There's no single best architecture; it depends on the agent's job. Most production agents need at least working, semantic, and episodic memory; procedural, retrieval, and prospective memory get added based on the specific workflow.
Key Takeaways
4 essential insights
Treat agent memory as infrastructure, not a vector database feature.
Design multiple memory types; load everything important into working memory.
Persist stable user facts in semantic memory to avoid re-deriving context.
Use episodic memory for case-based improvement, but manage retention and privacy.
Written by
Paul Dhaliwal
Founder & Chief Executive Officer
Paul Dhaliwal is a tech innovator and Founder of CodeConductor, an open-source no/low-code platform. With 10+ years of experience in AI and scalable development, Paul focuses on crafting intelligent solutions that drive real-world value. A firm believer in the mantra "Eat, Sleep, Code, Repeat," he balances his passion for software with a love for travel and family.
⚡
Build your app
No coding. No designers. Just describe what you want and watch AI build it.