Providing Context

Learn how background information and examples dramatically improve AI responses.

Why Context Changes Everything

Imagine asking a friend to "write me a bio." They'd immediately ask: A bio for what? LinkedIn? A conference? Your personal website? How long? What should it emphasize? AI faces the same problem — without context, it's forced to guess, and guesses are rarely what you want. Context is the background information that helps the AI understand your situation, goals, and constraints. It's the difference between a generic response that could apply to anyone and a tailored response that feels like it was written specifically for you.

Types of Context You Can Provide

There are several types of context, and each one improves the AI's output in a different way. You don't always need all of them, but knowing what's available gives you more tools to work with.

Background Context in Action

Background context is the most common type. It gives the AI the "why" behind your request, which dramatically shapes the output.

Share the 'why'

Whenever possible, explain why you need something. "Write me a cover letter" is good, but "Write me a cover letter for a senior product manager role at Stripe — I'm transitioning from engineering and want to emphasize my technical background as a strength" is much better.

Using Examples as Context

Providing examples is like giving the AI a template to follow. Instead of describing what you want in abstract terms, you show it directly. This technique is sometimes called "few-shot prompting" because you give the AI a few examples ("shots") before asking it to generate new content.

When to use examples

Use examples when you have a specific style or format in mind that's hard to describe in words. It's easier to show the AI what you want than to explain every detail.

Setting Constraints

Constraints are the guardrails that prevent the AI from going off in unexpected directions. They tell the AI what not to do, which is just as important as telling it what to do.

Structuring Context in Longer Prompts

When your prompt includes a lot of context, organization matters. Here's a proven structure that works well for complex requests.

Context window

AI models have a "context window" — a limit on how much text they can consider at once. For most conversations, this isn't a concern. But for very long documents or lengthy conversation histories, be aware that the AI might lose track of details shared much earlier. When in doubt, repeat important context.

  1. Background Information — Facts about the situation that help the AI understand what's going on. This includes who you are, what you're working on, what's happened so far, and what problem you're trying to solve. Example: "I'm a freelance designer pitching to a potential client who runs a bakery."
  2. Examples — Showing the AI an example of what you want is one of the most powerful context types. If you want an email that sounds like one you previously wrote, include that email. If you want a certain format, show a sample. Example: "Here's a sample of my writing style: [paste example]. Write the blog post in a similar voice."
  3. Constraints — Rules or limits that the AI should follow. These prevent the AI from going off track. Example: "Don't use technical jargon," "Keep each point to one sentence," "Don't mention competitors," or "Only use information from the data I've provided."
  4. Tone & Voice — How the response should feel emotionally. Should it be formal, casual, encouraging, serious, playful? Example: "Write this in the voice of a friendly mentor who's guiding a junior developer."

Share the 'why'

Whenever possible, explain why you need something. "Write me a cover letter" is good, but "Write me a cover letter for a senior product manager role at Stripe — I'm transitioning from engineering and want to emphasize my technical background as a strength" is much better.

When to use examples

Use examples when you have a specific style or format in mind that's hard to describe in words. It's easier to show the AI what you want than to explain every detail.

  1. Start With the Role or Situation — Open with who you are or who the AI should act as. "You are a senior copywriter at a tech startup" or "I'm a teacher creating materials for 5th graders."
  2. Provide Background Information — Share the relevant facts. What happened? What's the goal? What does the AI need to know?
  3. State the Task Clearly — Now ask for what you want. After the context is set, your task instruction will be much clearer to the AI.
  4. Add Constraints and Format — End with any rules, limits, or structural requirements. This is the "fine print" that shapes the final output.

Context window

AI models have a "context window" — a limit on how much text they can consider at once. For most conversations, this isn't a concern. But for very long documents or lengthy conversation histories, be aware that the AI might lose track of details shared much earlier. When in doubt, repeat important context.