hcd.ai
AI in Practice

Your AI Might Remember, But Does It Learn?

Most AI interactions reset between conversations. Larger context windows enable longer sessions, some systems compress conversations into summaries you can pick up later, and uploaded documents provide static knowledge. What you actually need is an AI that learns from every interaction it has with you. Neuroscience provided insight into this problem 30 years ago with Complementary Learning Systems theory. Inspired by Marcel Meyer's recent post on why AI agents need a hippocampus, I applied that theory to build a self-learning memory system for my AI agents platform. Here's how it works, and how you can build one too.

The Problem: Persistence Is Not Learning

You've had hundreds of conversations with AI by now. Probably thousands. You've walked it through your business strategy, corrected its tone, and explained your preferences, multiple times. Here's the uncomfortable question: has it really learned anything from all of that? In most cases, the honest answer is not really.

ChatGPT's memory stores facts across sessions. Claude's projects carry context between conversations. Gemini draws on your Google account. All useful. All forms of pre-loading. You decide what to include. You package the context. You feed it back in each time. The AI hasn't retained anything from the actual interaction. It hasn't noticed which approach landed well with your audience, or extracted a pattern from the last ten sessions where you corrected the same mistake. Loading is not learning.

What would actual learning look like? Imagine you correct your AI's tone in a client email on Tuesday. On Thursday, when drafting a similar email for a different client, it already writes in the corrected tone. Nobody told it to. It noticed the correction, extracted the principle, and applied it to a new situation. Or imagine your analytics tool misinterprets a data spike as growth when it's actually bot traffic. You flag the error once. Next month, when a similar spike appears, the system checks for bots before reporting. That's learning. The distance between that and what we have today is enormous.

How does expertise actually develop? Not from briefing packs. I've worked with senior designers who can look at a wireframe for ten seconds and tell you exactly where users will get stuck. They can't always explain how they know. It came from years of watching people use interfaces, noticing what tripped them up, internalising those patterns until the judgement became automatic. That's what learning looks like. Your AI doesn't do any of that.

The money tells one story: McKinsey (2023) estimates $2.6 to $4.4 trillion in annual enterprise value from generative AI. The trust tells another. Capgemini (2026) found 71% of organisations say they cannot fully trust autonomous AI agents for enterprise use. That gap exists partly because AI keeps forgetting what it learned last week. You wouldn't trust an employee who needed re-training every morning.

The Neuroscience Blueprint

We already know how to build systems that learn from experience. The blueprint has existed in neuroscience literature since 1995.

McClelland, McNaughton and O'Reilly (1995) proposed Complementary Learning Systems (CLS) theory. The core insight is simple enough to fit on an index card: your brain doesn't run on one memory system. It runs on two, and they work in tension with each other.

The hippocampus captures fast, episodic memories. What happened today. The conversation you just had. The mistake you caught this morning. It records quickly and specifically. The neocortex stores something different entirely: slow, generalised knowledge built up over months and years. How to ride a bike. What "good writing" looks like. Patterns absorbed through repetition that you can't quite articulate but act on instinctively.

This is where expertise lives. But the neocortex has a vulnerability. If it tried to absorb new information too quickly, it would overwrite the patterns it already holds. This problem, called catastrophic interference (McCloskey & Cohen, 1989), was first demonstrated in artificial neural networks: train one on a new task and it overwrites what it learned on the last. The brain avoids it by keeping the neocortex slow and selective about what gets integrated, using consolidation as a buffer.

Consolidation bridges the two systems. During sleep, the hippocampus replays the day's episodes, and the neocortex gradually weaves them into lasting knowledge. Episodes that keep recurring get strengthened. The ones that don't, fade. This is the mechanism that turns raw experience into durable expertise, and it happens without conscious effort.

Kumaran, Hassabis and McClelland (2016) updated the theory with goal-directed replay and drew explicit connections to intelligent agent design. Their conclusion was direct: any system that needs to learn continuously from experience needs both kinds of memory, connected by a consolidation process. One system for fast capture. One for slow integration. And a replay mechanism running between them.

Marcel Meyer (2026) took that conclusion and applied it to AI agents in "Why AI Agents Need a Hippocampus". His argument is straightforward. AI agents need the same architecture the brain uses. Fast capture during work. Slow integration overnight. Two memory systems, connected by replay. That post is what prompted me to formalise the architecture I'm about to describe.

The Four-Stage Memory Loop

When you apply CLS theory to AI agents, it produces four stages running in a continuous loop. Each stage maps to a neuroscience concept, but the implementation is surprisingly mundane. Files on disk. Scheduled jobs. Plain text.

Working memory. The live conversation. Ephemeral by nature, same as it's always been. But unlike today's AI, this version doesn't start cold. It begins with everything the system has learned so far already loaded into context. The first message in any session carries the accumulated weight of every session before it.

Episodic memory. When a session ends, a structured record gets captured automatically. Not a raw transcript (those are too noisy, too long, and too expensive to reload). What gets saved is a summary of what mattered: decisions made, corrections given, mistakes that occurred, insights that surfaced. Each episode carries a context signature, the task type, domain, and complexity level, so the system can match similar situations later. Not just keywords. Situations.

Consolidation. A scheduled process replays recent episodes and extracts patterns. What kept recurring across sessions? What failed more than once? Where did the user have to step in and correct something the system should've caught? The answers get distilled into durable knowledge. This is the sleep replay from neuroscience, translated into a job that runs once a day.

Semantic memory. The output of consolidation. Distilled, durable knowledge that persists across everything: cross-project patterns, recorded failures, user preferences, accumulated domain expertise. Not a transcript and not a summary. A set of learned heuristics, weighted by confidence. This loads at the start of every new session. The loop closes.

Every session feeds the next one. The system compounds. And because each stage has a clear input and output, the whole thing is auditable. You can read exactly what the system learned, when it learned it, and from which episodes.

My memory-overview.md file

What does this actually look like? Here's the overview of my memory architecture which you can similarly implement.

Scope Layer Used by What it does
Session Context window (working memory) Project Live conversation: prompts, responses, tool calls. Ephemeral. Gone when the session ends.
Raw transcripts (.jsonl) Project (never crosses client boundaries) Full JSONL logs of every tool call, response, and token. Deep archive when episodes or semantic memory lack the detail needed. Retained indefinitely.
Episodes (episodic memory) Project (never crosses client boundaries) Structured summary of what mattered: decisions, corrections, failures, insights. Not a raw log. Marked as consolidated, never deleted.
Day Daily logs (reports/{date}.log) Global (shared across all projects) Agent usage, hook activity, API calls, costs. One file per day.
Consolidation reports Global (shared across all projects) What changed in long-term memory and why. Executive summary per run.
Ongoing Semantic memory (long-term memory) Both: project (patterns, failures, clients) and global (patterns, failures, agents, skills, user) Distilled patterns, failures, agent/skill heuristics, user profile. Accumulates and strengthens over time. Privacy gate controls what promotes from project to global. Entries decay after 30 days without activation.

Two tiers. Global memory sits in memory/ and contains knowledge that applies everywhere: who I am, how I write, what's gone wrong before. Project-scoped memory lives inside each project and holds episode records, handoff notes, and anything specific to that engagement. During consolidation, project-scoped learnings get generalised (and anonymised, when the project involves client work) before they're promoted to global memory. Think of it like an employee who carries accumulated experience between roles but never client confidential information. The privacy boundary is structural, not a policy someone has to remember to follow.

A few design choices worth calling out. New patterns enter at low confidence and only strengthen when they recur across multiple sessions. After 30 days without activation, they decay and eventually drop out of active memory. The system forgets what's no longer relevant, which matters just as much as remembering what is. Without decay, semantic memory bloats into noise, and the system starts loading stale context that actively gets in the way of the current task.

Failures are different. They always enter at high weight. The system remembers burns more than warmth, borrowed from how the brain prioritises negative outcomes for survival. If an analytics report once misled a decision because bot traffic wasn't filtered, that lesson loads into every analytics session from that point forward, at full confidence, regardless of how long ago it happened.

The entire memory system is a directory you can open in a text editor. Every file is readable, editable, and diffable in git. That's deliberate. If the AI learns something wrong, I can see it, correct it, and the correction itself becomes a learning event.

A Working Implementation

This runs daily on my machine, built on Claude Code. Despite the name, it functions as a file-based agent runtime: it reads and writes to disk, supports hooks that fire at session boundaries, runs scheduled jobs, and persists everything as plain text files.

A startup hook loads accumulated knowledge: who I am, how I work, what patterns have proven reliable, what happened last session. An end-of-session hook captures the structured episode. At midday, a consolidation process replays any unconsolidated episodes and updates long-term memory.

Specialist agents for different domains (content strategy, front-end development, etc.) each read their own memory file on startup, containing accumulated heuristics and past corrections specific to that domain. They get sharper with every use.

What does a consolidation cycle actually produce? Say we had ten writing sessions over two weeks all involved writing about a particular topic. In some, the opening led with the technology and the article fell flat. In others, the opening led with a business problem the reader would recognise, and engagement was noticeably higher. Consolidation surfaces that pattern and writes it into semantic memory as a heuristic: "Lead with the business problem, not the technology." I didn't author that rule. The system extracted it from what worked and what didn't.

Session handoff keeps the loop tight in a different way. When a session ends, the system writes a forward-looking note to its future self. What happened, what's still unfinished, and what to pick up first. The next session reads that on startup and picks up mid-thought. No re-explanation needed.

Decay is worth mentioning separately, because it's easy to overlook. A heuristic that came up in three sessions six months ago but hasn't been relevant since will gradually lose confidence and eventually fall out of active memory. This is intentional. Without it, semantic memory fills up with stale patterns from old projects, and the system wastes context window on advice that no longer applies. Forgetting is a feature, not a failure mode.

What This Means for Organisations

The gap between "AI assistant" and "AI that learns your business" isn't a model problem. It's an architecture problem, solvable today. Memory is something you design, not something you wait for a vendor to ship.

Ask this question: what does your AI remember from last week? If the answer is nothing unless someone manually loaded the context back in, you don't have a learning system. You have an expensive autocomplete with amnesia. The architecture to fix that is buildable today, on tools that already exist, by teams that don't need a research lab or a custom model to make it work. Plain text files, session hooks, a scheduled consolidation job.

The organisations that implement this won't just have better AI tools. They'll have AI that gets better at their business every week, without anyone manually feeding it context. That's compounding. And compounding, in any domain, is the only advantage that actually holds.


Frequently Asked Questions

What is the difference between loading and learning in AI?

Loading is when you provide the AI with information at the start of a session: system prompts, uploaded documents, RAG retrieval, custom instructions. The AI can use that information during the conversation, but it doesn't retain anything from the experience. Learning would mean the AI notices patterns across sessions, remembers what worked, avoids past mistakes, and gets better over time without you manually feeding it the same context.

What is Complementary Learning Systems theory?

CLS theory comes from neuroscience. McClelland, McNaughton and O'Reilly first proposed it in 1995, describing how the brain uses two memory systems: the hippocampus for fast episodic capture and the neocortex for slow generalised knowledge. Consolidation during sleep connects the two. Kumaran, Hassabis and McClelland updated the theory in 2016 with implications for intelligent agent design, and Marcel Meyer applied it specifically to AI agent memory architecture in his February 2026 LinkedIn article.

Can AI actually learn between sessions?

Most AI platforms now offer basic persistence: stored preferences, project context, or account integration. But none of them learn from the interaction itself. With the right architecture (episodic memory capture, consolidation processes, and semantic memory storage), AI systems can compound knowledge over time. The constraint isn't the model's intelligence. It's whether there's a memory layer around it.

What is Claude Code?

Claude Code is Anthropic's command-line interface, originally designed for software engineers to use Claude for coding tasks. In practice, it functions as a file-based agent runtime with hooks, scheduled jobs, and persistent storage, making it capable of far more than code generation.

How does AI memory architecture handle client privacy?

The two-tier memory model separates global knowledge (cross-project patterns and expertise) from project-scoped memory (client-specific data). A privacy gate during consolidation ensures client-isolated projects only contribute generalised, anonymised learnings to global memory, just like a consultant who carries expertise but not client details between engagements.

Midjourney