Episodic, semantic and procedural memory in AI agents
Agent memory borrows three kinds from psychology: episodic (what happened), semantic (what is known) and procedural (how things are done), with the context window as working memory. Why each is captured and retrieved differently, and what goes wrong when they share one store.
When people design memory for AI agents they tend to borrow a vocabulary from cognitive psychology, where human long-term memory has long been divided into kinds that behave differently. Three of them map usefully onto what a company assistant needs to remember, and a fourth describes what it is holding right now.
The three kinds, in a company
Episodic memory is what happened. The renewal call with Acme on Tuesday. The email in which the supplier said the shipment would slip. The thread where the team argued about moving the queue into Postgres. An episode has a time, participants and a context, and it is true as a record of an event even if what was said in it later turned out to be wrong.
Semantic memory is what is known, detached from the moment it was learned. Acme's renewal is in September. The finance lead owns billing. "Settlement" means something particular in this business. A semantic fact is a claim about the world as it stands, and it is useful precisely because it does not need the episode to be re-read.
Procedural memory is how things are done. The steps for a refund. What month-end close actually involves. Who has to sign off before an inbound lead touches the pipeline. It is knowledge of a sequence, and it is the part a new joiner spends weeks inferring and nobody writes down.
Working memory is the context window: the conversation so far, the documents and tool results of this turn. It is large, temporary and paid for on every request. Everything in long-term memory is useful only to the extent that the right piece of it reaches working memory at the right moment.
Captured, stored and retrieved differently
The three kinds arrive by different routes and are needed in different ways, so a single mechanism serves them badly.
Episodes are mostly captured whole: a transcript, a message, a meeting note, with its date and participants. They are retrieved by time and by who was involved ("what did we tell Acme last week?"), and their value is fidelity, so they should be kept close to the original.
Semantic facts are extracted. Something has to read the episode, decide which statements are durable, and turn them into facts attached to the things they are about. They are retrieved by subject ("what do we know about Acme?") and by meaning, and their value is that they are current, which means they have to be updated when the world changes.
Procedures are written or explained, usually by a person who knows how the job is done, and they are retrieved by situation: the moment a refund comes up, the refund steps are what matter. Their value is that somebody stands behind them, because a stale procedure misdirects with authority.
Why mixing them goes wrong
The common failure is to put everything into one store of text and let similarity search sort it out.
The first casualty is the difference between an episode and a fact. A meeting note says "we will probably move the renewal to September". An extractor lifts out "the renewal is in September", and from then on it is retrieved as standing truth, though nobody decided it. One remark in one meeting has become semantic memory without anybody noticing the promotion.
The second is procedure. A sentence describing how a refund was handled once competes in retrieval with the facts about the customer, and may or may not surface when somebody asks how refunds are done. A procedure that has to win a similarity contest to be read is not a procedure.
The third is time. Semantic facts change. If the store cannot say that the September fact replaced the July one, both are retrieved, both look current, and the model picks one. The fix is supersession: the newer fact marks the older one as no longer current without deleting it, and each fact carries two dates, when it held in the world and when the system believed it. That is what bitemporal means, and it lets an agent answer both "when is the renewal?" and "what did we think in July?".
Where Memtro stands
Memtro keeps the kinds apart. Semantic memory is the knowledge graph, with every fact carrying a kind, a subject, validity dates and provenance, and superseded rather than overwritten, so time travel can read memory as it stood on any date. Episodes are kept as the exchanges the extractor read, so a better extractor can read them again, and engineering choices stated in pull requests and threads become decisions joined to the code they concern. Procedures are a separate register: each adopted one puts its name and trigger in every prompt, and its steps are read when that job comes up. The memory documentation and the procedures documentation cover each in detail.