AISeries

How Agents Learn

Agents don't learn by retraining the model -- they learn at the harness layer, through context, memory, and reflection.

H
Harnyss Team
May 10, 2026 · 9 min read

When most people hear "the AI is learning," they picture model training — gradient descent, weight updates, a researcher staring at a loss curve. That's not what happens with agents.

The language model an agent is built on is frozen. Its weights are fixed at the moment training ended. When Claude Opus 4.7 shipped in early 2026 with its January 2026 knowledge cutoff, every copy of it — the one running your customer support, the one drafting your blog posts, the one reconciling your ledger — has the exact same knowledge. They will all still have that same knowledge a year from now.

So when we say an agent learns, we mean something different. We mean the system around the model gets better at a task over time, even though the model itself doesn't change. That distinction matters, because it shapes the entire architecture of a useful AI agent.

This series walks through how that works in practice. Part 1 — this post — gives the overview. Part 2 goes deep on memory. Part 3 covers what we call agent dreams: the offline reflection process that turns raw experience into actionable patterns.


The three layers where learning actually happens

If the model itself is frozen, where does new knowledge live? In modern agent systems, three places:

1. Context (within a single turn)

The simplest layer. The model sees whatever you put in front of it — a system prompt, the conversation history, retrieved documents, tool results. Anything in that window influences the response. Nothing in that window persists.

Anthropic's recent work on prompt caching and server-side compaction sits at this layer. Caching lets you reuse a stable prefix (system prompt, prior conversation turns) at roughly 10% the cost of fresh input tokens. Compaction kicks in automatically when a long-running session approaches the context window — the API summarizes earlier turns into a <summary> block so the conversation can keep going without overflow. Both are mechanical: they don't change what the model knows, just what fits in the room.

2. Memory (between sessions)

This is where most "learning" actually lives in production systems. After a task completes, you save a representation of what happened — outputs, observations, lessons — into durable storage. The next time a related task comes along, you retrieve the relevant pieces and inject them back into context.

The simplest version is a list of facts. The richest version looks more like episodic memory in cognitive science: time-stamped, importance-weighted, indexed by similarity, with rules for what gets kept and what fades. Anthropic's memory tool for the Claude API exposes a file directory the model reads and writes. MemGPT introduced the idea of paging memory in and out of the context window like an OS handles RAM. OpenAI's GPT memory keeps user-specific notes across conversations.

The architecture varies. The principle is the same: experience persists as data, retrieval makes it available, and the agent gets better with use.

3. Reflection (offline)

The least common and most underestimated layer. After enough memories accumulate, patterns become visible across them — but only if something looks for those patterns. A raw memory pool is a pile of discrete observations. The insight that connects three of them, the contradiction hidden between two, the mistake-lesson that should be a forward-looking rule — none of that surfaces unless an explicit step does the synthesis.

The seminal work here is the 2023 Stanford paper "Generative Agents: Interactive Simulacra of Human Behavior" (Park et al). They built a small town of LLM-driven characters and gave each one a memory stream plus a periodic reflection step: when accumulated importance crossed a threshold, the agent would synthesize its recent experiences into higher-level insights stored as new, more abstract memories. The result was emergent behavior — agents who learned each other's preferences, planned around shared events, formed plausible relationships. Reflection was load-bearing.

Most production agent systems don't do this. They have memory; they don't have reflection. The gap matters more than it sounds.


What "learning" looks like end-to-end

A useful mental model: an agent's intelligence is the model's intelligence, plus everything the harness adds. The harness is the surrounding code — system prompt assembly, tool definitions, memory store, recall logic, reflection schedule. Agents learn at the harness layer.

A concrete cycle for a task that actually closes the loop:

  1. Recall. Before the task starts, the harness queries the memory store for relevant prior experience. Top matches get formatted into the system prompt.
  2. Execution. The model runs the task with that recalled context plus its tools.
  3. Self-assessment. The agent flags concerns or notes patterns in its own output.
  4. Quality gate. An evaluator scores the output. Bad outputs go to held or rejected; good ones complete.
  5. Write. A summary of the task — what was attempted, what was produced, what was observed — gets persisted to the memory store with an importance score derived from the quality outcome.
  6. Outcome correlation. If the task scored well, the memories that were recalled into context before it started get their importance bumped. They contributed to a good outcome; they should rank higher next time.
  7. Periodic reflection. On a schedule (we run weekly), the agent's full long-term memory pool gets re-read by the model, looking for patterns, contradictions, and weak lessons that should be rewritten as actionable rules.

Every loop tightens the feedback. Every successful task strengthens the memories that helped. Every failed task gets summarized so the agent knows what didn't work. Every reflection pass synthesizes raw experience into something more useful than the raw experience alone.

The model never changes. The harness gets sharper.


How Harnyss approaches each layer

We built Harnyss as a multi-agent platform — operators run a roster of specialized agents inside a workspace, each with their own memory and their own slice of responsibility. Every agent operates within a governed harness: defined mandates, autonomy tiers, and quality gates that determine what runs automatically and what surfaces for review. That architecture shaped how we approach each learning layer.

Context layer

We treat context as a resource, not a given. Every agent dispatch is engineered to put the right information in front of the model at the right cost — no more, no less. On long-running tasks, we handle context overflow automatically so agents can sustain work across extended tool loops without losing the thread. The goal is that agents always have the context they need, and operators never have to think about it.

Memory layer

Each agent in a workspace maintains its own persistent memory — a living record of what it has done, what worked, and what didn't. Memories aren't kept indefinitely in raw form; they're managed actively, with older or lower-value observations consolidating into summaries over time while the most important lessons persist.

The piece that matters most: agents don't just retrieve memories, they retrieve the right memories. Relevance and recency both factor into recall. A lesson learned last week from a high-quality outcome outranks a similar but stale observation — because freshness signals that the pattern still holds.

Agents also share. When an agent develops a strong, validated insight — something that holds across multiple tasks — it can propagate that to the broader workspace, where peer agents benefit from it too. An organization of agents that learns collectively is structurally different from one where each agent starts from scratch.

Part 2 of this series goes deeper into the memory architecture.

Reflection layer

This is the one almost nobody else does, and we think it's the most important.

Accumulating memories is not the same as learning from them. A memory pool without reflection is a pile of observations — individually accurate, collectively unprocessed. The patterns across them, the contradictions between them, the mistake-lessons that should have been rewritten as forward-looking rules months ago — none of that surfaces on its own.

We run a structured reflection pass for every active agent on a weekly cadence. The agent reviews its accumulated experience, synthesizes patterns that hold across multiple observations, surfaces contradictions for resolution, and upgrades weak lessons into actionable guidance. The strongest insights flow automatically to the workspace pool, so the whole organization benefits.

The result is an agent roster that gets meaningfully better over time — not because the underlying model changed, but because the harness around it is doing the work of turning experience into intelligence.

Part 3 unpacks the reflection process in detail.

What we don't do

We don't fine-tune. We don't try to update the underlying model weights. The model is the model; everything we build is harness. That's a deliberate choice — frozen models are predictable, auditable, and cheap to switch when a better one ships. Agents that "learn" via fine-tuning are agents you can't migrate.


Why this matters in practice

The pitch for agent platforms tends to be productivity. The reality, in our experience, is that productivity follows from continuity. An agent that remembers the brand voice you spent two hours coaching it on three weeks ago is qualitatively different from an agent that re-discovers your style every Tuesday. An agent that's read its own past failures and rewrote them as rules-of-thumb hits fewer of the same potholes a second time. An agent in a workspace where its peers can broadcast the lessons they've learned is part of an organization, not a solo contractor.

None of that requires retraining the model. It requires a serious memory layer, a thoughtful recall ranker, an outcome-correlated reinforcement loop, and an offline reflection step that finds the patterns the agent didn't notice in the moment.

Those four things — memory, recall, reinforcement, reflection — are how agents learn.


Part 2: How Agents Have Memory — a deeper look at memory architecture, vector search, importance scoring, and the recall problem.

Part 3: Agent Dreams — what we found when we gave each agent a weekly reflection pass, and what we're still figuring out.

More in AI

AI

Workflow Automation Follows a Script. A System of Operation Runs the Function.

Workflow automation runs the steps you set up in advance. A system of operation is handed a goal and works out the steps itself — including when something happens that no one planned for.

Harnyss Team
Jun 1, 2026 · 5 min read
Read →
AI

Systems of Operation: The Next Category of Business Software

Business software has had two great eras — systems of record that remember, and systems of engagement that help. A third is starting: systems of operation that do the work. Here's the case that it's a genuine new category, not a feature.

Harnyss Team
May 28, 2026 · 6 min read
Read →
AI

The Self-Operating Company

Every business tool ever built made the human operating it faster. A self-operating company is different — the function runs, and the human sets direction instead of driving the software. Here's what that actually changes.

Harnyss Team
May 28, 2026 · 5 min read
Read →