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 and Infographic
Your browser cache is useful up to a point — after a while it's full of outdated pages that slow things down. Agent memory is the same way: without expiration and pruning policies, it fills with stale data that can mislead the agent just as much as it helps.
Full explanation below image
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 B is correct: Memory expiration policies define how long different types of data are retained (e.g., user preferences for 90 days, task-specific context for 7 days). Pruning rules remove entries that match staleness criteria on a schedule — for example, removing memories from completed tasks older than 30 days. These policies keep the memory store relevant and manageable.
Why A 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 C 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 — clearing it defeats that purpose entirely.
Why D 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.