An agent stores memory about user preferences and past task results in an external database. Over time, this memory grows large and may contain stale data. What should be configured to manage this?
Select an answer to reveal the explanation.
Short Explanation
Think of it like your browser cache: it's useful up to a point, but after a while it's full of outdated pages that slow things down. Agent memory is the same way, so you need expiration and pruning policies to keep stale data from misleading the agent.
Full Explanation
Long-term agent memory requires lifecycle management to remain accurate and useful. Without expiration and pruning, the memory store accumulates stale, irrelevant, or contradictory data that degrades agent performance.
Why the expiration and pruning approach is correct: Memory expiration policies define how long different types of data are retained, such as user preferences for 90 days or task-specific context for 7 days. Pruning rules remove entries that match staleness criteria on a schedule, such as removing memories from completed tasks older than 30 days. These policies keep the memory store relevant and manageable.
Why the never-delete approach is wrong: More historical data does not always improve accuracy. Stale preferences, outdated code patterns, and superseded decisions can cause the agent to apply obsolete context to current tasks, producing incorrect or misleading outputs.
Why the clear-all-at-session-end approach is wrong: Clearing all memory at the end of every session eliminates all the benefits of long-term memory. The purpose of external persistent storage is to retain useful information across sessions, so clearing it defeats that purpose entirely.
Why the runtime-model-decides approach is wrong: Allowing the model to decide at runtime which memories to retain without a predefined policy is unpredictable and ungovernable. The model may retain sensitive data it should discard or discard useful data it should retain. Policy-based management is deterministic and auditable.