Six Kinds of Memory an Agent Runtime Actually Needs
Six Kinds of Memory an Agent Runtime Actually Needs
“Add memory” is one of the most misleading requirements in agent design.
It sounds like a feature. It is actually a family of different state systems that happen to share a name.
A user preference is not the same thing as an execution trace. A debugging lesson is not the same thing as a relationship graph. A workflow recipe is not the same thing as a conversation summary. A safety policy is not the same thing as a recalled fact.
If all of them are pushed into the same memory bucket, the agent becomes strange. It remembers stale facts, forgets useful procedures, repeats old temporary context, treats one-off events as durable truth, and retrieves irrelevant fragments because everything was stored with the same shape.
Memory is not one thing. An agent runtime needs several memory types, each with its own rules.
1. Conversation residue
This is the short-lived residue of an active session: what the user just asked, what the agent already tried, which files were touched, which error happened, what is still pending.
It is useful, but it is not durable knowledge.
Conversation residue should expire aggressively. It belongs to the current task, not to the user's identity and not to the system's long-term understanding of the world.
If this residue becomes permanent memory, the agent starts carrying yesterday's temporary state into tomorrow's unrelated work.
2. Semantic facts
Semantic memory stores stable facts:
- user prefers Russian responses;
- a project uses Eleventy;
- a server path is
/var/www/rokoss21.tech; - a category rule says
memoriais only for Memoria project posts.
These facts are compact, declarative, and likely to remain useful.
Semantic memory should be curated. It should not contain raw transcripts, task logs, temporary TODOs, or “we fixed X yesterday” entries. A good semantic memory prevents the user from repeating themselves. A bad one becomes a stale instruction soup.
3. Episodic traces
Episodic memory is about events.
It answers: what happened last time? Which command failed? Which workaround succeeded? What did the tool return? What evidence was collected?
This is different from semantic memory. An episodic trace can be verbose because it is retrieved only when needed. It can include timestamps, outputs, intermediate decisions, and dead ends.
For agent systems, episodic memory is often better stored as searchable traces rather than always-injected memory. The runtime should retrieve episodes by relevance, not carry them into every prompt.
4. Skill memory
Some lessons are not facts. They are procedures.
A skill is a reusable way to do something:
- how to publish a multilingual article on this site;
- how to migrate a profile safely;
- how to verify a VNC desktop setup;
- how to run a specific deployment checklist.
Skill memory should be written as a procedure with triggers, steps, pitfalls, and verification. It should not be compressed into one sentence of semantic memory.
This distinction matters. “Project uses Eleventy” is a fact. “When publishing, update EN/RU/ZH, build, verify articles.json and sitemap” is a skill.
5. Graph memory
Some memory is relational.
A graph can represent people, projects, servers, repositories, concepts, dependencies, ownership, and influence. It is useful when the question depends on relationships rather than isolated facts.
For example:
FACET -> Token Box -> context packing
IOSM CLI -> runtime discipline -> engineering cycles
rokoss21.com -> multilingual Eleventy blog -> ai-engineering category
A vector search over chunks may find mentions. A graph can answer how things connect.
Graph memory should not replace semantic memory or episodic traces. It serves a different job: relation-aware retrieval and reasoning.
6. Policy memory
Policy memory stores boundaries.
It includes rules like:
- never print secrets;
- do not commit without permission;
- do not create new blog categories unless asked;
- on article pages, show the article before the sidebar on mobile;
- use
ai-engineeringfor broad AI engineering essays.
This memory is special because it affects what the agent is allowed to do, not just what it knows.
Policy memory should be explicit, compact, and treated with more care than ordinary facts. A stale policy can block useful work. A missing policy can cause damage.
Different memory, different lifecycle
The reason to split memory types is lifecycle.
| Memory type | Lifetime | Retrieval style | Failure mode |
|---|---|---|---|
| conversation residue | minutes/hours | current session | stale task bleed |
| semantic facts | weeks/months | always or targeted | outdated assumptions |
| episodic traces | historical | search by relevance | noisy recall |
| skills | durable | trigger-based | wrong procedure |
| graph memory | evolving | relation query | false connections |
| policy memory | durable but curated | always enforced | unsafe or overblocked behavior |
A single “memory” feature cannot manage all of these well. They have different retention rules, different retrieval rules, and different risk profiles.
The runtime implication
A serious agent runtime should not ask only, “Should we remember this?”
It should ask:
What kind of memory is this?
Who is allowed to write it?
When does it expire?
How is it retrieved?
Can the user inspect or delete it?
Does it affect policy or only context?
How do we know it is still true?
Those questions turn memory from a magical scrapbook into an engineered state system.
Final thought
An agent with one memory bucket is easy to build and hard to trust.
The better design is less romantic and more useful: short-lived residue, curated facts, searchable episodes, reusable skills, relationship graphs, and explicit policies.
Once memory is split by purpose, the agent becomes less haunted by its past and more capable of using the right past at the right moment.