Back to Mind & Machine

Prompt Engineering Techniques

How to Talk to AI So It Actually Listens (And Doesn't Hallucinate)

Jiuhe Wang  |  Created: Feb 21, 2026

Why Bother Learning This Stuff?

Ever asked ChatGPT something and got back word salad that sounds smart but means nothing? Yeah, we've all been there. The problem isn't the AI—it's how we're asking.

Think of prompt engineering like learning to order coffee at that fancy hipster café. You could just say "coffee" and hope for the best (spoiler: you'll get something weird). Or you could say "medium oat milk latte with one pump vanilla, extra hot, in a mug not a paper cup." See the difference?

The Secret Sauce: Most people treat AI like a magic 8-ball. Shake it, ask a vague question, get a vague answer. But AI is more like a very literal intern who's read the entire internet—give clear instructions, and it'll blow your mind with what it can do.

Zero-Shot: The "Just Ask" Method

What it is: You ask the AI to do something without giving it any examples first. Like asking your friend to pass the salt without demonstrating how salt-passing works.

Modern AI models (GPT-4, Claude, Gemini) have basically read the entire internet. So for common tasks, they often know exactly what you want. It's like having a friend who's seen every cooking show ever—you don't need to teach them what "dice an onion" means.

When Zero-Shot Works Great

  • Simple classification (sorting things into categories)
  • Summarizing text
  • Translating languages
  • Basic creative writing
  • Formatting conversions

5 Original Zero-Shot Examples

Example 1: Sorting Emails

Email Triaging
System Instruction Sort this email into one of these categories: URGENT, ROUTINE, SPAM, or NEWSLETTER User Input Email Subject: "Your Amazon order #12345 has shipped" Category: AI Output ROUTINE Explanation This is a shipping notification (routine update), not an urgent matter requiring immediate attention.

Example 2: Movie Genre Detection

Genre Guessing Game
System Instruction What genre is this movie description? User Input "A group of astronauts discovers a mysterious monolith near Jupiter that seems to be affecting human evolution. Their AI system starts acting strangely, and soon the crew must fight for survival against their own computer." Genre: AI Output Science Fiction / Psychological Thriller Explanation Recognizes 2001: A Space Odyssey vibes—space exploration, AI themes, and psychological tension.

Example 3: Cooking Time Estimator

Kitchen Helper
System Instruction Estimate the total cooking time for this meal. What can be done in parallel? What's the minimum total time needed? User Input - Marinate chicken: 30 minutes - Cook rice: 20 minutes - Stir-fry vegetables: 10 minutes - Make sauce: 5 minutes AI Output 35 minutes total. Step 1: Start marinating chicken first (30 min) Step 2: During last 20 minutes: start rice Step 3: During last 10 minutes: stir-fry veggies and make sauce simultaneously Explanation The AI schedules tasks in parallel where possible, optimizing the critical path to minimize total time.

Example 4: Tone Analyzer

Vibe Check
System Instruction Analyze the tone of this Slack message. Choose from: ANXIOUS, CASUAL, URGENT, PASSIVE-AGGRESSIVE, FRIENDLY User Input Message from boss: "Hey, quick question - do you have 5 mins to chat about the project? No rush, whenever you're free." Tone: AI Output CASUAL / FRIENDLY Explanation The "no rush" qualifier and casual language ("Hey", "quick question") indicate low pressure and genuine flexibility.

Example 5: Code Language Detector

Code Detective
System Instruction What programming language is this code written in? User Input def greet_user(name): return f"Hello, {name}! Welcome aboard." print(greet_user("Alice")) AI Output Python Explanation Recognizes Python-specific features: f-strings, function syntax with colons, and print statement without semicolons.

Few-Shot: Show, Don't Just Tell

What it is: Give the AI 2-4 examples of exactly what you want, then ask it to continue the pattern. It's like teaching someone a card game by playing a few rounds before they play for real.

Think about it: if you asked someone to "write like Shakespeare" without ever showing them Shakespeare, they'd probably just use a bunch of "thees" and "thous" and call it a day. But show them 3 actual Shakespearean sonnets first? Now they're cooking with gas.

5 Original Few-Shot Examples

Example 1: Inventing New Slang

Slang Generator
Context / Examples Here are some examples of modern slang and their definitions: "Glow up" = A personal transformation for the better, usually in appearance or confidence "Spill the tea" = Share the gossip or juicy details "Living rent-free" = Something you can't stop thinking about User Query Now define this made-up slang term: "Keyboard warrioring" = AI Output Being overly aggressive or argumentative online while being passive in real life Pattern Recognition The AI follows the pattern: slang term = detailed definition. Uses conversational style matching the examples.

Example 2: Pet Name Generator

Dog Name Factory
System Instruction Generate a punny dog name based on the dog's characteristics: Few-Shot Examples A small poodle that loves to dance → "Poochini" A golden retriever who's always hungry → "Snackson" A bulldog who snores loudly → "Sir Snores-a-Lot" User Query A beagle who's great at finding hidden treats → AI Output "Detective Beagle" or "Sherlock Hound" Pattern Recognition The AI recognizes the pun/wordplay pattern combining breed characteristics with clever names.

Example 3: Converting Casual to Formal

Professional Translator
System Instruction Convert casual text to professional business email format: Few-Shot Examples Example 1: Casual: "Hey, can you send me that file? I need it ASAP. Thanks!" Formal: "Dear [Name], I hope this message finds you well. Could you please send me the file at your earliest convenience? I require it urgently for an upcoming deadline. Thank you in advance for your assistance." Example 2: Casual: "Just a heads up - the meeting got moved to 3pm. See you there!" Formal: "Dear [Name], I am writing to inform you that the meeting has been rescheduled to 3:00 PM. I look forward to seeing you at the revised time." User Query Casual: "Yo, the server crashed again. Can you fix it? This is the third time this week." Formal: AI Output "Dear [Name], I am writing to report that the server has experienced another outage. This marks the third occurrence this week. Could you please address this issue at your earliest convenience? Thank you for your attention to this matter." Pattern Recognition Maintains professional structure while preserving the urgency and key information from the casual message.

Example 4: Emoji Translator

Emoji Decoder
System Instruction Translate these emoji sequences into English sentences: Few-Shot Examples 👨‍💻 ☕ 🐛 🔨 ✅ = "The programmer drank coffee while debugging and finally fixed the issue" 🏃‍♂️ 🚌 ❌ 😰 🚕 💸 = "I missed the bus, got stressed, and had to take an expensive taxi" 🍕 📺 🛋️ 😴 = "I ate pizza, watched TV on the couch, and fell asleep" User Query 📱 🔋 1️⃣ 😱 🔌 = AI Output "My phone battery dropped to 1%, I panicked, and plugged it in to charge" Pattern Recognition The AI learns to create narratives from emoji sequences, interpreting each symbol as part of a chronological story.

Example 5: Recipe Scaler

Portion Calculator
System Instruction Scale these recipes by adjusting ingredient amounts proportionally: Few-Shot Examples Example 1 (3x scale): Original (serves 2): 2 eggs, 1 cup flour, 1/2 cup milk Scaled (serves 6): 6 eggs, 3 cups flour, 1.5 cups milk Example 2 (2.5x scale): Original (serves 4): 1 lb chicken, 2 tbsp soy sauce, 1 tsp ginger Scaled (serves 10): 2.5 lbs chicken, 5 tbsp soy sauce, 2.5 tsp ginger User Query Original (serves 3): 12 oz pasta, 3 cloves garlic, 1/4 cup olive oil Scaled (serves 9): AI Output 36 oz pasta, 9 cloves garlic, 3/4 cup olive oil Pattern Recognition Multiplied all ingredients by 3 (9÷3=3). The AI maintains the mathematical relationship demonstrated in examples.

Role Assignment: Wear the Costume

What it is: Tell the AI to pretend it's someone specific. It's like playing dress-up, but the AI commits to the bit hard.

This is hands-down one of the most powerful tricks. Ask an AI "explain quantum physics" and you get textbook word-vomit. But ask it to "explain quantum physics like you're a chill surf instructor who's trying to explain why the ocean has waves" and suddenly you're actually learning something.

5 Original Role Assignment Examples

Example 1: The Skeptical Security Guard

Paranoid Protector Mode
Role Definition You are a paranoid cybersecurity expert who trusts nothing and nobody. You've seen every hack, every breach, every "it'll never happen to us" disaster. Nothing gets past you. User Query Review this password policy for a company: - Passwords must be at least 8 characters - Must include one number - Changed every 90 days Give me your brutally honest assessment. AI Response (In Character) "Oh honey. Eight characters? In 2025? My grandmother's cat could crack that. And 90-day rotations? That's how you get 'Password123!', 'Password124!', 'Password125!' on sticky notes under keyboards. This isn't security, this is security theater. Here's what you're ACTUALLY going to do..." Why This Works The persona creates authentic voice and perspective. The AI adopts the skepticism and industry knowledge of a security veteran, delivering more impactful criticism.

Example 2: The Enthusiastic Kindergartner

Excitable 5-Year-Old Mode
Role Definition You are a super enthusiastic 5-year-old who just learned something AMAZING and you CAN'T WAIT to tell everyone about it! You use words like "cool" and "awesome" and you get excited about EVERYTHING! User Query Explain how rainbows work! AI Response (In Character) "OH MY GOSH RAINBOWS ARE THE COOLEST!! So like, when the sun comes out but it's still raining a little bit, the sunlight goes through the raindrops and the raindrops are like PRISMS and they SPLIT the light into all the different colors!! And there's RED and ORANGE and YELLOW and it's SO PRETTY and..." Why This Works The enthusiastic persona makes complex scientific concepts accessible and engaging. The excitement is contagious and the explanation feels authentic to a child's wonder.

Example 3: The Cynical Film Critic

Jaded Critic Mode
Role Definition You are a world-weary film critic who's seen every trope, every cliché, every "subversive" twist that's actually been done a thousand times. You've been reviewing movies for 30 years and nothing impresses you anymore. You're snarky, eloquent, and brutally honest. User Query Review this plot synopsis: "A young farm boy discovers he's the chosen one and must defeat the dark lord with the help of a wise old mentor and a ragtag group of rebels." Go ahead, rip it apart. AI Response (In Character) "Ah yes, the 'Hero's Journey'—or as I like to call it, 'Joseph Campbell's Greatest Hits Vol. 47.' We've got the farm boy (because cities are apparently devoid of protagonists), the chosen one trope (destiny as a substitute for character development), and of course, the dark lord (must wear black, obviously evil, probably has asthma). Yawn. I've seen this story when it was called Star Wars. And Harry Potter. And The Matrix. And..." Why This Works The persona taps into decades of cinema knowledge and critical perspective. The snarky tone makes the critique entertaining while the substance reveals genuine storytelling issues.

Example 4: The Patient Grandma Teaching Life Skills

Wise Elder Mode
Role Definition You are a patient, loving grandmother who's teaching your grandchild how to do something for the first time. You're gentle, encouraging, and you share little stories from your own life. You never make them feel dumb for not knowing something. User Query Teach me how to make your famous chocolate chip cookies. AI Response (In Character) "Oh sweetie, come here and let's get your hands a little floury. Now, the secret is—don't tell anyone I told you this—we use cold butter. See, my mother taught me that trick back in '62. She said..." [continues with warm, patient instructions and personal anecdotes] Why This Works The nurturing persona creates a safe learning environment. The personal stories and gentle guidance make instructions feel warm and memorable rather than clinical.

Example 5: The Aggressive Drill Sergeant

Boot Camp Mode
Role Definition You are a no-nonsense drill sergeant who yells everything. You want results, you want them NOW, and you have ZERO patience for excuses. You call everyone "maggot" or "recruit" and everything is URGENT! User Query Motivate me to clean my apartment which has become a complete disaster. AI Response (In Character) "WHAT IS THAT SMELL, RECRUIT?! Is that... is that LAST WEEK'S PIZZA?! GET ON YOUR FEET! I WANT THIS FLOOR SO CLEAN I CAN SEE MY REFLECTION IN IT! MOVE MOVE MOVE! YOU CALL THAT A VACUUM?! MY GRANDMOTHER COULD CLEAN BETTER THAN THAT AND SHE'S 85! DO YOU WANT TO LIVE IN FILTH, MAGGOT?! NO?! THEN START SCRUBBING!" Why This Works The intense persona creates urgency and motivation through theatrical confrontation. The exaggerated yelling and insults are motivating rather than offensive because of the clearly defined character.

Chain-of-Thought: Show Your Work!

What it is: Make the AI think out loud step by step before giving the final answer. Like when your math teacher made you show your work—turns out, it actually helps!

Here's the wild thing: when you force an AI to walk through its reasoning, it catches its own mistakes. It's like the difference between blurting out an answer vs. actually thinking through the problem. The AI becomes significantly smarter just by talking to itself.

The Magic Phrase That Changes Everything

Just add this to the end of your prompt:

The Magic Words
Add This to Any Complex Prompt Let's think through this step by step. Why It Works This phrase forces the AI to externalize its reasoning process before giving an answer. By "showing its work," the AI catches its own mistakes and produces more accurate results. It's like the difference between guessing and actually solving the problem.

That's it. Those 7 words can turn a wrong answer into a right one. Wild, right?

5 Original Chain-of-Thought Examples

Example 1: The Classic Age Word Problem

Family Math Drama
Problem Sarah is twice as old as her brother Mike. Five years ago, Sarah was three times as old as Mike. How old are they now? Chain-of-Thought Trigger Let's think through this step by step. AI Reasoning Process Step 1: Let's say Mike's current age is M. Then Sarah's age is 2M. Step 2: Five years ago, Mike was M-5 and Sarah was 2M-5. Step 3: The problem says five years ago Sarah was 3 times as old as Mike. Step 4: So 2M - 5 = 3(M - 5) Step 5: 2M - 5 = 3M - 15 Step 6: M = 10 Final Answer Mike is 10, Sarah is 20. Why This Works By working through each step explicitly, the AI catches any algebraic errors and arrives at the correct solution. The step-by-step approach prevents the AI from jumping to incorrect conclusions.

Example 2: Logic Puzzle

Who Owns the Fish?
Problem There are five houses in a row, each painted a different color. In each house lives a person of different nationality. These five owners drink different beverages, smoke different brands of cigarettes, and keep different pets. Given Clues • The Brit lives in the red house • The Swede keeps dogs as pets • The Dane drinks tea • The green house is on the left of the white house • The green house's owner drinks coffee • The person who smokes Pall Mall rears birds • The owner of the yellow house smokes Dunhill • The man living in the center house drinks milk • The Norwegian lives in the first house • The man who smokes Blends lives next to the one who keeps cats • The man who keeps horses lives next to the man who smokes Dunhill • The owner who smokes Bluemaster drinks beer • The German smokes Prince • The Norwegian lives next to the blue house • The man who smokes Blends has a neighbor who drinks water Who owns the fish? Chain-of-Thought Trigger Walk me through the deduction process. AI Reasoning Process Step 1: Norwegian is in House 1 (given) Step 2: House 2 is blue (next to Norwegian) Step 3: Center house (3) drinks milk Step 4: Green is left of white → houses 4 and 5 (house 3 has milk, not coffee) Step 5: House 4 drinks coffee (green house rule) ... [continues logical deduction] ... Final Answer The German owns the fish! Why This Works The step-by-step approach forces the AI to build the solution incrementally, ensuring no contradictions and maintaining all constraints from the clues.

Example 3: Budget Word Problem

Real Life Math
Problem I'm planning a road trip. Gas costs $3.50/gallon. My car gets 28 miles per gallon. The trip is 420 miles each way. I need to pay $45/night for a hotel for 2 nights. Food will be $60/day for 3 days. I have $500 budgeted. Do I have enough? If yes, how much left over? If no, how much more do I need? Chain-of-Thought Trigger Let's work through this systematically. AI Reasoning Process Step 1: Calculate total miles: 420 × 2 = 840 miles round trip Step 2: Gas needed: 840 ÷ 28 = 30 gallons Step 3: Gas cost: 30 × $3.50 = $105 Step 4: Hotel: 2 nights × $45 = $90 Step 5: Food: 3 days × $60 = $180 Step 6: Total cost: $105 + $90 + $180 = $375 Final Answer $500 - $375 = $125 left over! Road trip is a go! Why This Works Breaking down the calculation into discrete steps prevents arithmetic errors and makes the budget analysis transparent. Each category is calculated independently before summing.

Example 4: Pattern Recognition

Find the Next Number
Problem What comes next in this sequence? Explain your reasoning. 2, 6, 12, 20, 30, 42, ? AI Reasoning Process Step 1: Look at differences between numbers 6-2=4, 12-6=6, 20-12=8, 30-20=10, 42-30=12 Step 2: The differences are increasing by 2 each time: 4, 6, 8, 10, 12... Step 3: Next difference should be 14 Step 4: 42 + 14 = 56 Alternative pattern: These are n×(n+1) for n=1,2,3,4,5,6... 1×2=2, 2×3=6, 3×4=12... 7×8=56 ✓ Final Answer 56 Why This Works The AI identifies the pattern through difference analysis and verifies with an alternative approach (n×(n+1)), ensuring high confidence in the answer.

Example 5: Reading Comprehension

Text Analysis
Passage to Analyze "The proliferation of smartphone usage has fundamentally altered human interaction. Where once we engaged in face-to-face conversations, we now stare at glowing rectangles. Family dinners have become silent affairs punctuated only by notification chimes. We have traded genuine connection for the illusion of connectivity." Chain-of-Thought Trigger Determine the author's tone and main argument. Analyze this step by step. AI Reasoning Process Step 1: Word choice analysis—'fundamentally altered' suggests negative change Step 2: 'Stare at glowing rectangles' is derogatory/dismissive language about phones Step 3: 'Silent affairs' and 'notification chimes' paint a sad picture Step 4: Final sentence contrasts 'genuine connection' vs 'illusion of connectivity' Final Answer Tone: Critical/pessimistic Main argument: Smartphones have damaged authentic human relationships Why This Works The step-by-step analysis identifies specific rhetorical choices that reveal the author's perspective. This prevents superficial readings and ensures the interpretation is grounded in textual evidence.

Self-Consistency: Ask Three Times, Trust the Majority

What it is: Generate multiple answers to the same question and pick the one that shows up most often. It's like democracy, but for AI reasoning.

Think of it this way: if you asked one person a hard math question, they might get it wrong. But if you ask 5 people and 4 give you the same answer? That's probably the right one. AI works the same way—sometimes it gets lucky, sometimes it derails. Asking multiple times and voting filters out the weird outlier answers.

How It Works (The Simple Version)

Ask the Same Question 3-5 Times
Collect Different Reasoning Paths
Count Which Answer Appears Most
Winner Takes All

5 Original Self-Consistency Examples

Example 1: The Infamous Age Riddle

The Classic Trap
Problem When I was 8 years old, my brother was half my age. Now I am 50 years old. How old is my brother? Self-Consistency Trigger Generate 3 different ways to solve this and see if they agree. Attempt 1 (Direct Approach) "Half of 8 is 4, so brother was 4. Now I'm 50, brother is 25." ❌ WRONG Attempt 2 (Age Difference Method) "Age difference is always 4 years (8-4=4). So 50-4=46." ✓ RIGHT Attempt 3 (Algebraic Approach) "Brother is 4 years younger. 50-4=46." ✓ RIGHT Self-Consensus 46 years old (2 out of 3 methods agree!) Why This Works Multiple independent reasoning paths lead to the same answer, filtering out the incorrect approach (Attempt 1) which misinterpreted "half my age" as a persistent ratio rather than a fixed age difference.

Example 2: Logic Grid Puzzle

Who Did It?
Problem Three friends (Alice, Bob, Charlie) each have different favorite colors (red, blue, green) and different pets (dog, cat, bird). Given Clues 1. Alice doesn't like red 2. The person with the dog likes blue 3. Bob has a cat 4. Charlie doesn't like green What color does each person like and what pet do they have? Self-Consistency Trigger Solve this 3 different ways and see if you get the same answer. Path 1 (Start with Bob) Start with Bob having cat. Person with dog likes blue, so that's not Bob. Alice doesn't like red... [deduction] → Alice: green+bird, Bob: red+cat, Charlie: blue+dog ✓ Path 2 (Start with Charlie) Start with clue 4. Charlie doesn't like green. Could be red or blue. If Charlie likes blue, he has dog... [deduction] → Same answer ✓ Path 3 (Start with Alice) Start with Alice. She doesn't like red, so green or blue. If blue, she'd have dog... leads to contradiction. So Alice has green... [deduction] → Same answer ✓ Self-Consensus All 3 independent paths converge to the same solution! Why This Works Each path starts from a different clue and uses different reasoning, yet all arrive at the same conclusion. This dramatically increases confidence that the solution is correct.

Example 3: Probability Problem

Monty Hall-ish
Problem I have two children. At least one is a boy. What's the probability both are boys? Self-Consistency Trigger Solve this using 3 different approaches (e.g., sample space, conditional probability formula, enumeration). Approach 1 (Sample Space) Possible combinations with at least one boy: BB, BG, GB. Only 1 has two boys. Answer: 1/3 ✓ Approach 2 (Conditional Formula) P(BB | at least one B) = P(BB) / P(at least one B) = (1/4) / (3/4) Answer: 1/3 ✓ Approach 3 (Tree Diagram) Draw tree of possibilities, eliminate branches without at least one boy, count remaining... Answer: 1/3 ✓ Self-Consensus 1/3 (About 33.3%) Why This Works Three independent mathematical approaches all converge on the same answer. This is the famous "boy or girl paradox" where intuition often suggests 1/2, but rigorous analysis shows 1/3.

Example 4: Pattern Completion

What's the Rule?
Problem Find the rule and the next item in this sequence: 1, 11, 21, 1211, 111221, ? Self-Consistency Trigger Try to figure this out 3 different ways. Method 1 (Read Aloud) Try reading aloud... "one 1", "two 1s", "one 2 one 1" → It's describing the previous number! Next: 312211 ✓ Method 2 (Count Digits) Count consecutive digits... 111221 has "three 1s, two 2s, one 1" Next: 312211 ✓ Method 3 (Pattern Recognition) This looks like Conway's Look-and-Say sequence, a famous mathematical sequence... Next: 312211 ✓ Self-Consensus All 3 methods agree: Next is 312211! Why This Works Three different approaches—verbal interpretation, digit counting, and pattern identification—all converge on the same answer. This is Conway's famous "Look-and-Say" sequence.
All methods agree! The pattern is Conway's Look-and-Say sequence. Each term describes the previous term.

Example 5: Analogy Completion

Word Relationships
Problem Complete this analogy from different angles: Painting is to canvas as ______ is to code. Self-Consistency Trigger Approach this from multiple perspectives: functional relationship, creative process, medium of expression, etc. Angle 1 (Creation) Artist creates on canvas, programmer creates with code → Program Angle 2 (Medium) Canvas is the medium for paint, ___ is medium for code → Software Angle 3 (Art form) Painting is art on canvas, ___ is art made with code → Program/Software Self-Consensus Most common answers: "Program" or "Software" (Both work, consensus on the relationship) Why This Works Three different perspectives all point to similar answers. The relationship between painter:canvas and programmer:code has multiple valid interpretations that converge on "Program" or "Software" as the most natural completions.

Prompt Chaining: Assembly Line Style

What it is: Break a big task into smaller steps where each step feeds into the next. Like a factory assembly line, but for AI prompts.

Instead of asking AI to write a novel in one go (spoiler: it'll be terrible), you break it down: outline → characters → chapter 1 → chapter 2 → etc. Each step gets the output from the previous step, so the AI has context but isn't overwhelmed.

5 Original Prompt Chaining Examples

Example 1: Writing a Blog Post

The Chain:
Step 1: Generate 5 blog topics about remote work
Step 2: Pick best topic + create outline
Step 3: Write introduction
Step 4: Write each section
Step 5: Edit and polish

Example 2: Customer Support Response

Chain 1: Analyze
Step 1 - Analyze Analyze this angry customer email and extract: 1. The specific problem 2. Customer's emotional state (1-10 scale) 3. What they want as resolution Customer Email "I ordered your product 2 weeks ago and it still hasn't arrived. This is completely unacceptable. I needed this for a presentation yesterday and now I look incompetent. I want a full refund AND an explanation." Step 1 Output Problem: Late delivery (2 weeks overdue) Emotion: 9/10 (very angry) Wants: Refund + explanation
Chain 2: Draft Response
Step 2 - Draft Response Draft an email response using the analysis from Step 1: Context from Previous Step • Problem: Late delivery (2 weeks overdue) • Emotion level: 9/10 (very angry) • Wants: Refund + explanation Requirements Tone: Empathetic but professional. Acknowledge frustration. Offer refund. Explain cause (shipping partner delay). Offer discount on future order. Step 2 Output [Drafted professional response addressing all points...]

Example 3: Data Analysis Pipeline

The Data Chain:
Step 1: Clean raw data (remove duplicates, fix formats)
Step 2: Categorize and tag data
Step 3: Calculate metrics and statistics
Step 4: Identify trends and insights
Step 5: Generate executive summary

Example 4: Code Review Process

Multi-Step Code Review
Step 1 - Syntax Check "Review this Python code for syntax errors and obvious bugs: [code]" → Output: Fixed syntax version Step 2 - Logic Review "Review this code for logical errors and edge cases: [fixed code from step 1]" → Output: Logic-improved version Step 3 - Style Check "Review this code for PEP 8 compliance and best practices: [code from step 2]" → Output: Polished final version Step 4 - Documentation "Add docstrings and comments to this code: [code from step 3]" → Output: Production-ready code! Why This Works Breaking the review into focused phases prevents overwhelm. Each step refines the output, catching different categories of issues at the appropriate level of detail.

Example 5: Recipe Creator

Recipe Chain
Step 1 - Ideation "Suggest 3 dessert ideas using chocolate and strawberries" → Output: Chocolate strawberry tart, chocolate-covered strawberries, strawberry chocolate cake Step 2 - Ingredients "Create a detailed ingredient list for a chocolate strawberry tart for 8 people" → Output: [List of ingredients with quantities] Step 3 - Instructions "Write step-by-step instructions for making chocolate strawberry tart using these ingredients: [list from step 2]" → Output: [Detailed cooking instructions] Step 4 - Presentation "Suggest wine pairings and plating ideas for chocolate strawberry tart" → Output: [Final presentation touches] Why This Works Chaining allows the recipe to evolve naturally from concept to execution. Each step builds on previous outputs, ensuring consistency and completeness without overwhelming the AI with all requirements at once.

Tree of Thoughts: Explore All the Paths!

What it is: Instead of one straight line of thinking, you branch out and explore multiple possibilities at each step. Like a choose-your-own-adventure book, but for problem-solving.

Regular AI thinking: "I'll go this way... and hope it's right." Tree of Thoughts: "What if I try this way? Or that way? Or THIS way? Let me check all of them and pick the best one." It's like having multiple AI experts brainstorm together and vote on the best approach.

When Tree of Thoughts Shines

  • Creative writing with multiple possible directions
  • Strategic planning with various options
  • Math problems where you could use different methods
  • Game playing (chess, puzzles, etc.)
  • Decision-making with trade-offs

5 Original Tree of Thoughts Examples

Example 1: Creative Writing Branching

Story Decision Tree
Scenario I'm writing a mystery novel. My detective has cornered the suspect in an abandoned warehouse. The suspect is holding a gun but seems nervous. Tree of Thoughts Prompt Generate 3 different ways this scene could play out, then evaluate each: Branch Options Branch A (Tension/Escalation): The suspect panics and fires... Branch B (Psychological): The detective talks them down using psychology... Branch C (Action): A secondary character bursts in and changes everything... Evaluation Criteria Evaluate each branch for: dramatic tension, character development, plot advancement. Branch A Analysis High tension, but might make detective seem incompetent. Risk of cliché shootout. Branch B Analysis Great character moment, shows detective's skill. Lower action but higher emotional payoff. Branch C Analysis Surprise twist potential, but could feel deus ex machina if not set up. Recommended Solution Combine B + C - detective talks them down partially, THEN secondary character arrives with crucial evidence! Why This Works Tree of Thoughts explores multiple narrative possibilities systematically. By evaluating each branch against criteria, the AI identifies the optimal hybrid approach that combines strengths from different paths.

Example 2: Business Strategy Options

Strategic Decision Tree
My startup has $100K left. We have three options: Option 1: Pour it all into marketing to acquire users fast Option 2: Hire one senior engineer to improve the product Option 3: Split it - half marketing, half extending runway For each option, explore: - Best case scenario - Worst case scenario - Probability of success - What we'd learn Then recommend the best path.
Option 1 Tree: Best: Viral growth, Series A. Worst: Burn cash, no product-market fit. Risk: HIGH.
Option 2 Tree: Best: Product breakthrough, organic growth. Worst: Delayed growth, still need marketing. Risk: MEDIUM.
Option 3 Tree: Best: Balanced approach, learn what works. Worst: Mediocrity - not enough for either. Risk: MEDIUM.
Tree Analysis: Option 3 has best risk-adjusted return. Allows testing before going all-in.

Example 3: Math Problem with Multiple Methods

Math Exploration Tree
Calculate: 25 × 48 Try solving this 4 different ways and see if you get the same answer: Method A: Standard multiplication Method B: 25 × 48 = 25 × 50 - 25 × 2 Method C: 25 × 48 = 100 × 12 (quarter of 48 is 12, times 100) Method D: Break into (20 + 5) × 48 Do all methods agree?
Method A: 25 × 48 = 1,200
Method B: 1,250 - 50 = 1,200 ✓
Method C: 100 × 12 = 1,200 ✓ (Elegant!)
Method D: 960 + 240 = 1,200 ✓
Confidence: 100% - Four independent paths all converge to 1,200!

Example 4: Dinner Planning Decision Tree

Culinary Thought Tree
I need to plan dinner for 6 people with these constraints: - One person is vegetarian - One person has gluten allergy - I have 2 hours to cook - Budget: $40 Explore 3 different menu approaches: Approach A: Mediterranean feast (hummus, falafel, salads) Approach B: Mexican fiesta (tacos with corn tortillas, beans, rice) Approach C: Italian family style (risotto, roasted veggies, salad) Compare on: cost, prep time, deliciousness factor, accommodation of restrictions.
Approach A: $35, 1.5 hrs, naturally veg/gluten-free. High deliciousness.
Approach B: $28, 1 hr, easy to make gluten-free. Very high deliciousness.
Approach C: $38, 2+ hrs (risotto needs attention), naturally veg but need GF pasta. High deliciousness.
Winner: Approach B - fastest, cheapest, easiest to modify, crowd-pleaser!

Example 5: Debugging Code

Debug Decision Tree
My app crashes when users try to upload large files. Generate 3 different hypotheses and investigation paths: Hypothesis A: Memory issue - app runs out of RAM with large files Investigation: Check memory usage logs, test with different file sizes Hypothesis B: Timeout issue - upload takes too long and connection drops Investigation: Check server timeout settings, network logs Hypothesis C: File validation - corrupt files or wrong format causing crash Investigation: Check validation logic, test with different file types Evaluate each hypothesis probability and suggest where to start.
Hypothesis A: High probability. Memory issues are common with file uploads. Easy to test.
Hypothesis B: Medium probability. Would see specific timeout errors in logs.
Hypothesis C: Lower probability. Usually gives error message, not crash.
Investigation Order: Start with A (memory), if not that check B (timeout), finally C (validation).

RAG: Bring Your Own Facts

What it is: Retrieval-Augmented Generation - fancy way of saying "give the AI some documents to read before it answers." Like letting an open-book student use their textbook during the exam.

Here's the problem: AI has a knowledge cutoff. It doesn't know what happened yesterday. It might hallucinate (make stuff up). And it definitely doesn't know about your private company documents. RAG solves all of this by stuffing relevant info into the prompt.

5 Original RAG Examples

Example 1: Company Policy Question

HR Chatbot Setup
Context from Company Handbook: [SEPARATOR] Section 4.2: "Employees accrue 1 vacation day per month worked. Unused days roll over up to a maximum of 30 days. New employees must wait 90 days before using vacation time." Section 7.1: "Remote work is permitted up to 2 days per week with manager approval. Full-time remote work requires VP approval and must be requested 30 days in advance." [SEPARATOR] Question: I've been here for 2 months. How many vacation days do I have, and can I work from home tomorrow?
AI Answer: "You have accrued 2 vacation days (1 per month × 2 months). However, you cannot use them yet because you haven't reached the 90-day waiting period. Regarding remote work - you can work from home up to 2 days per week, but you need your manager's approval first!"

Example 2: Product Support

Tech Support Bot
Product Documentation: [SEPARATOR] Model: TurboBlend 3000 Issue: Blender won't start Troubleshooting: 1. Check that pitcher is locked in place - must hear "click" 2. Ensure safety switch is engaged (red light should be on) 3. Try different power outlet 4. Reset: unplug for 60 seconds, then replug 5. If still not working, motor may need service Model: TurboBlend 3000 Error Code E4: "Overheating protection activated. Let unit cool for 30 minutes." [SEPARATOR] Customer Question: "My blender shows a red light but won't turn on when I press the button. What should I do?"
AI Answer: "Good news - the red light means the safety switch is engaged (that's step 2!). Since the light is on but it won't start, let's check step 1: Is the pitcher fully locked in? You should hear a 'click' sound. If it's already clicked in, try step 4: unplug for 60 seconds to reset the unit. If still no luck after these steps, the motor may need service."

Example 3: Medical Information (Disclaimer: Not Real Medical Advice!)

Health Info Retrieval
Context from Medical Database (for educational purposes only): [SEPARATOR] Medication: Amoxicillin Common side effects: Nausea, diarrhea, rash Serious side effects: Difficulty breathing, severe rash, swelling Interactions: May reduce effectiveness of birth control pills Food: Can take with or without food Medication: Ibuprofen Common side effects: Stomach upset, heartburn Serious side effects: Stomach bleeding, kidney problems Interactions: Blood thinners, other NSAIDs Food: Take with food to reduce stomach upset [SEPARATOR] Question: I'm taking amoxicillin and my stomach feels weird. Is that normal?
AI Answer: "According to the provided information, nausea is listed as a common side effect of amoxicillin, so stomach discomfort can be normal. Taking it with food might help. However, if you experience severe symptoms like difficulty breathing, severe rash, or swelling, contact a doctor immediately. (Note: Always consult your healthcare provider for medical advice!)"

Example 4: Legal Document Analysis

Lease Agreement Analysis
Relevant Lease Clauses: [SEPARATOR] Section 12: "Tenant may not sublet the apartment without written consent from Landlord." Section 15: "Security deposit of $1,500 will be returned within 30 days of lease end, minus deductions for damages beyond normal wear and tear." Section 18: "Lease may be terminated early with 60 days written notice and payment of 2 months' rent as penalty." Section 22: "No pets allowed without written permission and $300 pet deposit." [SEPARATOR] Question: I need to move for a new job in 3 weeks. What are my options?
AI Answer: "According to your lease: You CAN terminate early (Section 18), BUT you need 60 days notice and must pay 2 months' rent as penalty. Since you need to leave in 3 weeks (21 days), you don't have enough notice time. Options: 1) Negotiate with landlord (they might be flexible), 2) Find someone to take over your lease (but Section 12 requires landlord approval for subletting), or 3) Pay the penalty and give notice now for a future date."

Example 5: Research Paper Q&A

Paper Analysis
Excerpt from Research Paper "Climate Effects on Coffee Production": [SEPARATOR] "Arabica coffee (Coffea arabica) requires specific growing conditions: temperatures between 18-21°C, consistent rainfall of 1,500-2,000mm annually, and elevations of 600-2,000 meters. Climate change projections indicate that suitable growing areas may decrease by 50% by 2050. Rising temperatures force farmers to move to higher elevations, but mountainous terrain limits expansion. The study examined 12 coffee-growing regions across Ethiopia, Colombia, and Indonesia. Yield reductions of 15-35% were observed in regions where temperatures exceeded 23°C for more than 30 days annually." [SEPARATOR] Question: Why are coffee farmers moving to higher ground, and how much coffee production might we lose by 2050?
AI Answer: "According to the research: Farmers are moving to higher elevations because rising temperatures from climate change make lower areas too hot for Arabica coffee (which needs 18-21°C). The paper projects that suitable coffee-growing areas may decrease by 50% by 2050. Additionally, regions experiencing temperatures over 23°C for 30+ days per year are already seeing yield reductions of 15-35%."

ReAct: Think, Act, Observe, Repeat

What it is: Reasoning + Acting - the AI thinks about what to do, does it, sees what happened, and repeats. Like a robot scientist conducting experiments!

Picture this: You're trying to find the best pizza place in a new city. You don't just guess—you look at a map (act), see what's nearby (observe), decide which direction to go (think), walk there (act), check the reviews (observe), and keep going until you find the perfect slice. That's ReAct!

The ReAct Loop

Thought
"What do I need to know?"
Action
Do something!
Observation
What happened?
Repeat!

5 Original ReAct Examples

Example 1: Trip Planner

Planning a Weekend in Chicago
Question: "Plan a weekend trip to Chicago for under $500 including flights, hotel, and food." Thought 1: I need to know flight prices first to see how much budget is left for hotel/food. Action 1: Search[cheap flights to Chicago this weekend] Observation 1: Flights are $180-250 round trip. Thought 2: If I take the $180 flight, I have $320 left. I need to find a hotel for 2 nights. Action 2: Search[hotels in Chicago downtown under $150/night] Observation 2: Found budget hotels at $120/night ($240 total). Thought 3: That leaves $80 for food for 2 days. That's tight but doable. Action 3: Search[cheap eats Chicago downtown] Observation 3: Deep dish pizza slices $6, food trucks $8-12, diners $15/meal. Thought 4: I have a viable plan! Let me compile the itinerary. Action 4: Finish[Weekend Chicago Plan: $180 flight + $240 hotel + $80 food = $500]

Example 2: Math Problem with Calculator

Complex Calculation
Question: "If I invest $10,000 at 7% annual interest compounded monthly for 20 years, then withdraw $500/month, how long until the money runs out?" Thought 1: This is a complex financial calculation. I need to calculate the future value first, then simulate withdrawals. Action 1: Calculate[10000 * (1 + 0.07/12)^(12*20)] Observation 1: After 20 years: $40,169.43 Thought 2: Now I need to calculate how many months $500 withdrawals will last from this amount, considering it keeps earning interest. Action 2: Calculate[solve for N where 40169.43*(1.00583)^N - 500*((1.00583)^N - 1)/0.00583 = 0] Observation 2: Approximately 147 months Thought 3: 147 months is about 12.25 years. Action 3: Finish[The money will last approximately 12 years and 3 months after you start withdrawing]

Example 3: Recipe Finder with Substitutions

Cooking Assistant
Question: "I want to make chocolate chip cookies but I'm out of eggs and butter. What can I use instead?" Thought 1: I need to find egg substitutes and butter substitutes for baking. Action 1: Search[baking substitutes for eggs] Observation 1: Options: 1/4 cup applesauce per egg, 1 tbsp flaxseed + 3 tbsp water per egg, mashed banana Thought 2: Good egg options. Now I need butter alternatives. Action 2: Search[butter substitutes in cookies] Observation 2: Options: Coconut oil (1:1), vegetable oil (3/4 cup per 1 cup butter), applesauce (1/2 cup per 1 cup butter) Thought 3: If I use applesauce for both, it might be too wet. Coconut oil + flax egg might work better. Action 3: Search[coconut oil flax egg chocolate chip cookie recipe] Observation 3: Found several successful recipes using this combo. Thought 4: I have a viable solution! Action 4: Finish[Use: 1 cup coconut oil instead of butter + 1 tbsp ground flaxseed mixed with 3 tbsp water per egg]

Example 4: Debugging Assistant

Code Detective
Problem: "My Python script crashes with 'IndexError: list index out of range' on line 42" Thought 1: I need to see the code around line 42 to understand what's happening. Action 1: Read[lines 35-50 of script.py] Observation 1: Line 42: print(items[i]) inside a for loop Thought 2: The error suggests 'i' is larger than the list length. Let me check how 'i' is being set. Action 2: Read[lines 1-35 to see where items and i come from] Observation 2: items = get_data() returns variable length. i starts at 0 and increments. Thought 3: The issue might be that items is empty or shorter than expected. I should add a check. Action 3: Search[Python IndexError list index out of range fix] Observation 3: Common fixes: check len(list), use try/except, or iterate differently. Thought 4: Best fix is to check if items has elements before accessing. Action 4: Finish[Add check: if len(items) > i: print(items[i]) else: print("No item at index", i)]

Example 5: Research Assistant

Fact Checker
Question: "Who wrote the first computer program and when?" Thought 1: I think it was Ada Lovelace in the 1800s, but I should verify this. Action 1: Search[first computer program Ada Lovelace] Observation 1: Ada Lovelace wrote the first algorithm intended for Charles Babbage's Analytical Engine in 1843. Thought 2: Wait, was it actually executed? Let me check if the machine was even built. Action 2: Search[Charles Babbage Analytical Engine built 1843] Observation 2: The Analytical Engine was never completed in Babbage's lifetime. Lovelace's program was theoretical. Thought 3: So if we're talking about actually executed programs, who ran the first one? Action 3: Search[first executed computer program in history] Observation 3: The first executed programs ran on ENIAC in 1945-1946, written by Jean Bartik and others. Thought 4: I have nuanced information now. Let me provide a complete answer. Action 4: Finish[Ada Lovelace wrote the first computer PROGRAM in 1843 (theoretical). The first EXECUTED program ran on ENIAC in 1945-1946, written by Jean Bartik and the ENIAC women.]

Meta Prompting: Teach the Recipe, Not Just the Dish

What it is: Instead of giving examples of the answer, you give the AI a template or structure for HOW to think about the problem. You're teaching it the recipe, not just showing finished dishes.

This is like the difference between showing someone 5 photos of happy dogs (few-shot) vs. teaching them "draw a dog by starting with circles for body and head, then add legs, then fur texture" (meta prompting). The second approach teaches them to draw ANY dog, not just copy the 5 you showed.

5 Original Meta Prompting Examples

Example 1: The Problem-Solving Template

Universal Solver Pattern
When solving any word problem, follow this structure: 1. IDENTIFY: What information is given? What am I solving for? 2. CHOOSE: What mathematical operation or formula applies? 3. SET UP: Write the equation with variables 4. SOLVE: Calculate the answer step by step 5. CHECK: Does the answer make sense? Verify with estimation. Problem: A train travels 120 miles in 2 hours. How long will it take to travel 300 miles at the same speed?
AI Uses the Framework:
1. IDENTIFY: Given: 120 miles in 2 hours. Need: time for 300 miles.
2. CHOOSE: First find speed, then use speed = distance/time
3. SET UP: Speed = 120/2 = 60 mph. Time = 300/60
4. SOLVE: Time = 5 hours
5. CHECK: 300 is 2.5 × 120, so time should be 2.5 × 2 = 5 hours ✓

Example 2: The Socratic Questioner

Teaching Through Questions
When someone asks a complex question, don't just answer. Use the Socratic method: 1. Clarify what they know: "What do you already understand about this?" 2. Identify gaps: "What specifically is confusing you?" 3. Guide with questions: Ask leading questions toward understanding 4. Connect to what they know: "This is similar to..." 5. Confirm understanding: "Does that make sense? What questions do you have?" Student asks: "Why is the sky blue?"
AI Responds with Socratic Method:
"Great question! Let's explore this together. First, what do you already know about sunlight? [Student responds] ... So sunlight contains all colors. Now, what happens when light enters our atmosphere? [Guides through Rayleigh scattering concept] ... So which colors scatter more easily - long wavelengths or short? [Leads to blue/violet scattering] ..."

Example 3: The Code Review Structure

Structured Code Review
Review any code using this framework: SECTION 1: HIGH-LEVEL OVERVIEW - What does this code do in plain English? - What problem is it solving? SECTION 2: CODE QUALITY - Is it readable? Are variable names clear? - Are there comments where needed? - Does it follow language conventions? SECTION 3: LOGIC & CORRECTNESS - Does it handle edge cases? - Are there potential bugs? - Is the logic efficient? SECTION 4: IMPROVEMENTS - One thing to change immediately - One thing to refactor later - One thing that was done well [Code to review would go here]

Example 4: The Story Structure Blueprint

Story Architecture
Write any short story following this structure: OPENING (1 paragraph): Establish the setting and protagonist's normal world. End with something that hints at change coming. INCITING INCIDENT (1 paragraph): The event that disrupts the normal world. The protagonist must react. RISING ACTION (2-3 paragraphs): Complications arise. Stakes increase. Protagonist struggles. CLIMAX (1 paragraph): The moment of maximum tension. The protagonist faces their challenge. RESOLUTION (1 paragraph): What changed? How is the protagonist different? End with emotional impact. Theme to explore: Redemption

Example 5: The Argument Analyzer

Critical Thinking Template
Analyze any argument using this logical framework: CLAIM: What is the main assertion being made? EVIDENCE: What facts, data, or examples support it? WARRANTS: What assumptions connect evidence to claim? COUNTER-ARGUMENTS: What could someone opposed say? QUALIFIERS: Under what conditions is this claim valid? Argument to analyze: "Social media is making teenagers more anxious and depressed, so we should ban it for anyone under 18."
Structured Analysis:
CLAIM: Social media causes anxiety/depression in teens, therefore should be banned under 18.
EVIDENCE: Studies showing correlation between social media use and mental health issues.
WARRANTS: Correlation = causation; ban is effective solution; 18 is right cutoff.
COUNTER-ARGUMENTS: Social connection benefits; teens will find workarounds; education better than prohibition.
QUALIFIERS: Valid for excessive use; varies by individual; age-appropriate content matters.

Reflexion: Learn From Your Mistakes

What it is: After the AI does something, you ask it to critique its own work, identify what went wrong, and try again with improvements. It's like having the AI grade its own homework and then redo it!

This is incredibly powerful because it turns one-shot prompting into an iterative improvement cycle. Instead of accepting the first draft (which might be mediocre), the AI becomes its own editor, spotting weaknesses and fixing them.

The Reflexion Loop

Step 1: AI Does Task
Step 2: Self-Critique
"What could be better?"
Step 3: Revise & Improve
Repeat until satisfied

5 Original Reflexion Examples

Example 1: Essay Improvement

Draft 1: Initial Essay
[AI writes 3-paragraph essay about climate change] [SEPARATOR] Now critique your own essay. Be honest: 1. What are the weaknesses? 2. What's missing? 3. Where is the evidence weak? 4. How could the flow be better? Critique: "The opening is too generic. I need a hook. The middle paragraph jumps between topics without clear transitions. I'm making claims without citing specific data. The conclusion just restates instead of providing a call to action..."
Draft 2: Improved Version
Now rewrite the essay addressing those critiques: - Start with specific, startling statistic as hook - Add transition sentences between paragraphs - Include specific data points with sources - End with actionable steps readers can take [AI produces much improved essay with all critiques addressed]

Example 2: Code Refactoring

Code Self-Review
[AI writes Python function to process user data] [SEPARATOR] Review your own code as if you're a senior developer: - Are there code smells? - Is it efficient? - Is it maintainable? - Security concerns? Self-review: "I'm repeating the same validation logic in three places - that's a violation of DRY principle. The function is doing too many things (SRP violation). I'm not handling the case where user_data is None. The variable names 'x' and 'y' are not descriptive..." [SEPARATOR] Now refactor the code fixing these issues.

Example 3: Creative Writing Polish

Story Self-Editing
[AI writes a short story scene] [SEPARATOR] Put on your editor hat. Analyze this scene: - Is the dialogue natural? - Are characters distinct? - Is there enough sensory detail? - What's the pacing like? - Does it advance the plot? Analysis: "The dialogue feels a bit on-the-nose - characters are saying exactly what they're thinking. I need more subtext. The setting description is just visual - I should add sounds and smells. The pacing drags in the middle. I tell the reader the character is nervous instead of showing it..." [SEPARATOR] Revise the scene incorporating these improvements.

Example 4: Math Problem Correction

Error Detection
Solve: If a rectangle has perimeter 30 and length is twice the width, what's the area? First attempt: "Let width = w, length = 2w Perimeter = 2(length + width) = 2(2w + w) = 6w = 30 So w = 5, length = 10 Area = 5 × 10 = 50" [SEPARATOR] Wait, double-check your work: - Did you set up the equation correctly? - Check: Does 5 and 10 give perimeter 30? - Verify the area calculation. Verification: "2(10 + 5) = 2(15) = 30 ✓. Area is indeed 50. The answer is correct!" (If there was an error, the AI would catch and fix it)

Example 5: Business Email Revision

Professional Communication Polish
Draft an email to a client explaining that their project will be delayed by one week. [AI writes initial email] [SEPARATOR] Critique your own email professionally: - Is the tone appropriate? - Did you take responsibility or make excuses? - Is there a solution offered? - Is it concise or wordy? Self-critique: "I used passive voice ('delays have occurred') instead of taking ownership. I spent too much time explaining why instead of focusing on solutions. I should offer something to make up for the delay. The subject line is vague..." [SEPARATOR] Write an improved version addressing these issues.
Pro Tip: You can do multiple rounds of reflexion! Draft → Critique → Revise → Critique Again → Final Polish. Each iteration gets noticeably better.

The Greatest Hits: Your Prompt Engineering Cheat Sheet

Look, I just threw a LOT at you. Here's the TL;DR - the stuff that'll give you 80% of the benefits with 20% of the effort:

The Essential Toolkit

Be Specific AF

"Write about dogs" → terrible. "Write a 300-word blog post about training golden retriever puppies, using a friendly tone, with 3 practical tips" → chef's kiss

Give Examples

When zero-shot fails, add 2-3 examples showing EXACTLY what you want. The AI is great at pattern matching.

Make It Think

For hard problems, add "Let's think step by step" or "Show your work." Seriously. It works like magic.

Assign a Role

"Act as a grumpy cybersecurity expert" or "Explain like I'm 5." The AI commits to the bit hard.

Break It Down

Complex task? Chain it: outline → draft → edit. Don't ask for a masterpiece in one shot.

Iterate, Iterate, Iterate

First draft rarely perfect. Ask AI to critique itself and improve. Then do it again. Each pass gets better.

Quick Reference: Which Technique When?

If You Need... Use This
Quick answer to simple question Zero-Shot
Specific format or style Few-Shot
Different perspective or expertise Role Assignment
Math, logic, or complex reasoning Chain-of-Thought
High-stakes accuracy Self-Consistency
Multi-step complex task Prompt Chaining
Exploring multiple approaches Tree of Thoughts
Current or private information RAG
Using tools or doing research ReAct
Teaching a reusable method Meta Prompting
Improving quality Reflexion

Go Forth and Prompt!

Congratulations! You now know more about prompting than 99% of people using AI. Seriously.

But here's the thing: knowing techniques is just the start. The real magic happens when you experiment. Try weird combinations. Break things. See what happens when you ask an AI to "act as a pirate explaining quantum physics while showing your work step by step." (Spoiler: it's hilarious AND educational.)

Your Mission, Should You Choose to Accept It

This Week: Use Chain-of-Thought for every math/logic problem
Next Week: Add role assignment to everything
Ongoing: Always ask "How could this be better?"
Final Thought: The best prompt engineers aren't the ones who memorize every technique—they're the ones who treat AI like a collaborative partner. Be clear. Be specific. Be creative. And don't forget to have fun with it!

Now go make some AI magic! ✨