Agents
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 · Part of What is agent memory?
Short 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
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
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
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
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)
| 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
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.
import pixeltable as pxtfrom pixeltable.functions.openai import embeddings, chat_completionsTableModel = pxt.model_base()class Memories(TableModel, name='memories'):content: pxt.Stringcategory: pxt.String__indexes__ = [pxt.EmbeddingIndex(content,string_embed=embeddings.using(model='text-embedding-3-small'),),]@pxt.querydef 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.udfdef 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.Stringrelevant_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
Is dropping tokens from the prompt the same as forgetting?
Next step
Install the Pixeltable skill, or sign up for Cloud and run the same file on a hosted database.