Skip to content

Agent Memory Is Infrastructure

ctx

The Problem Isn't Forgetting: It's Not Building Anything That Lasts.

Jose Alekhinne / March 4, 2026

A New Developer Joins Your Team Tomorrow and Clones the Repo: What Do They Know?

If the answer depends on which machine they're using, which agent they're running, or whether someone remembered to paste the right prompt: that's not memory.

That's an accident waiting to be forgotten.

Every AI coding agent today has the same fundamental design: it starts fresh.

You open a session, load context, do some work, close the session. Whatever the agent learned (about your codebase, your decisions, your constraints, your preferences) evaporates.

The obvious fix seems to be "memory":

  • Give the agent a "notepad";
  • Let it write things down;
  • Next session, hand it the notepad.

Problem solved...

...except it isn't.


The Notepad Isn't the Problem

Memory is a runtime concern. It answers a legitimate question:

How do I give this stateless process useful state?

That's a real problem. Worth solving. And it's being solved: Agent memory systems are shipping. Agents can now write things down and read them back from the next session: That's genuine progress.

But there's a different problem that memory doesn't touch:

The project itself accumulates knowledge that has nothing to do with any single session.

  • Why was the auth system rewritten? Ask the developer who did it (if they're still here).
  • Why does the deployment script have that strange environment flag? There was a reason... once.
  • What did the team decide about error handling when they hit that edge case two months ago?

Gone!

Not because the agent forgot.

Because the project has no memory at all.


The Memory Stack

Agent memory is not a single thing. Like any computing system, it forms a hierarchy of persistence, scope, and reliability:

Layer Analogy Example
L1: Ephemeral context CPU registers Current prompt, conversation
L2: Tool-managed memory CPU cache Agent memory files
L3: System memory RAM/filesystem Project knowledge base

L1 is what the agent sees right now: the prompt, the conversation history, the files it has open. It's fast, it's rich, and it vanishes when the session ends.

L2 is what agent memory systems provide: a per-machine notebook that survives across sessions. It's a cache: useful, but local. And like any cache, it has limits:

  • Per-machine: it doesn't travel with the repository.
  • Unstructured: decisions, learnings, and tasks are undifferentiated notes.
  • Ungoverned: the agent self-curates with no quality controls, no drift detection, no consolidation.
  • Invisible to the team: a new developer cloning the repo gets none of it.

The problem is that most current systems stop here.

They give the agent a notebook.

But they never give the project a memory.

The result is predictable: every new session begins with partial amnesia, and every new developer begins with partial archaeology.

L3 is system memory: structured, versioned knowledge that lives in the repository and travels wherever the code travels.

The layers are complementary, not competitive.

But the relationship between them needs to be designed, not assumed.


Software Systems Accumulate Knowledge

Software projects quietly accumulate knowledge over time.

Some of it lives in code. Much of it does not:

  • Architectural tradeoffs.
  • Debugging discoveries.
  • Conventions that emerged after painful incidents.
  • Constraints that aren't visible in the source but shape every line written afterward.

Organizations accumulate this kind of knowledge too:

Slowly, implicitly, often invisibly.

When there is no durable place for it to live, it leaks away. And the next person rediscovers the same lessons the hard way.

This isn't a memory problem. It's an infrastructure problem.

We wrote about this in Context as Infrastructure: context isn't a prompt you paste at the start of a session.

Context is a persistent layer you maintain like any other piece of infrastructure.

Context as Infrastructure made the argument structurally. This post makes it through time and team continuity:

The knowledge a team accumulates over months cannot fit in any single agent's notepad, no matter how large the notepad becomes.


What Infrastructure Means

Infrastructure isn't about the present. It's about continuity across time, people, and machines.

git didn't solve the problem of "what am I editing right now?"; it solved the problem of "how does collaborative work persist, travel, and remain coherent across everyone who touches it?"

  • Your editor's undo history is runtime state.
  • Your git history is infrastructure.

Runtime state and infrastructure have completely different properties:

Runtime state Infrastructure
Lives in the session Lives in the repository
Per-machine Travels with git clone
Serves the individual Serves the team
Managed by the runtime Managed by the project
Disappears Accumulates

You wouldn't store your architecture decisions in your editor's undo history.

You'd commit them.

The same logic applies to the knowledge your team accumulates working with AI agents.


The git clone Test

Here's a simple test for whether something is memory or infrastructure:

If a new developer joins your team tomorrow and clones the repository, do they get it?

If no: it's memory: It lives somewhere on someone's machine, scoped to their runtime, invisible to everyone else.

If yes: it's infrastructure: It travels with the project. It's part of what the codebase is, not just what someone currently knows about it.

Decisions. Conventions. Architectural rationale. Hard-won debugging discoveries. The constraints that aren't in the code but shape every line of it.

None of these belong in someone's session notes.

They belong in the repository:

  • Versioned;
  • Reviewable;
  • Accessible to every developer (and every agent) who works on the project.

The team onboarding story makes this concrete:

  1. New developer joins team. Clones repo.
  2. Gets all accumulated project decisions, learnings, conventions, architecture, and task state immediately.
  3. There's no step 3.

No setup; No "ask Sarah about the auth decision."; No re-discovery of solved problems.

  • Agent memory gives that developer nothing.
  • Infrastructure gives them everything the team has learned.

Clone the repo. Get the knowledge.

That's the test. That's the difference.


What Gets Lost Without Infrastructure Memory

Consider the knowledge that accumulates around a non-trivial project:

  • The decision to use library X over Y, and the three reasons the team decided Y wasn't acceptable.
  • The constraint that service A cannot call service B synchronously, discovered after a production incident.
  • The convention that all new modules implement a specific interface, and why that convention exists.
  • The tasks currently in progress, blocked, or waiting on a dependency.
  • The experiments that failed, so nobody runs them again.

None of this is in the code.

None of it fits neatly in a commit message.

None of it survives a developer leaving the team, a laptop dying, or a new agent session starting.

Without structured project memory:

  • Teams re-derive things they've already derived;
  • Agents make decisions that contradict decisions already made;
  • New developers ask questions that were answered months ago.

The project accumulates knowledge that immediately begins to leak.

The real problem isn't that agents forget.

The real problem is that the project has no persistent cognitive structure.

We explored this in The Last Question: Asimov's story about a question asked across millennia, where each new intelligence inherits the output but not the continuity. The same pattern plays out in software projects on a smaller timescale:

  • Context disappears with the people who held it;
  • The next session inherits the code but not the reasoning.

Infrastructure Is Boring. That's the Point.

Good infrastructure is invisible:

  • You don't think about the filesystem while writing code.
  • You don't think about git's object model when you commit.

The infrastructure is just there: reliable, consistent, quietly doing its job.

Project memory infrastructure should work the same way.

It should live in the repository, committed alongside the code. It should be readable by any agent or human working on the project. It should have structure: not a pile of freeform notes, but typed knowledge:

  • Decisions with rationale.
  • Tasks with lifecycle.
  • Conventions with a purpose.
  • Learnings that can be referenced and consolidated.

And it should be maintained, not merely accumulated:

The Attention Budget applies here: unstructured notes grow until they overflow whatever container holds them. Structured, governed knowledge stays useful because it's curated, not just appended.

Over time, it becomes part of the project itself: something developers rely on without thinking about it.


The Cooperative Layer

Here's where it gets interesting.

Agent memory systems and project infrastructure don't have to be separate worlds.

  • The most powerful relationship isn't competition;
  • It is not even "coopetition";
  • The most powerful relationship is bidirectional cooperation.

Agent memory is good at capturing things "in the moment": the quick observation, the session-scoped pattern, the "I should remember this" note.

That's valuable. That's L2 doing its job.

But those notes shouldn't stay in L2 forever.

The ones worth keeping should flow into project infrastructure:

  • classified,
  • typed,
  • governed.
Agent memory (L2)  -->  classify  -->  Project knowledge (L3)
                                        |
Project knowledge  -->  assemble  -->  Agent memory (L2)

This works in both directions: Project infrastructure can push curated knowledge back into agent memory, so the agent loads it through its native mechanism.

No special tooling needed for basic knowledge delivery.

The agent doesn't even need to know the infrastructure exists. It simply loads its memory and finds more knowledge than it wrote.

This is cooperative, not adjacent: The infrastructure manages knowledge; the agent's native memory system delivers it. Each layer does what it's good at.

The result: agent memory becomes a device driver for project infrastructure. Another input source. And the more agent memory systems exist (across different tools, different models, different runtimes), the more valuable a unified curation layer becomes.


A Layer That Doesn't Exist Yet

Most projects today have no infrastructure for their accumulated knowledge:

  • Agents keep notes.
  • Developers keep notes.
  • Sometimes those notes survive.

Often they don't.

But the repository (the place where the project actually lives) has nowhere for that knowledge to go.

That missing layer is what ctx builds: a version-controlled, structured knowledge layer that lives in .context/ alongside your code and travels wherever your repository travels.

Not another memory feature.

Not a wrapper around an agent's notepad.

Infrastructure. The kind that survives sessions, survives team changes, survives the agent runtime evolving underneath it.

The agent's memory is the agent's problem.

The project's memory is an infrastructure problem.

And infrastructure belongs in the repository.

If You Remember One Thing From This Post...

Prompts are conversations: Infrastructure persists.

Your AI doesn't need a better notepad. It needs a filesystem:

versioned, structured, budgeted, and maintained.

The best context is the context that was there before you started the session.


The Arc

This post extends the argument made in Context as Infrastructure. That post explained how to structure persistent context (filesystem, separation of concerns, persistence tiers). This one explains why that structure matters at the team level, and where agent memory fits in the stack.

Together they sit in a sequence that has been building since the origin story:

The thread running through all of them: persistence is not a feature. It's a design constraint.

Systems that don't account for it eventually lose the knowledge they need to function.


See also: Context as Infrastructure: the architectural companion that explains how to structure the persistent layer this post argues for.

See also: The Last Question: the same argument told through Asimov, substrate migration, and what it means to build systems where sessions don't reset.