From the source
Perplexity's guide explains context compaction, the practice of summarizing older parts of a long conversation so an AI model receives the summary instead of the full text.- Compaction frees room once a long session approaches the context window's limit, and it also keeps replies faster and more accurate, since the model rereads the whole context for every response.
- A long context can make answers less accurate, an effect called context rot, so compaction can help even before the window is full.
- Tools trigger it at a threshold below the limit, measured by token count, by share of the window or by number of exchanges.
- Some material is kept word for word, such as the original request and the agent's standing instructions, because summarizing them might make the agent stop obeying them partway through a task.
- After compaction the AI may mistake the summary for a finished task, so tools add the state of to-do lists or a direct instruction to keep working.
