Agent memory or just RAG? When RAG is enough

Use RAG alone when what your agent needs is already in documents someone keeps. Add memory only when your sessions create knowledge written down nowhere else.

On this page

You need only RAG when everything your agent has to know already lives in a source that people keep current: your docs, a knowledge base, the code itself. You need agent memory when your sessions create knowledge that’s written down nowhere else, like a choice you made and why, a correction you gave, or the cause of a bug you found, and you’d otherwise explain it again next week. If nothing important gets decided in the conversation, a memory layer is more than you need.

A five-question test

Answer these for the work your agent actually does, not for agents in general.

Question If yes If no
Is the knowledge already kept by someone, in docs or code? RAG over that source Someone has to write it down: that’s memory
Does today’s session depend on what happened in the last one? Memory, or at least a handoff note RAG, or nothing
Do you correct the agent on the same thing twice? One line in an instructions file, or memory Nothing to add
Does what’s true change while you work? Memory that can retire old notes RAG is fine
Will someone read what the agent writes? Memory can work Stay with RAG

The last row is the one most guides leave out. A memory nobody reads drifts, and an agent will act on a wrong note as readily as a right one. If you can’t spare a few minutes a week to look at what got saved, read-only retrieval is the safer choice.

For what each one is, rather than which one you need, see Agent memory vs RAG: the write path.

When RAG is enough

RAG is enough when the source of truth already exists and has an owner. Three common cases:

  • Questions over docs. A support assistant or an internal Q&A bot answers from a knowledge base that a team keeps up to date. An agent writing its own copy of those answers would only drift from the original.
  • Independent sessions. Each conversation stands alone: one ticket, one question, one customer. Remembering the last one adds nothing, and sometimes it shouldn’t be kept at all.
  • Facts the code already states. A coding agent can read the repository. A note that says what the code says is a second copy, and the second copy is the one that goes stale.

The third case is easy to get wrong, so here’s our own example. Memorinth is built with its own memory. Its cortex holds a fact note listing the app’s keyboard shortcuts. Every time the shortcuts changed, the old fact was retired and a new one written: there have been seven versions so far, six of them retired. Reading the shortcut registry in the code would have given the current answer every time. That’s a lookup, and RAG (or plain search over the code) is the right tool for it. Memorinth’s own CLAUDE.md now says it outright: “Don’t record what the code or git history already says.”

When an instructions file is enough

For a coding agent, a short instructions file covers much of what people reach for memory to do. Claude Code loads CLAUDE.md into every session, and its documentation suggests keeping each one under 200 lines. Build commands, code style and the rules you repeat belong there.

Claude Code also has auto memory built in: Claude writes its own notes from your corrections and preferences, and the first 200 lines or 25KB of its MEMORY.md index load at the start of every session. If your project’s lasting knowledge fits in a short rules file plus that index, you don’t need a memory server. Claude Code memory: built in, or a server? goes through where that stops being enough.

When you need memory

You need memory when the work spans sessions and the knowledge is made during it. A codebase that you and your agents change every day is the typical case: the reasons behind a choice exist nowhere but in the conversation that made it.

Memorinth’s own cortex shows what that looks like. Between 9 October and 20 November 2026, the developer and their agents saved 105 decisions, 29 facts and 167 memories while building the app. Most of the decisions record a choice the user made in a session and the reason they gave, which no document held before. The test that makes them memory rather than RAG is what happened next:

  • 30 of the 105 decisions have been superseded. A later choice replaced each one, and the old note is kept, marked as replaced.
  • 12 of the 29 facts have been retired, because the thing they described changed.

Over six weeks, more than a quarter of the decisions stopped being current. A plain retrieval index over those notes would return an old decision and its replacement with the same confidence, because both match the query. Memory has to know which one stands. Memorinth’s search ranks accepted decisions and current facts higher and leaves superseded and retired notes out unless an agent asks for the history.

What memory costs

Memory isn’t free, and the costs are worth naming before you add it.

  • Wrong notes persist. RAG can return the wrong passage, but the passage itself was written by a person. A memory can be wrong at the source, and every later session believes it.
  • Reading takes time. Someone has to look at what agents save, at least now and then. Memorinth’s notes are plain Markdown files so that reading them is easy, but it still has to happen.
  • Notes that restate the code go stale. The keyboard shortcuts above are the example. The fix is a rule about what not to save, not a better retriever.
  • Every session starts with some of it. A briefing at session start uses context. A small one is cheap, but it isn’t zero.

A one-week check before you add memory

If you’re not sure, measure your own work for a week. Each time you explain something to your agent that you’ve explained before, write it down: what it was, and where it’s written today.

  • The list is short, or everything on it is in the docs or code: RAG, or a better instructions file, is enough.
  • The list is rules about how to work: put them in CLAUDE.md or AGENTS.md.
  • The list is choices, reasons and causes found during work: that’s knowledge your sessions create, and it’s what a memory layer is for.

Next

What goes where sorts instructions from knowledge, and How agents use it shows a session from the briefing to the save. For keeping memory current, read Decisions and Facts.

All posts