Loading patterns…
Sliding Window Management(SWM)
Dynamic window management with recency bias, relevance scoring, and intelligent token retention strategies
In 30 seconds
- What
- Dynamically shrinks or expands the context window during execution, prioritizing recent and relevant information while dropping less important older content.
- When to use
- Long-running tasks where full conversation history exceeds token limits and you need to preserve task-critical information while dropping tangential details.
- Watch out
- Relevance scoring is heuristic-based; you may accidentally drop context needed later, causing the agent to repeat work or lose important constraints.
Ask the AI expert about this pattern
Opens the assistant with your question prefilled. You review it before sending.
Sliding Window Management: Overview
Dynamic window management with recency bias, relevance scoring, and intelligent token retention strategies
- Adaptive sliding window sizing based on task complexity
- Recency-weighted context retention
- Relevance-based token prioritization
- Dynamic context window adjustment during execution
The Agent Architect
One pattern, one tradeoff, one production failure story. A short weekly briefing for people building agentic systems.
Weekly email, one-click unsubscribe. We only use your address to send the briefing.
References
The papers, specifications, and repositories this pattern is based on.
From the engineer behind this catalog
Get your agent architecture reviewed
This page documents one pattern. Your system runs dozens, and most failures live in how they fit together. Have the whole design reviewed against the 288 patterns in this catalog: architecture, reliability, evaluation and cost, every finding mapped to the pattern that fixes it.
€750 instead of €1,500, one week, written report and walkthrough call, until 30 September