Skip to Content
Prompt Engineering in Practice
book

Prompt Engineering in Practice

by Shaan Khosla, Richard Davies, Khalil Adib
October 2026
248 pages
6h 6m
English
Manning Publications

Overview

"A thoughtful, practical guide to prompt engineering as a real discipline.”
—Che Gamble, Davies Group


Sometimes your LLMs return brilliant responses. Other times, not so much. Do you know why? Prompt Engineering in Practice shows you how to move from accidental AI results to reliable, production-grade systems you can deploy with confidence. Written by AI veterans Richard Davies and Rafael Fischer, this book introduces a unique approach: treat prompts as engineered, self-contained interfaces that you can compose, evaluate, and refine. This shift reframes model interactions as a strict software design discipline rather than a series of fuzzy trial-and-error exercises.

Spanning 11 comprehensive chapters, Prompt Engineering in Practice establishes a logical “design stack” that builds from microscopic syntax to macroscopic system architecture. You’ll start by learning to define the structural elements of a prompt, including delimiters and falsifiable constraints, along with linguistic characteristics like precision, directness, and brevity. These techniques equip you to write well-specified prompts that you can successfully incorporate into reusable production components.

You’ll then explore the foundational patterns that form the core of prompt engineering and enable you to build robust, scalable agentic workflows. Reviewer Dewang Sultania, Senior Machine Learning Engineer at Netflix, noted “The nine-pattern taxonomy provides genuinely useful composable prompt engineering strategies. It’s also a great introduction on how LLM-powered systems actually work!”

Because LLM responses are consistently inconsistent, the book provides a practical framework to diagnose prompt failures systematically by treating prompts as specifications and investigating sources of variance. Throughout the book, you’ll practice a process to systematically analyze and troubleshoot prompt failures as you navigate four distinct phases of the prompt engineering lifecycle—Design, Test, Iterate, Manage. By the time you reach the deployment and operations chapters that conclude the book, you’ll be treating unexpected outputs as valuable debuggable system signals that help you isolate where a prompt is underspecified.

Ultimately, Prompt Engineering in Practice shows you how to treat prompts as first-class, maintainable software artifacts. You will learn to eliminate “prompt debt” by building version-controlled, audited prompt libraries that can be reviewed in pull requests, secured against injection, and managed using role-based access controls. By bridging the gap between prototype experimentation and production operations, this guide provides the exact tools needed to collaborate with cross-functional teams and maintain consistent, safe AI integrations over time.

About the Technology


About the Book


What's Inside
  • Eliminate prompt debt with version-controlled, audited prompt libraries
  • Reduce development iteration and rework through deliberate linguistic precision
  • Mitigate hallucinations and security vulnerabilities using robust hardening techniques
  • Diagnose and debug model output failures using systematic engineering frameworks


About the Reader
This book is for software developers and AI engineers who want to build, secure, and maintain reliable LLM-powered systems in production.

About the Authors
Richard Davies is the Founder, CEO, and CTO of Meridias. He has worked exclusively in artificial intelligence since 2018, with hands-on experience across machine learning, agents, and Large Language Models. Rafael Fischer, PhD in Engineering, specializes in building and delivering agentic LLM solutions with clients in the US, Europe, and Brazil.

Quotes
Delivers a shared vocabulary and a repeatable methodology—exactly what the field needed.
- Maxim Salnikov, Microsoft

Undeniably the fastest development uplift I’ve experienced in my career has been applying these prompt practices. 5 stars!
- Daniel Alexander Bell, Beyla AI

Finally, a book that treats prompt engineering with the same seriousness we apply to any other part of a production system.
- Ryan Layne, Exigence AI

A guide to save you time and reduce mental overhead.
- Bojan Stanković, BoBot AI

The first book on prompting I’d put in front of a team shipping on top of language models.
- Erik Schwartz, The AI Expert

Richard has a remarkable talent for breaking down difficult topics into clear, engaging explanations without sacrificing technical depth. That ability shines throughout this book.
- Isham Iqbal, Guildhawk Limited

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

How to Develop a Great Digital Strategy

How to Develop a Great Digital Strategy

Jeanne W. Ross, Cynthia M. Beath, Ina M. Sebastian
Storytelling with You

Storytelling with You

Cole Nussbaumer Knaflic

Publisher Resources

ISBN: 9781633436305Publisher SupportOtherPublisher WebsitePurchase Link