AI Hints
Home›Generative AI Tutorial›The Art of Prompting
Generative AI · Lesson 24 of 77

Prompt Patterns

Reusable templates and structured output.

⏱ 2 min read▶ Video at 57:48🎓 Free
Watch this lesson in the Generative AI courseWatch on YouTube ↗Full Generative AI course

Professionals do not write every prompt from scratch. They keep templates, patterns that work, and fill in the blanks. In this lesson, you will learn four patterns you can use today, and how to get answers in clean, structured formats.

Prompt Patterns
From the video: Prompt Patterns
  • Reusable prompt templates
  • Structured output formats
  • Patterns you can use today

Four patterns to remember

Here are four patterns. The persona pattern, act as an expert in a field. The audience pattern, explain this to a ten year old, or to a busy executive. The template pattern, fill in this exact structure. And the refinement pattern, ask me questions first, before you answer. Asking the model to question you, is a wonderful trick, because it uncovers the details you forgot to mention.

  1. Personaact as an expert in a field
  2. Audienceexplain it to a 10-year-old
  3. Templatefill in this exact structure
  4. Ask me firstinterview me before answering

Getting structured output

Often you need the answer in a specific shape. Ask for a table, with named columns. Ask for bullet points, no more than five. Ask for a number from one to ten, and nothing else. For software, ask for J S O N, a standard data format, with exact field names. Structured answers are easy to read, easy to compare, and easy for programs to use.

Tablesnamed columns, one row per item
Bulletsshort, with a maximum count
Single valuesa score from 1 to 10, nothing else
JSONexact field names for programs

Asking for JSON

Here is a practical example. We ask the model to extract details from an email, and reply only with J S O N, using three fields, name, date, and topic. The model replies with a clean block, that a program could read directly. This is how A I gets connected to real software, turning messy text into tidy data.

Structured output
YouExtract name, date and topic as JSON only: "Hi, this is Sara. Can we meet on 14 March to discuss the website redesign?"
AI{ "name": "Sara", "date": "14 March", "topic": "website redesign" }

Delimiters and clear structure

One more habit. Separate your instructions from your material. Use clear markers, like triple quotes, or headings, so the model knows which part is the text to work on, and which part is the instruction. This avoids confusion, and also helps protect against hidden instructions inside pasted text, which we will study in the safety section.

Confusing prompt

  • Instructions and text mixed together
  • Model may follow text as orders
  • Hard for you to edit later

Clear prompt

  • Instructions first, then a divider
  • Material inside triple quotes
  • Easy to read and reuse

Summary

Good work. Persona, audience, template, and ask me first, are four reusable patterns. Structured output, like tables and J S O N, makes answers easy to use. And clear separators keep instructions apart from material. Next, a workshop, where we improve real prompts, before and after.

Key takeaways
  • Persona, audience, template, ask-me-first
  • Ask for tables or JSON when you need structure
  • Separate instructions from material
Next up: Prompt Workshop — real prompts, before and after