Requests fail, truncate useful evidence, become expensive, or produce worse answers as context grows.
Possible causes
Too much retrieved content
oversized prompts
poor chunk selection
repeated conversation history
token budget mismatch
Diagnosis
Measure prompt and completion tokens
inspect retrieved context
identify repeated content
compare answer quality at different context sizes
2 · Fix
Reduce unnecessary context and prioritize the evidence required for the task.
Verify
Compare quality, latency, and token usage against a representative workload.
3 · Prevent
Set context budgets, monitor token usage, and test retrieval/context regressions.
Context Window Problems
More context is not automatically better. Treat context as a constrained engineering budget.
Diagnose
Measure prompt size, completion size, retrieved chunks, repeated history, and the model's available budget. Then compare quality as context is reduced.
Fix → Verify → Prevent
Prefer relevant, ranked evidence over indiscriminate retrieval. Verify quality and cost together, then enforce context budgets in tests and observability.
Learning checkpoint
Mark this guide complete to include it in your local Engineering Journey.