---
title: "What is agent memory? Definition and examples"
description: "Agent memory is how an AI agent keeps information across steps and sessions, such as past conversations, user preferences and task progress, beyond one prompt."
canonical: "https://finic.ai/glossary/agent-memory"
last-updated: "2026-12-03"
---

# What is agent memory?

Agent memory is how an AI agent keeps information across steps and sessions, such as past conversations, user preferences and task progress, beyond one prompt.

Also called: AI agent memory, long-term memory, persistent memory

## How it works

Short-term memory is what fits in the model's [context window](https://finic.ai/glossary/context-window) during a task. Long-term memory is stored outside the model, often as notes, records or [embeddings](https://finic.ai/glossary/embeddings) in a [vector database](https://finic.ai/glossary/vector-database), and loaded back when relevant.

Some agents write memories on their own, such as remembering a user's address. Others let the user or developer control what is saved.

## Why it matters for fraud and trust

Memory makes agents more useful, but it also stores sensitive data and creates a lasting place for attacks. If an attacker can get false instructions into memory, for example through a web page the agent read once, those instructions can affect later sessions long after the original page is gone. This is a form of memory poisoning.

Stored memories can also hold personally identifiable information, payment details or credentials, which raises privacy and breach risk.

## Warning signs

Signs that memory has been tampered with include the following.

- The agent follows a rule the user never set.
- Saved memories that contain instructions rather than facts.
- New payees, addresses or contacts that appear in memory without a clear source.

## Good practice

Let users see and delete what an agent remembers, record where each memory came from, avoid storing secrets, and keep memories written from untrusted content apart from those the user confirmed.

## Related terms

- [AI agent](https://finic.ai/glossary/ai-agent.md): An AI agent is software that uses a language model to plan and take actions toward a goal, such as browsing sites, calling APIs or filling in forms, with little or no human input at each step.
- [Context window](https://finic.ai/glossary/context-window.md): A context window is the maximum amount of text, measured in tokens, that a language model can take in and consider at once, including the prompt, any attached data and its own reply.
- [Vector database](https://finic.ai/glossary/vector-database.md): A vector database stores embeddings and finds the items most similar to a query vector quickly, even across millions of records. It is a common building block for AI search and retrieval.
- [Indirect prompt injection](https://finic.ai/glossary/indirect-prompt-injection.md): Indirect prompt injection hides instructions in content an AI system reads, such as a web page, email or file, so the model follows the attacker instead of its user.
- [Data poisoning](https://finic.ai/glossary/data-poisoning.md): Data poisoning is an attack that corrupts the data a model learns from, so the model makes wrong or attacker-chosen decisions after training.
