keepcalculator

06 Numbers and Powers

AI Agent Memory: What to Remember and Forget

Card No. 06·32207 · Updated · Standard formula, shown below

Remaining capacity 990 items
Forgetting rate
33.33 items/day
Result
Retention period (days)
30 days
You entered
Memory capacity (items)
1000 items
You entered
You enter
Retention period (days), Memory capacity (items)
You get
Remaining capacity, Forgetting rate
Rounding
0 dp · 2 dp

An AI agent should remember information that is relevant to its ongoing tasks and user relationships, such as preferences, goals, and important context, while forgetting sensitive data, outdated facts, and irrelevant details to maintain privacy and efficiency. This balance is achieved through a combination of short-term and long-term memory systems, each with its own retention policies.

Formula

The calculator above estimates how an AI agent’s memory capacity changes over time, assuming a linear forgetting rate. The formula for remaining capacity is:

Remaining Capacity = M × (1 − (T / 30) × 0.01)

Where:

  • M = total memory capacity (number of items)
  • T = retention period (days)

The forgetting rate is simply M / T, giving the number of items forgotten per day to stay within capacity.

Worked Example

Using the default values (M = 1000 items, T = 30 days):

  1. Calculate the fraction forgotten per day: 0.01 × (30 / 30) = 0.01
  2. Remaining capacity = 1000 × (1 − 0.01) = 990 items
  3. Forgetting rate = 1000 / 30 = 33.33 items per day

The calculator shows 990 items remaining and a forgetting rate of 33.33 items/day. This simple model illustrates that a longer retention period with a fixed capacity forces a higher forgetting rate.

Why Memory Matters for AI Agents

AI agents—whether chatbots, virtual assistants, or autonomous systems—rely on memory to provide coherent, personalized, and context-aware responses. Without memory, every interaction starts from scratch, leading to repetitive questions and generic answers. Memory allows an agent to remember a user’s name, past preferences, ongoing projects, and even emotional tone, making interactions feel more natural and efficient.

However, memory is not just about storing everything. It involves deciding what is worth keeping, how long to keep it, and when to discard it. This is where the concept of “forgetting” becomes as important as remembering.

Types of Memory in AI Agents

AI agents typically use two main types of memory:

  • Short-term (working) memory: Holds information for the current conversation or task, such as the last few messages or the steps taken so far. This is often implemented as a context window in large language models.
  • Long-term memory: Stores persistent facts about the user, past interactions, and learned knowledge that can be retrieved across sessions. This is often stored in vector databases or knowledge graphs.

Some systems also have episodic memory (specific past events) and semantic memory (general facts). The balance between these types determines how an agent behaves.

What to Remember

The following information is generally valuable for an AI agent to remember:

  • User preferences: Language, tone, communication style, and content preferences (e.g., news topics, dietary restrictions).
  • Ongoing goals and tasks: Projects the user is working on, deadlines, and progress updates.
  • Important personal context: Names of family members, pets, or key locations (if voluntarily shared).
  • Consent and privacy settings: What the user has allowed the agent to store or access.
  • Frequently used information: Shipping addresses, calendar preferences, or recurring appointments.

Remembering these details reduces friction and improves user satisfaction. For example, a travel assistant that remembers a user’s preference for window seats can automatically request them on future bookings.

What to Forget

Equally important is knowing what to forget or never store in the first place:

  • Sensitive personal data: Passwords, credit card numbers, health records, or any information that could cause harm if leaked.
  • Outdated or irrelevant information: Old addresses, expired preferences, or completed tasks that no longer matter.
  • Information without consent: Anything the user did not explicitly agree to share.
  • Transient details: The exact wording of a one-off request or a temporary location.
  • Biased or erroneous data: Incorrect facts that could lead to wrong decisions if retained.

Forgetting is not just a privacy feature; it also prevents the agent from becoming cluttered with noise that degrades performance. For instance, remembering a user’s temporary interest in a diet that they abandoned could lead to irrelevant suggestions later.

How Agents Decide: Retention Policies

AI agents use several strategies to decide what to remember and forget:

  • Recency and frequency: Information that is recent or frequently accessed is kept; rarely used data is gradually forgotten.
  • User feedback: Explicit cues like “remember this” or “forget that” are honored.
  • Automatic expiry: Temporary data (e.g., a location for a weather query) is deleted after a short time.
  • Privacy-by-design: Sensitive categories are never stored, or are stored with strict access controls.
  • Consent management: Users can review and delete stored data through settings.

These policies are often implemented as rules or machine learning classifiers that tag data with retention periods.

Common Challenges and Misconceptions

One common misconception is that an AI agent with perfect memory is always better. In reality, perfect memory can lead to privacy violations, stale information, and increased computational costs. For example, a chatbot that remembers every typo or offhand comment may later reference it inappropriately, causing user discomfort.

Another challenge is the “forgetting paradox”: if an agent forgets too aggressively, it loses useful context; if it forgets too little, it becomes cluttered. Balancing this requires careful design and often user control.

Technical limitations also exist. Current large language models have a fixed context window, so long conversations must be summarized or truncated. This is a form of forgetting that can lose important details if not done well.

Frequently Asked Questions

Can I make an AI agent forget something specific?

Yes, many agents allow users to delete specific memories through settings or by saying “forget that.” However, the implementation varies; some agents only remove the data from active use, while others delete it from storage. Check the agent’s privacy settings to see what options are available.

Is it safe for an AI agent to remember my credit card number?

It is generally not safe, and most reputable agents avoid storing full payment details. If an agent needs to process a payment, it typically uses a secure third-party service. Never share sensitive information like passwords or credit card numbers with an AI agent unless you trust the platform and it has clear security measures.

How long does an AI agent remember things?

It depends on the agent’s design. Some remember indefinitely until you delete the data, while others use automatic expiry (e.g., 30 days). The retention period is often configurable in settings. For example, a virtual assistant might keep your shopping list for a week but forget your location after a day.

Does an AI agent forget automatically?

Some do, through mechanisms like decay or capacity limits. For instance, if the memory is full, the oldest or least relevant items are discarded. However, not all agents have automatic forgetting; some require manual deletion. Always review the privacy policy to understand the retention behavior.

What happens if an AI agent remembers something wrong?

Incorrect memories can lead to errors, such as suggesting a food you dislike because it misremembered your preference. Most agents allow you to correct or delete wrong information. Regularly reviewing your agent’s stored memories can help prevent such issues.

Can an AI agent use my memories to improve its responses?

Yes, that is the primary purpose. By remembering your preferences and history, the agent can tailor responses, offer relevant suggestions, and avoid asking for the same information repeatedly. This is why memory is a key feature in modern AI assistants.

Related

Formula used
in t | Retention period (days) | days | 30 | 1 | 3650
in m | Memory capacity (items) | items | 1000 | 1 | 100000
out r | Remaining capacity | items | m * (1 - 0.01 * (t / 30)) | 0
out f | Forgetting rate | items/day | m / t | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →