---
title: "How do agent memory systems decide what to forget?"
description: "Forget is a policy: decay re-ranks, expiration hides, delete removes, invalidation closes a time window. Last reviewed October 2026; vendor docs linked."
url: "https://www.pixeltable.com/learn/how-do-agent-memory-systems-decide-what-to-forget"
updated: "2026-10-28"
vertical: "Agents"
doc: "https://docs.pixeltable.com/howto/cookbooks/agents/pattern-agent-memory"
---

# How do agent memory systems decide what to forget?

Agent memory systems forget by policy, not by a hidden timer. Decay re-ranks idle facts without deleting them. Expiration hides a row after a date. Delete removes it. Invalidation closes a time window on a fact while keeping history. Pick the policy that matches whether the agent must stay auditable or merely stay relevant.

Updated: 2026-10-28
Part of [What is agent memory?](https://www.pixeltable.com/learn/what-is-agent-memory).

## On this page

- [Short answer](https://www.pixeltable.com/learn/how-do-agent-memory-systems-decide-what-to-forget#direct-answer)
- [Four forget policies](https://www.pixeltable.com/learn/how-do-agent-memory-systems-decide-what-to-forget#policies)
- [What is not a forget policy](https://www.pixeltable.com/learn/how-do-agent-memory-systems-decide-what-to-forget#not-a-timer)
- [How to choose](https://www.pixeltable.com/learn/how-do-agent-memory-systems-decide-what-to-forget#how-to-choose)
- [Last reviewed](https://www.pixeltable.com/learn/how-do-agent-memory-systems-decide-what-to-forget#review)
- [Comparison](https://www.pixeltable.com/learn/how-do-agent-memory-systems-decide-what-to-forget#comparison)
- [Where Pixeltable fits](https://www.pixeltable.com/learn/how-do-agent-memory-systems-decide-what-to-forget#where-pixeltable-fits)
- [Questions](https://www.pixeltable.com/learn/how-do-agent-memory-systems-decide-what-to-forget#questions)

## Short answer {#direct-answer}

They do not all forget the same way. Rank decay boosts recently used memories and dampens idle ones without removing rows. Expiration hides a memory after a date you set. Delete is an explicit remove. Invalidation marks a fact as no longer true while keeping the history that it once was. A context window that drops old tokens is not a forget policy; it is a prompt budget.

## Four forget policies {#policies}

Name the policy before you pick a product. The same word "forget" covers unlike operations.

- Decay: a search-time score. Mem0 Memory Decay is opt-in v3 search ranking: recently accessed memories are boosted (up to about 1.5x) and idle ones are dampened (floor about 0.3x). Decay never deletes or filters a candidate out. Docs: https://docs.mem0.ai/platform/features/memory-decay
- Expiration: hide after a date. Mem0 Memory Expiration hides a memory after a date you set; the row stays stored. Docs: https://docs.mem0.ai/platform/features/memory-expiration
- Delete: remove the row. Letta developers can delete archival passages via the SDK; agents cannot easily modify or delete archival memory. Docs: https://docs.letta.com/v1-sdk/memory/archival-memory/
- Invalidate: close a time window. Zep facts are edges with valid_at and invalid_at, so a later preference can supersede an earlier one without erasing history. Deleting an episode removes a derived fact only when no remaining episode supports it. Docs: https://help.getzep.com/facts

## What is not a forget policy {#not-a-timer}

Dropping tokens from the prompt because the window filled is not memory policy. It is a runtime limit. A JSON file the app rewrites by hand is not a product. Zep does not expire context on a default time schedule; retention policies and explicit deletes do. Docs: https://help.getzep.com/context-retention.md

## How to choose {#how-to-choose}

Match the policy to whether history must remain auditable.

- Need recency without loss: decay.
- Need a hide-after date: expiration.
- Need the row gone: delete.
- Need "this was true until Tuesday": invalidation with provenance.

## Last reviewed {#review}

Facts on this page were checked against vendor documentation on 2026-10-28. Product surfaces move; treat version names and APIs as directional and follow the official links in Related.

## Forget policies in agent memory (last reviewed: Oct 2026) {#comparison}

| Policy | What happens | Deletes the row? | Example |
| --- | --- | --- | --- |
| Decay | Re-ranks search hits by recency of access | No | Mem0 Memory Decay (opt-in v3 search) |
| Expiration | Hides a memory after a date you set | No; the row stays stored | Mem0 Memory Expiration |
| Delete | Removes the memory or passage | Yes | Letta developer delete of archival passages; Mem0 delete |
| Invalidate | Closes valid_at / invalid_at on a fact; history remains | No, unless no supporting episode remains | Zep temporal facts |
| Prompt eviction | Old tokens leave the context window | Not a store operation | Any model with a finite window; not a memory product |

## Where Pixeltable fits {#where-pixeltable-fits}

Use Pixeltable when forget should be an ordinary table operation you own: insert memories, retrieve with EmbeddingIndex and a similarity threshold, delete or filter rows with where(), and keep transcripts beside them. Pixeltable is not Mem0, Letta, or Zep. It does not ship Memory Decay, sleep-time agents, or a temporal fact graph. Keep those products when that forget policy is the memory layer; store media or tool results in tables if you need them. Product comparison: Mem0 vs Letta vs Zep. Docs: Build an agent with memory.

```python
import pixeltable as pxt
from pixeltable.functions.openai import embeddings, chat_completions

TableModel = pxt.model_base()

class Memories(TableModel, name='memories'):
    content: pxt.String
    category: pxt.String
    __indexes__ = [
        pxt.EmbeddingIndex(
            content,
            string_embed=embeddings.using(model='text-embedding-3-small'),
        ),
    ]

@pxt.query
def recall_memories(context: str, top_k: int = 3):
    sim = Memories.content.similarity(string=context)
    return (
        Memories.where(sim > 0.5)
        .order_by(sim, asc=False)
        .limit(top_k)
        .select(Memories.content, Memories.category)
    )

@pxt.udf
def build_prompt(memories: list[dict], user_message: str) -> str:
    memory_lines = '\n'.join(row['content'] for row in memories)
    return f'Relevant memories:\n{memory_lines}\n\nUser: {user_message}'

class Conversations(TableModel, name='conversations'):
    user_message: pxt.String
    relevant_memories = recall_memories(user_message, top_k=3)
    prompt = build_prompt(relevant_memories, user_message)
    response = chat_completions(
        messages=[{'role': 'user', 'content': prompt}],
        model='gpt-4o-mini',
    )
    assistant_reply = response.choices[0].message.content
```

## Questions {#questions}

### Is dropping tokens from the prompt the same as forgetting? {#faq-1}

No. Prompt eviction is a window budget. A forget policy is an operation on stored state: re-rank, hide, delete, or invalidate.

## Related

- [Mem0 vs Letta vs Zep](https://www.pixeltable.com/learn/mem0-vs-letta-vs-zep)
- [What is agent memory?](https://www.pixeltable.com/learn/what-is-agent-memory)
- [What is a stateful agent?](https://www.pixeltable.com/learn/what-is-a-stateful-agent)
- [Research agent memory recipe](https://www.pixeltable.com/recipes/research-agent-memory)
- [Build an agent with memory](https://docs.pixeltable.com/howto/cookbooks/agents/pattern-agent-memory)
- [Mem0 Memory Decay](https://docs.mem0.ai/platform/features/memory-decay)
- [Letta stateful agents](https://docs.letta.com/guides/agents/memory)
- [Zep facts](https://help.getzep.com/facts)
