RAG vs Memory

RAG retrieves relevant passages from a general document collection to answer the current question. Memory is information a system deliberately saved earlier — about a specific user, a specific session, a specific fact learned before — and brings back later because it chose to keep it. The real question isn't which is more advanced; it's whether the information you need should be retrieved from a shared knowledge base or remembered from something that already happened.

What RAG does

Searches a store of documents for the passages most relevant to the current question and hands them to the model alongside it, so the model can answer using material it was never trained on. The same retrieval happens the same way for every user asking a similar question. Learn more: RAG.

What Agent Memory does

Deliberately stores and later retrieves information specific to a session or a user — preferences stated earlier, a fact from a previous conversation, a decision made in an earlier project. Unlike RAG's document collection, this content is specific to who or what generated it, and different users get different memories back, not the same shared corpus. Learn more: Agent Memory.

Side by side

RAGMemory
SourceA general document collectionInformation saved from this user or session specifically
Same for every user?Yes — same corpus, same retrievalNo — different per user or session
What it answers"What does this policy/document say?""What did we already establish about this person or task?"
Updating itAdd or edit a document, re-indexThe system decides what's worth saving, as it goes

Which one your problem calls for

Reach for RAG when the answer lives in a shared body of knowledge — a policy document, product documentation, a knowledge base — that's the same for every user asking about it.

Reach for memory when the answer is specific to this particular user or session — a preference they stated, a fact from an earlier conversation, something that's true for them and not for anyone else asking a similar question.

A support assistant often needs both: RAG to answer "what's our refund policy," memory to recall "this customer already told us their order number in an earlier message today."

In this guide
  1. What RAG does
  2. What Agent Memory does
  3. Side by side
  4. Which one your problem calls for
  5. FAQ

FAQ

Could the same underlying mechanism power both RAG and memory?

Often, yes — retrieving stored memories by relevance looks a lot like RAG's own retrieval step, mechanically. What's different is what's being searched: a shared document collection for RAG, a store of things learned specifically about this user or session for memory.