Module 3: Show and Tell with AI
Learn how to use context and examples to guide AI responses
Learning Objectives
- Understand how context helps AI understand your needs
- Learn to provide examples to guide AI responses
- Practice creating prompts with helpful context
What is Context and Why Does AI Need It?
Context is the background information that helps someone understand a situation better. Think about this: if your friend suddenly says "It's blue!" without any other information, you'd be confused. Blue what? But if they first say "I got a new bike yesterday" and then say "It's blue!", you understand they're talking about the color of their new bike.
AI works the same way! When you provide context in your prompts, you're giving the AI important background information that helps it understand what you're really asking for.
Without context: "Tell me about Mercury."
AI's dilemma: Do you mean the planet Mercury? The element Mercury? The Roman god Mercury? The Mercury car brand? The Mercury space program?
With context: "I'm working on a science project about our solar system. Tell me about Mercury, including its size, distance from the sun, and any unique features."
The context in the second prompt makes it clear you're asking about the planet Mercury, not the element or anything else. This helps the AI give you exactly the information you need!
Types of Context You Can Provide
There are several types of context you can include in your prompts to help AI understand your needs better:
1. Purpose Context
Tell the AI why you need the information or what you plan to do with it.
"I'm creating a birthday card for my grandmother who loves gardening. Can you suggest a short, heartfelt poem about flowers and gardens?"
2. Knowledge Context
Share what you already know or what level of detail you need.
"I already know that photosynthesis helps plants make food using sunlight, but I don't understand the chemical process. Can you explain the chemical reactions in photosynthesis in simple terms?"
3. Preference Context
Explain your preferences or requirements for the response.
"I prefer explanations with real-world examples and analogies. Can you explain how electricity works in a way that relates to things I see every day?"
4. Situation Context
Describe the specific situation or scenario you're in.
"I'm going camping this weekend in a forest where it might rain. What are some important items I should pack?"
The more relevant context you provide, the better the AI can tailor its response to your specific needs!
The Power of "For Example" in Prompt Engineering
One of the most powerful ways to guide AI is to show it examples of what you want. This is like showing someone a picture of what you're looking for instead of just describing it with words.
When you include examples in your prompts, you're giving the AI a clear pattern to follow, which helps it understand the style, format, or type of response you're looking for.
Ways to Use Examples:
Format Examples: "I need a list of healthy snacks for school. Please format it like this:
- [Snack Name]: [Main ingredients] - [Why it's healthy]
For example:
- Apple Slices with Peanut Butter: Apples, natural peanut butter - Contains fiber and protein to keep you full longer."
Style Examples: "Write a short, funny poem about homework. I like poems that rhyme and have a surprise ending, like this:
'Roses are red,
Violets are blue,
Sugar is sweet,
And so are you...NOT!'"
Content Examples: "I'm learning about famous scientists. Can you tell me about three more scientists like these examples:
- Marie Curie: Discovered radium and polonium, won Nobel Prizes in Physics and Chemistry
- Albert Einstein: Developed the theory of relativity, changed our understanding of space and time"
Examples are especially helpful when you want the AI to follow a specific pattern or style that might be hard to explain in words alone.
Before/After: The Magic of Adding Context and Examples
Let's see how adding context and examples can transform your prompts and get you much better results:
Example 1: Homework Help
Before: "Help me with fractions."
After: "I'm a 7th-grade student struggling with adding fractions with different denominators. Can you explain the process step-by-step with an example like 2/3 + 1/4? Please use simple language and include a visual explanation if possible."
What improved: Added context about grade level and specific difficulty, requested a specific example, and specified the desired format (step-by-step) and style (simple language with visuals).
Example 2: Creative Writing
Before: "Write a story about a dragon."
After: "I'm creating a short storybook for my little brother who loves friendly dragons. Write a 300-word story about a young dragon who is afraid of fire but learns to overcome this fear. The story should be gentle, have a happy ending, and include a moral lesson about bravery. Please use simple vocabulary suitable for an 8-year-old reader."
What improved: Added purpose context (for little brother), specified length, provided character details and plot elements, and included style preferences (gentle, happy ending, moral lesson).
Example 3: Research Help
Before: "Tell me about climate change."
After: "I'm preparing a science presentation for my 7th-grade class about climate change. I need to explain what causes climate change and three main effects it has on our planet. Please format the information as bullet points with simple explanations, similar to this example:
• Cause: Burning fossil fuels - When we burn coal, oil, and gas for energy, they release gases that trap heat in our atmosphere, like putting a blanket around the Earth.
Please include one interesting fact with each point that would surprise my classmates."
What improved: Added purpose context (class presentation), specified content needs (causes and effects), requested specific format (bullet points), provided an example of the desired style, and asked for engaging elements (surprising facts).
Let's Test Your Knowledge!
Time for a quick quiz to see what you've learned about context and examples.
Question 1: What is context in prompt engineering?
Question 2: Which of these prompts uses an example effectively?
Question 3: Which type of context explains why you need the information?
Context Builder Exercise
Let's practice adding context and examples to prompts. Below is a basic prompt. Try to improve it by adding different types of context and an example.
Basic prompt: "Tell me about renewable energy."
Now, let's build a better prompt by adding:
- Purpose context: Why do you need this information?
- Knowledge context: What do you already know or not know?
- Preference context: How do you want the information presented?
- An example: What format or style do you want the AI to follow?
Practice with Promptie
A great improved prompt might look like this:
"I'm creating a poster for my science fair project about renewable energy (purpose context). I already know about solar and wind power, but I'd like to learn about three other types of renewable energy (knowledge context). Please explain each type in 2-3 sentences with one main advantage and disadvantage, and include a real-world example of where it's being used successfully (preference context). Format each type like this example: 'Hydroelectric Power: This energy comes from flowing water turning turbines to generate electricity. Advantage: It's reliable and can produce large amounts of energy. Disadvantage: It can disrupt river ecosystems and fish migration. Example: The Hoover Dam in the United States provides power to millions of homes in Nevada, Arizona, and California.'"
What We Learned
- Context is background information that helps AI understand your request better
- Different types of context include purpose, knowledge, preference, and situation context
- Examples show the AI exactly what pattern, format, or style you want
- Adding context and examples transforms basic prompts into powerful, specific requests
- The more relevant context you provide, the better the AI can tailor its response to your needs
Great job completing Module 3! In the next module, we'll learn about asking different types of questions to get even better responses from AI.