Introduction
Two people ask "Write a speech". One is a class 9 student speaking for two minutes at a school event. The other is a shop owner opening a new branch. The AI cannot tell them apart unless the prompt says so. Context is your situation. Constraints are your limits. Together, they stop the AI from guessing — and guessing is where most bad answers come from.
Think of context as the background the AI needs, and constraints as the fences it must stay inside. Give both, briefly, and the answer lands close to your real need on the first try.
(Roman Urdu: Context aap ki surat-e-haal hai, constraints aap ki hadood hain. Dono do to AI andaza lagana band kar deta hai — aur andaza hi aksar ghalat jawab ki wajah banta hai.)
Key points
- Context answers: who, for whom, why, and what is already known. Who you are, who the answer is for, what it is for, and what facts are already fixed.
- Constraints answer: how long, what shape, what tone, what to avoid. Length, format, language, and banned things ("no difficult words", "no political examples", "no invented prices").
- Keep context short and relevant. Three lines of relevant background beat a life story. Only include facts that change the answer.
- Put context BEFORE the task when it is long. "Background: ... Task: ..." keeps the AI from losing the job inside your story.
- Constraints must be checkable. "Good quality" cannot be checked; "under 150 words, simple English, 3 examples" can. If you cannot check it, the AI cannot follow it reliably.
- Say what to AVOID, not just what to do. "Do not use technical words", "Do not invent statistics", "Do not mention other brands" prevent the most common unwanted habits.
- Audience is the strongest single context. "For a class 8 student" changes words, examples and depth all at once. If you give only one piece of context, make it the audience.
- Beginners get stuck on how much context is too much. The rule: if a fact changes the words, the examples, or the length, include it. If it only explains why you are asking, leave it out. "I am a student" changes the answer; "I was busy yesterday" does not.
- Constraints can also protect the reader. "No medical advice, only general information" or "No prices, because prices change" are constraints that keep an answer safe to share. Think of constraints as safety fences, not just style rules.
Examples
Example 1 — Same task, with and without context
Without context:
Write a speech on hard work.With context and constraints:
Background: I am a class 9 student speaking at our school morning assembly. Task: Write a 2-minute speech on hard work, in simple English. Use one example of a Pakistani student or player. Do not use difficult words. End with one motivating line for students.The second version cannot be confused with a business speech or a university lecture. Context aimed it, constraints fenced it.
Example 2 — Constraints that prevent invention
Explain how solar panels work, in simple English for a class 8 student. Keep it under 200 words. Do not invent statistics or prices — if a number is not certain, say so or leave it out.That last constraint matters: AI tools sometimes invent confident-sounding numbers. Telling it not to invent is a real, working guard — though for anything important, you still verify (see PE.11).
Example 3 — Context block for a long task
Background: I run a small mobile repair shop in Sahiwal. My customers are mostly students. I want a WhatsApp message to announce a 10% student discount this weekend.
Task: Write the message in Roman Urdu, friendly tone, under 50 words. Include the shop timing (10am–9pm) and one line: show your student card. Do not add emojis.Background first, task second, limits last. The AI has everything it needs and nothing it does not.
Example 4 — Before and after: a post for the wrong audience
Before:
Write a post about my tuition centre.After:
Background: I run a small tuition centre in Sahiwal for class 9 and 10 science students. Task: Write a Facebook post in Roman Urdu announcing evening classes, 5pm to 8pm, Monday to Friday. Friendly tone, under 60 words. Do not mention fees — parents ask on WhatsApp. End with: message us to book a free trial class.The first version could be an ad for anyone, anywhere. The second names the town, the classes, the timing, the language, the tone, and one deliberate omission (no fees). Every piece of context removed one wrong guess.
Example 5 — Before and after: a letter that respects a limit
Before:
Write a letter to the principal for leave.After:
Write a formal leave application to the principal of my school. I am a class 10 student. Reason: family wedding in Multan. Dates: 30 October to 1 November. Keep it under 100 words. Do not add any reason I did not give.The last constraint matters most: without it, the AI may invent a polite extra reason ("medical emergency") that is not true. "Do not add facts I did not give" is the constraint that keeps a formal letter honest.
Example 6 — Context that changes the examples, not just the words
Explain profit and loss to a class 8 student in Pakistan. Use only examples from a small shop: buying stock, shop rent, daily sales. Do not use stock market or company examples. Simple English, under 150 words.Audience plus a "use only" constraint changes the examples themselves. A generic answer might use share prices; this answer stays in the world the student actually sees — a shop counter. That is context doing its strongest work.
Real-world case — Where this is actually used
A tuition centre owner writes every announcement with the same three lines — background (who, where), task (what, for whom), constraints (length, language, what to leave out) — and reuses the pattern for admissions, results, and holidays. Doctors' clinics do the same for patient messages: audience, purpose, and a strict "no diagnosis, only general information" fence. The pattern is identical; only the facts change.
Quick recap
- Context = your situation (who, for whom, why, known facts).
- Constraints = your limits (length, shape, tone, what to avoid).
- Keep context short and relevant; put it before the task when long.
- Make constraints checkable: numbers, audiences, banned items.
- Audience is the strongest single piece of context.
Common mistakes
- No context at all — the AI writes for a stranger. Fix: add one line: who it is for and what it is for.
- A life story instead of context — ten irrelevant lines bury the task. Fix: keep only facts that change the answer.
- Uncheckable constraints — "make it really good" cannot be followed. Fix: numbers, formats, audiences, and explicit "do not" lines.
- Context that contradicts the task — "I am a beginner, explain in depth with advanced terms" pulls in two directions, and the answer satisfies neither. Fix: check your context and constraints agree before sending; if they fight, pick the one that matters more.
- Burying the constraint in the middle — a "do not" line hidden in a long paragraph gets ignored. Fix: put hard limits (length, banned items, "do not invent") in their own short sentence, ideally at the end where the AI sees them last.
Practice
- Take a prompt you used before that gave a wrong-for-you answer. Add one context line (audience + purpose) and two constraints, send it again, and compare.
- Write a prompt for a shop announcement with: background (2 lines), task (1 line), and 3 constraints including one "do not". Check whether the AI respected all three.
- Take a prompt that gave you an answer for the wrong audience. Add only one context line (audience + purpose) and send it again. How much of the answer changed from that one line?
- Write a shop announcement prompt with a deliberate omission: one fact the AI must NOT include. Check whether the answer respected the omission — and if not, try moving the "do not" line to the very end.
- Write two prompts for the same task with different audiences (a class 5 student and a shop owner). Compare the examples in the two answers — which parts changed, and which stayed the same?
Practice quiz
Practice questions — try them, then check your answers in the interactive quiz on the full lesson page.
1. What is the difference between context and constraints?
- They are the same thing
- Context is your situation (who, for whom, why); constraints are your limits (length, shape, tone, what to avoid)
- Context is for teachers, constraints for students
- Context goes last, constraints first
2. If you can give only one piece of context, what should it be?
- Your name
- The audience — it changes words, examples and depth all at once
- The date
- Your city
3. Which constraint can the AI actually follow reliably?
- 'Make it really good'
- 'Under 150 words, simple English, 3 examples, no difficult words'
- 'Make it the best answer ever'
- 'Write beautifully'
The interactive quiz with instant green/red answers lives on the full lesson page.