The context window is the AI's working memory. It is the single most important constraint to understand once you start working on real projects — long documents, long conversations, large amounts of data.
You may have noticed that AI sometimes "forgets" what you said earlier, or refuses to read a giant document. That is the context window at work. This tutorial shows what it is, how big it gets in modern models, and the practical habits that let you make the most of it.
Every AI model has a fixed limit on how many tokens it can pay attention to at once. That limit — measured in tokens — is the context window. Everything you send (the system prompt, the conversation history, your latest message, plus any attached documents) shares that same window. The reply the AI generates also counts towards it.
When the conversation gets too long, the oldest messages start falling out of the window. The AI does not "remember" them anymore. This is why long chats can feel forgetful.
The exact numbers move every few months. The principle does not.
If your document is 50 pages but only chapter 3 matters, paste only chapter 3. Don't dump everything and hope the AI sorts it out.
Ask the AI itself:
Summarise everything important from our chat so far into a single message I can reuse as context.
Then start a fresh chat with that summary at the top.
Attention is strongest at the edges. Repeat your most important constraint near the bottom of a long prompt.
If you ask for a 2,000-word essay, you need around 2,600 tokens of free space. Leave it.
Many tools turn attached PDFs into tokens behind the scenes. A 100-page PDF can eat tens of thousands of tokens.
Filling the window blindly
Here's a 200-page PDF — please find the
section about pricing strategy and rewrite
it in our company tone.
The AI may run out of space, miss the relevant section, or produce a truncated answer.
Working within the window
Below is the pricing strategy section
(pages 47–52) from our internal handbook.
Rewrite it in our company tone:
- friendly, plain English
- short paragraphs
- bullet lists where helpful
- no jargon
Section:
"""
… paste only pages 47–52 here …
"""
Smaller, focused context. The AI now has plenty of room to write a good rewrite.
Look up the context window of the AI tool you use most. Estimate how many words that is (tokens × 0.75).
Take a long chat you have had with AI. Ask it:
Summarise everything important from this conversation into a single message I can paste into a new chat.
Use the summary to start fresh.
Take a 10-page document. First paste the whole thing and ask a specific question. Then paste only the single relevant page and ask the same question. Compare quality.
Sign in to join the discussion and post comments.
Sign inPrompt Engineering for Business & Productivity
Use AI to work smarter — automate tasks, make better decisions, and communicate professionally. 12 practical business prompt tutorials for professionals.
Prompt Engineering for Image Generation
Turn words into stunning visuals. Master AI image generation tools like Midjourney, DALL·E 3, and Stable Diffusion with 18 focused tutorials — from first prompt to full brand identity.
Prompt Engineering Projects & Real-World Applications
Twelve hands-on projects that turn prompt engineering theory into a portfolio. Build chatbots, content generators, RAG systems, and more.
Advanced Prompt Engineering Techniques
Master the powerful techniques AI experts use every day. Chain-of-thought, RAG, agents, function calling, prompt evaluation, and much more — 20 deep-dive tutorials.
Prompt Engineering for Education & Learning
Use AI as your personal tutor. Learn how to study faster, create lesson plans, generate practice questions, master languages, and prepare for competitive exams with smart prompts.
Prompt Engineering for Specific AI Tools
Tool-by-tool mastery — deep dives into ChatGPT, Claude, Gemini, GitHub Copilot, Midjourney, Stable Diffusion, and more. Learn the exact prompting techniques each platform rewards.