The PIE Framework: the official guide (Chapter 3)

This is the canonical, community-maintained reference for the framework the whole book is built on. It mirrors Chapter 3 of Practical AI for the Rest of Us and the companion site at Chapter 3 Companion | Practical AI . This post is a wiki, fix typos, add examples, keep it true to the book.

PIE: as easy as PIE

PIE is a simple, three-step system that covers every good interaction you’ll ever have with an AI. The quality of your output is directly proportional to the quality of your input. PIE is how you raise the quality of the input.

P — Prompt. Write a clear opening prompt. This is where you use the 5-Part Formula to set the AI up to succeed before it ever types a word.

I — Iterate. Have a real conversation with the AI. Read what it gave you, picture what the right version would look like, name where it’s falling short, and tell the AI exactly how to fix it. Repeat until the output is right.

E — Execute. Put it to work in the real world. Send the email, publish the post, present the plan, have the conversation.

You won’t need all three steps every time. A quick factual question might only need a prompt. A drafted email usually needs a prompt and a round or two of iteration. But when the task matters, PIE gives you a complete system for getting the best possible result.

The 5-Part Formula (this lives inside the P)

The formula is: Role + Context + Task + Format + Constraints. You don’t need all five every time, but knowing all five gives you a complete toolkit.

  • Role — Who should the AI pretend to be? (“You’re a nutritionist specializing in heart-healthy diets.”) This tells it which part of its training to draw from.
  • Context — What does the AI need to know about your situation? Rule of thumb: if a human expert would need to know it to help you, the AI needs it too.
  • Task — What exactly do you want done? Start with a verb: Write, Summarize, Explain, Compare, Create, Analyze, Rewrite, Brainstorm.
  • Format — How should the answer be structured? “In a table,” “as a step-by-step guide,” “three options with pros and cons,” “under 200 words.”
  • Constraints — What should the AI avoid or limit? The guardrails: length, tone, complexity, excluded topics, target audience.

Worked example (the P step)

You’re a marketing consultant who specializes in small, local service businesses [ROLE]. I own a landscaping company in suburban Maryland with 12 employees and about 40 regular residential clients. Most of our new business comes from word of mouth, but growth has stalled [CONTEXT]. Create a 90-day marketing plan to help me get 10 new residential clients [TASK]. Present it as a week-by-week action plan with specific, concrete steps I can take myself without hiring a marketing agency [FORMAT]. Keep the total marketing budget under $500, and don’t suggest anything that requires me to learn video editing or graphic design [CONSTRAINTS].

Then you Iterate (name the gap, close it, polish voice and facts) and Execute (put it to work).


A note on history: early drafts of the book called this the “PRIME” framework. The published book uses PIE. If you see “PRIME” anywhere in older threads, it means PIE. The full, searchable prompt library is at Find a Prompt | Practical AI