Agent Memory Eviction: What to Leave Out of the Next Prompt

Context eviction decides which information will not be included in the next model request. It is different from deleting a stored record. A fact can remain available for later retrieval while being irrelevant to the current task.
Design prompt selection around task value, authority, and a context budget. Recency is one signal, but a recent low-value exchange should not automatically displace an older decision that constrains the work.
Protect the information the task depends on
Identify the active goal, current constraints, relevant decisions, and evidence needed for the next action. Keep exact identifiers and conditions when paraphrasing them could change the result. Large logs and tangential history can remain outside the prompt with a route back to their source.
Do not confuse repetition with importance. The same obsolete fact appearing in several retrieved passages should not outrank one current authoritative correction merely by volume.
Compare simple selection policies
Start with a recency baseline, then compare a policy that includes task relevance and explicit priority. Measure whether the required evidence survives within the same token budget.
For illustration, a 6,000-token evidence allowance does not mean every request should fill it. If two short passages answer the question, additional context can add distraction and cost. The useful quantity is supported task completion, not maximum budget utilization.
Preserve a recovery path
When omitting a passage, retain its source reference where the agent can request it if needed. A summary can point to an exact decision without carrying the entire source. If the task later needs the precise wording, retrieve it rather than treating the summary as a perfect substitute.
The context-limit guide explains how this fits with compaction. A policy for prompt selection should not silently change storage retention or user-facing deletion promises.
Test the cases recency gets wrong
Include an old but active constraint, a recent irrelevant message, a correction, an exact amount, and an unresolved blocker. Check whether the next step respects the right facts after selection.
A broader hot, warm, and cold memory policy separates prompt eligibility from where detailed evidence is retained.
If examples compete with memories for space, use the few-shot context budget to compare their contribution to the next answer.
If you need selected context to persist across sessions, try Supermemory alongside the application's prompt-budget policy. Use the memory lifecycle guide to keep retrieval exclusion, forgetting, and deletion distinct.