Braj Kishore
JourneyVaultML FoundationsAI PM GuideAgenticNewsWork With MeMentorshipPulseNow
Say hi

Hiring · Building · Investing

Have a system — or a team —that needs to scale?

info@avyxon.ai

Usually replies within a day · track record here

JourneyVaultML FoundationsAI PM GuideAgenticNewsWork With MeMentorshipPulseNow
LinkedInXYouTubeSubstackInstagramThreadsFacebookDiscordGitHubTopmate
© 2026 Braj Kishore · Bengaluru, INThink Big · Start Small · Scale Fast
Agentic engineering
Lesson 14Patterns

The seven kinds of memory

Most conversations about agent memory are really about one of seven different things, and the disappointment usually comes from building the wrong one. Four of these have a literature going back decades. Three are engineering categories the industry added, and one of those is a scheduler in a hat.

Start with the situation. Someone says the agent has no memory, and the team reaches for a vector database. Three weeks later the agent still forgets the customer’s timezone, because a timezone was never a retrieval problem.

The useful move is to stop saying “memory” and name which one. Four of the names come from the cognitive-architecture literature, where they have meant specific things for decades. Three more are categories engineering added because the first four did not cover everything an agent needs.

Interactive · all seven at once

Seven kinds, and only one of them is the context window

Read the third row across. Three of the seven — procedural, external and parametric — are not written by the agent at all. That is the fact that decides most memory architectures.

What it holds
What the model can see right now
Where it actually lives
The context window
How it gets written
Every turn, automatically
How it gets read
Free — it is already there
What it holds
Facts that stay true
Where it actually lives
A key-value store or a file
How it gets written
When a fact is learned or changes
How it gets read
Retrieved by key or by search
What it holds
What happened, and how it went
Where it actually lives
Your trace store
How it gets written
At the end of every run
How it gets read
Retrieved by similarity to the task
What it holds
How this task is done here
Where it actually lives
The system prompt, or a skills file
How it gets written
By an engineer — or distilled from runs
How it gets read
Loaded before the task starts
What it holds
Everything you already had
Where it actually lives
Your database, docs, ticketing system
How it gets written
By your business, not your agent
How it gets read
Retrieval — lesson 08 is entirely this
What it holds
General knowledge of the world
Where it actually lives
The model weights
How it gets written
At training time. Not by you
How it gets read
Free, instant, and unverifiable
What it holds
Something to do later
Where it actually lives
A job queue with a trigger
How it gets written
When an intention is formed
How it gets read
By the scheduler, not the model
What it holds
What the model can see right now
Facts that stay true
What happened, and how it went
How this task is done here
Everything you already had
General knowledge of the world
Something to do later
Where it actually lives
The context window
A key-value store or a file
Your trace store
The system prompt, or a skills file
Your database, docs, ticketing system
The model weights
A job queue with a trigger
How it gets written
Every turn, automatically
When a fact is learned or changes
At the end of every run
By an engineer — or distilled from runs
By your business, not your agent
At training time. Not by you
When an intention is formed
How it gets read
Free — it is already there
Retrieved by key or by search
Retrieved by similarity to the task
Loaded before the task starts
Retrieval — lesson 08 is entirely this
Free, instant, and unverifiable
By the scheduler, not the model
Episodic memoryFrom the literature

CoALA again: episodic memory “stores sequences of the agent's past behaviors”. Semantic memory saves what is true; episodic saves what happened. If you built the tracing from lesson 18 you already have this — most teams have episodic memory and never read from it.

Four of these — working, semantic, episodic and procedural — come from the cognitive-architecture literature and carry citations. The other three are categories the industry added. Both are useful; presenting them as equally established is not.

Cognitive Architectures for Language AgentsarXiv 2309.02427

The four with a lineage

CoALA borrowed its four from cognitive architectures and its definitions are refreshingly blunt. Semantic memory “stores facts about the world”. Episodic memory “stores sequences of the agent’s past behaviors”. Procedural memory “stores the production system itself: the set of rules that can be applied to working memory”.

The distinction that does the most work in practice is between the first two. Semantic memory saves what is true. Episodic memory saves what happened. The customer is in Bengaluru is semantic. Run 8842 hit the approval ceiling is episodic.

Confuse the two and you get the failure everyone recognises. The agent has been told a thousand things. It still cannot tell you why it did what it did yesterday.

Interactive · where does this go?

Seven decisions, and the boundaries are sharper than they look

Each of these is something a real support agent would meet. Pick where it belongs — a wrong answer here is more instructive than a right one.

1 of 7

“This customer is in Bengaluru, so IST.”

The part taxonomies leave out

Naming the kinds is the easy half. Du et al. name six operations that every memory system needs and most designs never mention: consolidation, updating, indexing, forgetting, retrieval and condensation.

Forgetting is the one to notice. Nearly every memory design is additive — write more, keep more. Then it degrades, because the store fills with things that were true once. Context editing is forgetting shipped as a product feature. It pairs with a memory store for an obvious reason. You can only afford to clear what you have already written down somewhere durable.

The design rule that falls out of it: decide how a memory gets deleted before you decide how it gets written. A store with no expiry policy is not a memory, it is an append-only log that will eventually make your agent worse rather than better.
Rethinking Memory in LLM based Agents: Representations, Operations, and Emerging TopicsarXiv 2505.00675

What one actually looks like

Anthropic’s memory tool is a useful thing to argue from, because it is deliberately unglamorous. It is a directory of files. The model reads and writes them with six commands — view, create, str_replace, insert, delete and rename — and your own handler runs each one against storage you own.

Two details are worth lifting from it. The tool is client-side. The model only asks for an operation; your code carries it out. So path validation is your job, and a path like /memories/../../secrets.env is your bug, not the model’s.

The second is a sentence. The API adds its own instruction to the system prompt whenever the tool is present, and it ends like this. ASSUME INTERRUPTION: Your context window might be reset at any moment, so you risk losing any progress that is not recorded in your memory directory. Working memory is volatile by design. Every other kind of memory exists because of that.

memory.py
# Semantic facts: small, durable, and each one knows when to die.
def remember_fact(user_id, key, value, source, ttl_days=180):
    store.put(
        f"user:{user_id}:{key}",
        {
            "value": value,
            "source": source,              # which run learned it — provenance matters
            "learned_at": now(),
            "expires_at": now() + days(ttl_days),
        },
    )


def load_working_set(user_id, task_type):
    """Read scoped to the task, not everything we have ever stored."""
    facts = [
        f for f in store.scan(f"user:{user_id}:")
        if f["expires_at"] > now()          # forgetting is a read-path concern too
    ]

    # Procedural: the rules for THIS task, not every rule we own.
    procedures = load_procedures(task_type)

    # Episodic: a few similar past runs and how they ended. Cap it —
    # this competes for the same context window as the actual task.
    episodes = trace_store.similar(task_type, limit=3, outcome="any")

    return facts, procedures, episodes
Two things worth copying: the write path carries provenance and an expiry, and the read path is scoped to the task rather than loading everything. A memory system that loads all of itself into context on every run has reinvented the problem it was built to solve.
Memory toolAnthropic docs

Procedures you did not write

One line of research is worth knowing about even though almost nobody should build it yet. Memp distils past trajectories into step-by-step instructions and higher-level scripts, then keeps updating, correcting and deprecating them.

Two findings travel. Success rates rose steadily as the repository was refined. That is the case for procedural memory being learned rather than hand-written. The procedures also transferred from a stronger model to a weaker one. So what you distil at the frontier can make a cheaper model behave better — which is a cost lever, and lesson 21 is about spending them well.

A caution on the two kinds you cannot inspect. Parametric memory — what the model learned in training — is free, instant and unverifiable. You cannot audit it, update it, or cite it. Whenever a fact matters, a grounded answer from external memory beats a remembered one, which is the whole argument of lesson 08 restated as a memory problem.

Memp: Exploring Agent Procedural MemoryarXiv 2508.06433

Memory as a named component

🇧🇷🇲🇽🇨🇴 Brazil · Mexico · Colombia

Nubank — working memory as a versioned part

5
components, versioned separately
131m
customers served
100%
of conversations audited

Nubank decomposed their agents into five independently versioned components: Instructions, Routines, Macros, tool specifications and working memory. Memory is not an add-on in that design — it is a named part with its own version history, changed and rolled back like any other.

That is the organisational form of this lesson’s argument. Routines are procedural memory. Macros are reusable procedures. Instructions carry the constraints. Once each has its own version, a behaviour change can be traced to the specific memory that changed — which is impossible when all of it is one prompt that somebody edited.

What to build at your size

Memory is where small teams most reliably over-build. Three of the five below are skips at seed, and one stays a skip almost all the way up.

Interactive · calibrate to your stage

What to actually do about this, at your size

Nearly all guidance on this topic is written for one company size and then read by everyone. Pick yours — the list re-sorts, and what you should deliberately not build drops to the bottom.

  • Semantic memory — a facts storeDo it

    A small key-value store of durable facts about each user, read at the start of a session.

    At this stage · Now with a written policy on what gets stored and what does not, because “remember everything about the user” becomes a privacy question the moment you have real ones.

  • Procedural memory — written down, not rememberedDo it

    The rules for how this task is done, kept in a versioned file rather than in someone's head.

    At this stage · Split per task type once one prompt is serving three jobs. A rule that only applies to refunds should not be loaded for every conversation.

  • Prospective memory — a durable schedulerCheap version

    Storing a future intention with a trigger, and something outside the conversation to fire it.

    At this stage · A row in a table and a cron job. Resist anything more sophisticated — this is the least novel thing on the page and the most commonly over-built.

  • Episodic memory — reading past runs backSkip it

    Retrieving similar past trajectories and putting their outcomes in front of the model.

    At this stage · Still skip. Store the traces, absolutely, but reading them back automatically is a retrieval problem on top of an agent problem, and the agent is not stable yet.

  • Distilling procedures from past runsSkip it

    Deriving the rules automatically from trajectories rather than writing them by hand.

    At this stage · Still skip. Research shows this works — Memp distilled trajectories into reusable scripts with rising success rates — but it is a research capability, not a product feature you switch on.

2 of 5 deliberately skipped at this stage. Knowing which controls you are choosing not to build, and being able to say why, is a stronger signal than having built all of them.

What to remember

  1. 1
    Name which memory you mean

    Seven different things share the word. Reaching for a vector database when the problem is a durable fact, or a facts store when the problem is coverage, is the usual reason a memory project disappoints.

  2. 2
    Semantic saves what is true, episodic saves what happened

    The customer is in Bengaluru is semantic. Run 8842 hit the ceiling is episodic. Most teams have episodic memory already — it is called their trace store — and never read it back.

  3. 3
    Decide deletion before you decide writing

    Six operations matter, not one, and forgetting is the one everybody skips. A store with no expiry is an append-only log that will eventually make the agent worse.

  4. 4
    Procedural memory has the best return at every size

    It is your system prompt, in version control, with a reason recorded for each rule. Cheapest to build, easiest to evaluate, and the only kind that is a 'do' at seed and still a 'must' at scale.

Sources

Every source in this lesson

Primary sources wherever one exists. Where a claim is contested or vendor-reported, the lesson says so at the point it is made.

Paper
  • Cognitive Architectures for Language AgentsarXiv 2309.02427

    Sumers, Yao, Narasimhan and Griffiths, TMLR. The source of four of the seven, borrowed from decades of cognitive-architecture work. Its definitions are usefully blunt: semantic memory “stores facts about the world”, episodic memory “stores sequences of the agent’s past behaviors”, and procedural memory “stores the production system itself”.

  • Rethinking Memory in LLM based Agents: Representations, Operations, and Emerging TopicsarXiv 2505.00675

    Du et al., 2025. Splits memory into parametric — implicit in the weights — and contextual, and names the six operations most taxonomies leave out: consolidation, updating, indexing, forgetting, retrieval and condensation. The operations are where the engineering actually is.

  • Memp: Exploring Agent Procedural MemoryarXiv 2508.06433

    Fang et al., 2025. Distils past trajectories into step-by-step instructions and higher-level scripts, and keeps updating, correcting and deprecating them. Two findings worth carrying: success rates rise as the repository is refined, and the procedures transfer from a stronger model to a weaker one.

  • Lost in the Middle: How Language Models Use Long ContextsarXiv 2307.03172

    Liu et al., TACL. The reason a bigger working memory is not the answer to a memory problem: accuracy is highest at the start and end of the context and sags in the middle, even in models built for long contexts.

Docs
  • Memory toolAnthropic docs

    A working implementation to argue from: a client-side directory of files the model reads and writes with six commands. Note where the responsibility sits — your handler executes every operation, so path-traversal validation is yours. The API injects its own system instruction, ending “ASSUME INTERRUPTION: Your context window might be reset at any moment.”

  • Context editingAnthropic docs

    Clearing old tool results is forgetting implemented as a product feature. Pairs with the memory tool for the obvious reason: you can only afford to clear what you have written down somewhere durable first.

  • Prompt cachingAnthropic docs

    Working memory has a price as well as a size. Cache reads are billed at 0.1x base input, which is what makes a long-lived working set affordable — and what a memory design that rewrites its own prefix quietly throws away.

Lesson 13
Context engineering
Lesson 15
Evals for agents