Reference

Entity retention

Entity retention

Understand which entities expire by observation time, which follow a parent, and which remain only while connected to the graph.

#Retention policies

Entities use one of four policies:

PolicyEntity typesCollection rule
ObservedChannel, Document, Email, Folder, Message, Spreadsheet, Task, VideoDelete when observed_at (or created_at if never observed) is outside the retention window.
OwnedGmail attachment Document entitiesDelete with the parent Email.
ConnectedPersonDelete when the Person has no incoming or outgoing edges.
PersistentConfigured RSS feed Folder entitiesNever delete automatically.

#Bookmarking

Bookmarking an entity protects it from being removed when it expires or when its parent is deleted.

#Expiration

The server runs expiration daily and applies the following rules:

  1. Bookmarked entities are never deleted
  2. Detach bookmarked children before deleting an expired parent.
  3. Delete observed-policy entities whose effective retention timestamp is outside the window; parent-linked Messages also cascade when their parent expires.
  4. Delete owned entities left without a parent, including detached attachments after they are unbookmarked.
  5. Delete connected-policy Persons that have no edges.

The retention period is controlled using AGENTGRAPH_RETENTION_DAYS, which defaults to 90 days.