GuardianMemory

What is AI agent memory?

AI agent memory is what an AI agent or assistant keeps beyond a single conversation: facts about the people it works for, their preferences, decisions and what happened, stored outside the model and brought back into its context when they matter. Without it, every conversation starts from zero.

In short

  • Language models do not remember anything. What an agent seems to remember was put back in front of the model by the software around it.
  • Short-term memory is the conversation in the context window. Long-term memory is a store the agent writes to and searches, and it outlives the conversation, the session and the tool.
  • Long-term memory is usually a collection of short facts, turned into vectors and searched by meaning.
  • Memory written by agents goes bad in predictable ways: duplicates, stale facts and noise. A good memory layer merges, retires, and lets people fix what it holds.

Why AI agents forget

A language model is stateless. It reads whatever is in its context window (your message, the conversation so far, its instructions and any tool results), writes a reply, and keeps nothing. The next conversation begins with an empty window.

A bigger context window does not change that. It lets an agent hold more of one conversation, not carry anything into the next. And the memory some assistants now keep for you belongs to that assistant alone: what ChatGPT has learned about you, Claude and Cursor cannot see.

People call this agent amnesia. The fix is not a better model. It is a memory the agent can write to and read from, outside the model.

Short-term and long-term memory

Choosing what goes into the context window, and when, is what people now call context engineering. Memory is the part of it that outlives the conversation.

Short-term (working) memoryLong-term memory
Where it livesThe model's context windowA store outside the model
How long it lastsOne conversation or taskUntil it is replaced or deleted
What it holdsEverything said so farWhat was worth keeping, one fact at a time
How the agent uses itIt is already in front of the modelThe agent searches it, and loads a short profile when a conversation starts
What limits itThe size of the windowDeciding what to save, and keeping it true

The kinds of memory an agent needs

Researchers borrow three words from psychology for what an agent might keep:

For most assistants, the long-term memory that pays off is plain facts and decisions, each short enough to make sense on its own and specific enough to be found again.

How long-term memory works

Every memory system has a way in and a way out. Here is what each involves, using GuardianMemory as the worked example.

Writing a memory

  1. The agent decides something is worth keeping and saves it as one sentence that makes sense without the conversation: “Project Atlas launches on 3 November 2026”, not “it's the 3rd”.
  2. The sentence is turned into an embedding: a list of numbers that captures its meaning. GuardianMemory uses 768 of them, from Google's Gemini embedding model.
  3. Before storing it, the memory layer checks what it already holds. An exact repeat or a near-duplicate is merged, and a new fact that replaces an older one retires it.

Reading it back

  1. When a conversation starts, the agent loads a short profile, so it knows the basics before it knows what to ask. GuardianMemory's profile is pinned memories first, then the ones assistants use most, then the newest.
  2. When something comes up that it has no context for, the agent searches by meaning. “What database does billing use?” finds “The billing service runs on Postgres and Stripe” without the two sharing more than one word.
  3. What it finds goes into the context window, and the model answers with it in front of it.

Why agent memory goes bad

Memory written by agents decays in predictable ways, and each has a fix.

ProblemWhat goes wrongWhat GuardianMemory does
DuplicatesThe same fact, reworded five ways, crowds everything else out of the resultsA new memory within cosine similarity 0.95 of an existing one is merged into it
Outdated factsAn address from two moves ago sits next to the current one, and the agent picks eitherClosely related memories go to a classifier that decides whether the new one replaces them. Replaced ones are retired and kept as history
Old beats newAn old memory that matches slightly better outranks a fresh oneNewer memories get up to a 10% edge in search, fading over about 90 days
NoiseTo-dos and one-off details bury the facts that matterAssistants are told to save lasting facts, one per memory, and never secrets
Nobody can see itIf people cannot read what an agent stored, they cannot correct itEvery memory can be read, edited, pinned or deleted, and an activity log shows what each assistant did

The details, including the thresholds, are in How memory works.

Should the agent decide what to remember?

Mostly, yes, with people able to overrule it. An agent sees what comes up in conversation and is well placed to notice a decision or a preference worth keeping. It is badly placed to judge what should be forgotten, and an agent that can delete is an agent that can quietly lose things.

So GuardianMemory gives agents a way to save and a way to search, and no way to delete. An agent retires an outdated fact by saving the new version. Deleting is a decision a person makes in the app. And when something matters, saying “remember this” is still the surest way to have it kept.

Build it or plug it in?

You can build long-term memory yourself: an embedding model, a vector database, and code that decides what to save, what to merge and what to retire. Agent frameworks ship memory modules that do part of this for agents built on them.

If the agents are ones you use rather than build, such as Claude, ChatGPT or Cursor, the simplest route is a memory server they connect to over MCP. Every agent gets the same memory without anyone writing code, and your own agents can use the same memory over a REST API.

How to give an agent long-term memory with GuardianMemory

  1. Create a memory bank at app.guardianmemory.com.
  2. Connect the agent. Any MCP client takes one URL, opens a browser once for you to approve it, and gets the two tools: steps for each assistant.
  3. Tell it when to use its memory. A few lines in its instructions make it read the profile first and save as it goes: copy a ready-made instruction.
  4. For an agent you are building, call the REST API with an API key, or connect it over MCP like any other client.
https://app.guardianmemory.com/mcp

Questions people ask

Is a bigger context window the same as memory?

No. A context window is how much a model can read at once, and it is emptied when the conversation ends. Memory is what carries over into the next conversation. A bigger window only lets an agent read more of it at a time.

What is the difference between RAG and agent memory?

Retrieval-augmented generation (RAG) looks things up in documents the agent did not write. Agent memory is written by the agent, or by people, as work happens, and it changes: facts are added, replaced and retired. Both put what they find into the context window in the same way.

Where is AI agent memory stored?

Outside the model, in a database. GuardianMemory stores each memory as a sentence and a vector in PostgreSQL with pgvector, and searches it by meaning.

Can different AI agents share one memory?

Yes, as long as the memory lives outside all of them. Every assistant that connects to GuardianMemory over MCP, and every agent that calls its REST API, reads and writes the same memory bank. How to share memory between ChatGPT, Claude and Cursor.

How do you stop agent memory from going stale?

Retire a fact when a new one replaces it instead of keeping both, merge near-duplicates, give newer memories an edge in search, and let people read and fix everything. GuardianMemory does all four.

Give your assistants a memory that lasts

One memory bank that Claude, ChatGPT, Cursor and every other MCP assistant read and write.

Create your memory bank

Free while we learn. No card.