Context engineering

Memory system

Also called: agent memory

A memory system is an external store the harness uses to persist facts across sessions and reload them into context. It is how a stateless model ends up behaving as if it remembers you and your project.

James Phoenix
Understanding Data Updated July 2, 2026

The model is stateless. It forgets everything the moment a request finishes. A memory system is how a harness papers over that gap. It writes facts to an external store, then reads them back into context on a later run, so the agent behaves as if it remembers your project.

Memory is just text the harness reloads

Nothing is stored inside the model. Memory lives outside it, in places you control:

  • Files in the repo, like an AGENTS.md of standing conventions.
  • Scratch notes an agent writes for its future self.
  • A database of facts keyed by user or project.

At the start of a new session, the harness pulls the relevant slice back in. That is the whole trick: the "memory" is real files and records, and being stateful is a property of your system, not the model.

Keep it small and current

The danger is a memory system that grows without bound. Everything it reloads spends space in the context window and thins the model's attention. Store the durable stuff (decisions, conventions, hard-won facts) and let the transient stuff go. Stale memory is worse than none, because the agent will trust an outdated fact as confidently as a fresh one.

Tip
Treat memory as a curated file you edit, not an append-only log. A tight set of true, relevant facts beats a giant transcript the model has to wade through every session.

Related terms

Building with AI agents?

This dictionary is part of how I think about agentic engineering. If you want the same thinking applied to your codebase, that is what I do.

See how I can help