Two people ask the same question; one gets a useful answer, the other gets something generic. The difference is usually not the model. It is the prompt. The Craft of Prompt Engineering teaches you how to tell an AI system what you mean, in 26 chapters that start from a single sentence and build up to agents, retrieval (RAG) and prompt systems that improve themselves. It works with any chatbot and includes 205 ready-to-use prompts.
Every message you send to a language model is an order carried to a reader who cannot see what you see. Every decision you leave open, the model makes for you: who it is writing for, how long, in what tone, and to what end. This book teaches you to make those decisions on purpose.
Who it is for
- Anyone who uses AI every day and wants better, more reliable results. No technical background is required.
- Developers and technical teams who want to build workflows, automations, RAG systems or agents with AI.
- Instructors and students. The book is designed to serve as a course textbook.
What is inside
- Part I, The Prompt: the five parts of a good prompt (Role, Goal, Context, Format, Constraints), prompts as programs, the logic of prompts, and what the model does with your words.
- Part II, Guiding the Model's Thinking: zero-shot and few-shot prompting, chain of thought, tree and graph of thoughts, progressive prompting, and prompting reasoning models.
- Part III, Prompts at Work: coding with AI, email, resumes and planning, creative work, multimodal prompts and data analysis, images and video, choosing and switching models.
- Part IV, Safety: guardrails and jailbreaks, prompt injection, privacy and secure design.
- Part V, Building Systems: context engineering, structured outputs, tool calling and MCP, AI flows, grounded answers with RAG, multi-agent systems.
- Part VI, Prompts That Improve: self-improving prompts, measuring and testing prompts, prompt compiling and automatic optimization, ethics and the future of the skill.
What makes it different
- Every chapter opens with a real, sourced story: the Light Brigade riding down the wrong valley on an ambiguous order, Clever Hans the "counting" horse, the Mars Climate Orbiter lost to a units mismatch, and Grace Hopper's early compiler.
- 205 ready-to-use prompts. The main teaching device is the before-and-after pair: a weak prompt, what goes wrong and why, the improved prompt, and why it works.
- 25 case studies, 27 Real Story boxes and 144 original figures.
- 43 Under the Hood boxes hold the mathematics and Python code, all of which has been run.
- Fast-changing details are dated "as of late 2026"; the principles are built to outlast any one product.