AI From Zero · Prompt Engineering

Adding Context and Background

Learn how examples can show an AI assistant the desired pattern, format, tone, classification, or structure of a response.

Estimated learning time: 15 minutes

What You'll Learn

By the end of this lesson, you will be able to:

- Explain what context means in an AI prompt.
- Identify background information that is relevant to a task.
- Understand how context can reduce ambiguity.
- Distinguish useful context from unnecessary information.
- Provide audience, situation, purpose, and relevant background information.
- Improve an AI prompt by adding the context that actually matters.

What Is Context?

Context is the background information that helps an AI assistant understand the situation surrounding a task.

Without enough context, an AI may have to make assumptions about what you mean, who the response is for, or what situation you are dealing with.

Adding relevant context can make a prompt more specific and useful.

A Simple Example

Consider this request:

Write an email about the delay.

The AI does not know what was delayed, who caused the delay, who will receive the email, or what tone should be used.

Now add context:

The customer order is delayed by two days because of a shipping problem. Write a professional email to the customer explaining the delay.

The second prompt gives the AI important information about the situation.

Why Context Matters

The same task can require very different responses depending on the circumstances.

For example, the request Explain artificial intelligence could produce a very different answer depending on whether the audience is:

  • A school student.
  • A business manager.
  • A software developer.
  • A complete beginner.

Providing the relevant audience as context helps the AI select an appropriate explanation.

Context Reduces Guessing

When important information is missing, the AI may need to make assumptions.

For example:

Write a report about our sales.

This leaves many questions unanswered.

Which sales period? Which products? Which customers? Which audience? What should the report focus on?

Adding context can reduce these uncertainties.

Useful Types of Context

Depending on the task, useful context can include:

  • The situation.
  • The audience.
  • The purpose.
  • The background.
  • Relevant facts.
  • Previous decisions.
  • Important constraints.
  • The desired outcome.

Situation

Explain what is happening when the situation matters.

For example:

The company is preparing to launch a new online course next month.

This gives the AI a starting point for a marketing or planning task.

Audience

Tell the AI who will receive or use the result when that affects the response.

For example:

The presentation is for small business owners who have limited technical knowledge.

This tells the AI that the material should not assume advanced technical knowledge.

Purpose

Explain why you need the result.

For example:

The summary will be used by senior management to decide whether the project should continue.

This purpose helps the AI focus on information relevant to that decision.

Background

Background information explains facts that the AI needs to know before performing the task.

For example:

The project is already two weeks behind schedule and the team has three remaining developers.

This information may affect a project-planning response.

Relevant Facts

Provide facts that materially affect the task.

For example:

The budget is limited to 50,000 dollars and the deadline is 30 days.

These facts provide useful boundaries for recommendations.

Previous Decisions

When a task is part of an ongoing project, previous decisions may be important context.

For example:

The team has already decided to use the existing database system.

This prevents the AI from unnecessarily recommending a completely different database.

Context Should Be Relevant

Not every fact about a situation belongs in the prompt.

Ask whether a piece of information can change the answer or help the AI understand the task.

If it does not matter, it may not need to be included.

Relevant vs Irrelevant Context

Suppose you want help creating a project plan.

Useful context might include:

  • Project deadline.
  • Team size.
  • Major deliverables.
  • Dependencies.
  • Budget limitations.

Information such as the color of the office walls is probably irrelevant unless it somehow affects the task.

Too Little Context

Too little context can make a prompt ambiguous.

For example:

Make this report better.

The AI does not know the intended audience, purpose, or type of improvement.

Too Much Context

Providing every available fact can also be unhelpful.

Large amounts of irrelevant information can make the important details harder to identify.

The goal is not maximum context. The goal is relevant context.

Context and the Audience

Audience is often one of the most useful pieces of context.

Compare:

Explain cloud computing.

with:

Explain cloud computing to a complete beginner who has never worked with technology.

The second request provides information that can influence the vocabulary, examples, and level of detail.

Context and the Desired Outcome

The purpose of the task can change what information is important.

For example:

I need a summary of this report for a management meeting. Focus on the three most important business risks and their potential impact.

The meeting purpose and desired focus provide useful context.

Context and Ongoing Conversations

In a continuing conversation, earlier messages may already provide context.

However, when a task depends on important information, it can still be useful to state the relevant details clearly.

This can reduce ambiguity and make the current task easier to understand.

Context and Documents

If you ask an AI to analyze a document, explain what the document is and what you want to learn from it.

For example:

This is a quarterly sales report. Identify the three regions with the largest decline in revenue and explain the possible business implications.

The document type and analytical goal provide useful context.

Context and Data

If you provide data, explain what the data represents when that information is not obvious.

For example:

The following table contains monthly website visitors for the past twelve months. Identify the months with unusual changes.

The context explains what the numbers represent and what analysis is wanted.

Context and Constraints

Some information can function as both context and a constraint.

For example:

The team has only two weeks to complete the project.

This tells the AI about the situation and establishes an important time limitation.

Context Should Support the Goal

A useful test is to ask:

Does this information help the AI accomplish the goal?

If the answer is yes, it may belong in the prompt.

If the answer is no, it may be unnecessary.

Context Can Explain Assumptions

Sometimes the AI needs to know what you are assuming.

For example:

Assume that the reader understands basic spreadsheet concepts but has no programming experience.

This can help the AI choose an appropriate level.

Context Can Define the Starting Point

When solving a problem, tell the AI what has already been done.

For example:

We have already completed the database design and need to plan the application testing phase.

This prevents the response from starting from an incorrect point.

Context Can Explain the Problem

When asking for troubleshooting help, explain what happened and what has already been tried.

For example:

The application worked correctly yesterday. After the latest configuration change, users receive an error when logging in. Restarting the application did not solve the problem.

This gives the AI information that can help narrow the possibilities.

Context Can Explain Success Criteria

Tell the AI what a successful result should accomplish.

For example:

The final recommendation should reduce processing time without increasing the monthly operating cost.

This provides useful context about the desired outcome.

Do Not Hide Important Information

If a fact is important to the task, include it explicitly.

Do not assume that the AI will know a private business rule, internal decision, or special circumstance unless you provide it.

Context Does Not Need to Be Long

Useful context can sometimes be only one sentence.

For example:

I am explaining this concept to a group of twelve year old students.

That single sentence can significantly change the appropriate response.

Context Before the Task

A simple structure is to provide the relevant background before giving the task.

For example:

Context: The customer has already contacted support twice about the same issue. Task: Write a concise response that acknowledges the previous contacts and explains the next step.

This clearly separates the situation from the requested action.

Context Does Not Replace Instructions

Context tells the AI about the situation.

Instructions tell the AI what to do.

For example:

Context: The customer order is delayed by two days.

Instruction: Write a professional email explaining the delay.

Both pieces of information have different purposes.

Context Does Not Replace the Goal

Background information alone does not necessarily tell the AI what result you want.

For example:

The company launched a new product last month.

This is context, not a complete task.

You still need to say what you want the AI to do with that information.

A Complete Context Example

Consider this prompt:

I am preparing a short presentation for small business owners who have limited technical knowledge. The presentation is about generative AI and will be delivered in a ten minute session. Explain the three most practical uses of generative AI for small businesses and provide one simple example for each.

The prompt contains useful context about:

  • The audience.
  • The purpose.
  • The topic.
  • The available time.

It also contains a clear instruction describing the desired result.

Improve a Prompt by Adding Context

Start with:

Write a study plan for AI.

Add context:

I am a complete beginner learning AI fundamentals. I can study for one hour each evening and want to prepare for an introductory assessment. Create a seven day study plan.

The second version gives the AI information that can influence the plan.

Ask What Information Is Missing

If you are unsure what context is needed, you can ask the AI to identify missing information.

For example:

Before creating the project plan, identify the information you need from me.

This can be useful for complex tasks where you do not know which details matter.

Review Context Before Sending

Before submitting a prompt, review the background information.

Ask:

  • Does the AI know who the task is for?
  • Does it understand the situation?
  • Does it know the purpose?
  • Does it have the important facts?
  • Have I included important constraints?
  • Have I removed irrelevant information?

Context Is Task Dependent

The right context depends on the task.

A writing task may need audience and tone.

A business analysis may need financial or organizational background.

A troubleshooting task may need symptoms, recent changes, and previous attempts.

A study task may need the learners level, available time, and target outcome.

What You Should Remember

  • Context is background information that helps the AI understand a task.
  • Useful context can include situation, audience, purpose, background, facts, assumptions, and previous decisions.
  • Relevant context can reduce ambiguity and unnecessary guessing.
  • Too little context can make a request unclear.
  • Too much irrelevant context can make important information harder to identify.
  • Context should support the goal of the task.
  • Context and instructions have different roles.
  • Context does not guarantee an accurate AI response.
  • When important information is missing, you can ask the AI what information it needs.

What Comes Next?

Now that you understand how to provide useful context and background, the next lesson will focus on giving clear instructions so the AI knows exactly what action to perform.

Key Takeaways

  • Context explains the situation surrounding a task.
  • Useful context can include audience, purpose, background, facts, assumptions, and previous decisions.
  • Relevant context reduces ambiguity.
  • Too much irrelevant information can be counterproductive.
  • Context and instructions serve different purposes.
  • The right amount of context depends on the task.

Try It Yourself

Improve a prompt by adding context.

Start with a vague request such as:

Write a presentation about AI.

Then add useful context about:

  • The audience.
  • The purpose.
  • The situation.
  • The expected length.
  • The desired outcome.

Rewrite the prompt so that the AI has enough information to understand the task without being overloaded with irrelevant details.

Compare the original response with the response produced by the improved prompt.

Test Your Knowledge

You've reached the end of this lesson.

Test what you've learned with the Adding Context and Background - Quiz.

Take the Quiz
← Giving AI a Clear Role and Goal
Giving Clear Instructions →
Back to Course