Buy New
-
To see product details, add this item to your cart.
Ships from: Amazon.com Sold by: Amazon.com
Used - Like New
-
To see product details, add this item to your cart.
FREE Returns
Return this item for free
We offer easy, convenient returns with at least one free return option: no shipping charges. All returns must comply with our returns policy.
Learn more about free returns. How to return the item? - Go to your orders and start the return
- Select your preferred free shipping option
- Drop off and leave!
Ships from: Amazon Sold by: Amazon Resale
Return this item for free
We offer easy, convenient returns with at least one free return option: no shipping charges. All returns must comply with our returns policy.
Learn more about free returns.- Go to your orders and start the return
- Select your preferred free shipping option
- Drop off and leave!
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the authors
OK
Generative AI Design Patterns: Solutions to Common Challenges When Building GenAI Agents and Applications
Purchase options and add-ons
Generative AI enables powerful new capabilities, but they come with some serious limitations that you'll have to tackle to ship a reliable application or agent. Luckily, experts in the field have compiled a library of 32 tried-and-true design patterns to address the challenges you're likely to encounter when building applications using LLMs, such as hallucinations, nondeterministic responses, and knowledge cutoffs.
This book codifies research and real-world experience into advice you can incorporate into your projects. Each pattern describes a problem, shows a proven way to solve it with a fully coded example, and discusses trade-offs.
- Design around the limitations of LLMs
- Ensure that generated content follows a specific style, tone, or format
- Maximize creativity while balancing different types of risk
- Build agents that plan, self-correct, take action, and collaborate with other agents
- Compose patterns into agentic applications for a variety of use cases
- ISBN-13979-8341622661
- Edition1st
- PublisherO'Reilly Media
- Publication dateNovember 11, 2025
- LanguageEnglish
- Dimensions7 x 1.02 x 9.19 inches
- Print length506 pages
Frequently bought together

Customers who viewed this item also viewed
- AI Engineering: Building Applications with Foundation ModelsPaperbackFREE Shipping by AmazonGet it as soon as Sunday, Sep 20
- Designing Multi-Agent Systems: Principles, Patterns, and Implementation for AI AgentsPaperbackFREE Shipping by AmazonGet it as soon as Monday, Sep 21
- Building Applications with AI Agents: Designing and Implementing Multiagent SystemsPaperbackFREE Shipping by AmazonGet it as soon as Sunday, Sep 20
- The Agentic AI Bible: The Complete and Up-to-Date Guide to Design, Develop, and Scale Goal-Driven, LLM-Powered Agents that Think, Execute and EvolvePaperbackFREE Shipping on orders over $35 shipped by AmazonGet it as soon as Monday, Sep 21
- Build a Large Language Model (From Scratch)PaperbackFREE Shipping by AmazonGet it as soon as Sunday, Sep 20
- Hands-On Large Language Models: Language Understanding and GenerationPaperbackFREE Shipping by AmazonGet it as soon as Monday, Sep 21
Customers also bought or read
- Building Applications with AI Agents: Designing and Implementing Multiagent Systems
Paperback$56.44$56.44FREE delivery Sun, Sep 20 - Designing Multi-Agent Systems: Principles, Patterns, and Implementation for AI Agents
Paperback$46.39$46.39FREE delivery Mon, Sep 21 - AI Systems Performance Engineering: Optimizing Model Training and Inference Workloads with GPUs, CUDA, and PyTorch
Paperback$87.70$87.70FREE delivery Mon, Sep 21 - AI Engineering: Building Applications with Foundation Models#1 Best SellerEnterprise Applications
Paperback$52.40$52.40FREE delivery Sun, Sep 20 - Knowledge Graphs and LLMs in Action: Build AI systems using connected data
Paperback$55.99$55.99FREE delivery Mon, Sep 21 - Context Engineering for Multi-Agent Systems: Move beyond prompting to build a Context Engine, a transparent architecture of context and reasoning
Paperback$37.99$37.99FREE delivery Mon, Sep 21 - Agentic Architectural Patterns for Building Multi-Agent Systems: Proven design patterns and practices for GenAI, agents, RAG, LLMOps, and enterprise-scale AI systems
Paperback$44.99$44.99FREE delivery Sun, Sep 20 - 30 Agents Every AI Engineer Must Build: Build production-ready agent systems using proven architectures and patterns
Paperback$41.79$41.79FREE delivery Mon, Sep 21 - Hands-On Machine Learning with Scikit-Learn and PyTorch: Concepts, Tools, and Techniques to Build Intelligent Systems
Paperback$77.72$77.72FREE delivery Mon, Sep 21 - Prompt Engineering for Generative AI: Future-Proof Inputs for Reliable AI Outputs
Paperback$50.00$50.00FREE delivery Sun, Sep 20 - Building AI Agents with LLMs, RAG, and Knowledge Graphs: A practical guide to autonomous and modern AI agents
Paperback$41.99$41.99FREE delivery Mon, Sep 21 - Agentic Coding with Claude Code: The everyday developer's guide to agentic coding with Claude Code
Paperback$36.33$36.33FREE delivery Mon, Sep 21 - Architecting AI Software Systems: Crafting robust and scalable AI systems for modern software development
Paperback$33.99$33.99Delivery Mon, Sep 21 - AI Agents and Applications: With LangChain, LangGraph, and MCP
Paperback$51.69$51.69FREE delivery Mon, Sep 21 - Design Multi-Agent AI Systems Using MCP and A2A: Engineer your own Python-based agentic AI framework with tool use, memory, and multi-agent workflows
Paperback$41.79$41.79FREE delivery Mon, Sep 21 - AI Agents in Action: Build, orchestrate, and deploy autonomous multi-agent systems
Paperback$59.99$59.99 - Learning LangChain: Building AI and LLM Applications with LangChain and LangGraph
Paperback$55.01$55.01FREE delivery Sun, Sep 20 - Machine Learning Design Patterns: Solutions to Common Challenges in Data Preparation, Model Building, and MLOps
Paperback$36.99$36.99FREE delivery Sun, Sep 20 - Learn Model Context Protocol with Python: Build agentic systems in Python with the new standard for AI capabilities
Paperback$32.47$32.47Delivery Oct 7 - 14 - Building Agentic AI: Workflows, Fine-Tuning, Optimization, and Deployment (Pearson AI Signature Series)
Paperback$49.99$49.99FREE delivery Mon, Sep 21 - Hands-On Large Language Models: Language Understanding and Generation
Paperback$37.68$37.68FREE delivery Mon, Sep 21 - Generative AI with LangChain: Build production-ready LLM applications and advanced agents using Python, LangChain, and LangGraph
Paperback$41.99$41.99FREE delivery Mon, Sep 21 - LLMs in Production: From language models to successful products
Paperback$48.13$48.13FREE delivery Sun, Sep 20 - Build a Reasoning Model (From Scratch)#1 Best SellerProgramming Algorithms
Paperback$47.82$47.82FREE delivery Sun, Sep 20 - LLM Engineer's Handbook: Master the art of engineering large language models from concept to production
Paperback$39.99$39.99FREE delivery Mon, Sep 21 - Prompt Engineering for LLMs: The Art and Science of Building Large Language Model-Based Applications
Paperback$54.51$54.51FREE delivery Mon, Sep 21 - The AI Engineering Bible: The Complete and Up-to-Date Guide to Build, Deploy and Scale Production Ready AI Systems
Paperback$39.38$39.38FREE delivery Mon, Sep 21 - Building AI-Powered Products: The Essential Guide to AI and GenAI Product Management
Paperback$16.93$16.93Delivery Sun, Sep 20 - Designing AI Interfaces: Design Principles for Creative and Autonomous AI
Paperback$70.87$70.87FREE delivery Sun, Sep 20
From the brand
-
Machine Learning, AI & more
-
Machine Learning
-
Artificial Intelligence
-
Deep Learning
-
Language Processing (NLP, LLM)
-
Sharing the knowledge of experts
O'Reilly's mission is to change the world by sharing the knowledge of innovators. For over 40 years, we've inspired companies and individuals to do new things (and do them better) by providing the skills and understanding that are necessary for success.
Our customers are hungry to build the innovations that propel the world forward. And we help them do just that.
From the Publisher
From the Preface:
If you’re an AI engineer building generative AI (GenAI) applications, you’ve likely experienced the frustrating gap between the ease of creating impressive prototypes and the complexity of deploying them reliably in production. While foundational models make it easy to build compelling demos, production systems demand solutions to fundamental challenges: hallucinations that compromise accuracy, inconsistent outputs that break downstream processes, knowledge gaps that limit enterprise applicability, and reliability issues that make systems unsuitable for critical applications.
This book bridges that gap by providing 32 battle-tested design patterns that address the recurring problems you’ll encounter when building production-grade GenAI applications. These patterns aren’t theoretical constructs—they codify proven solutions that are often derived from cutting-edge research and refined by practitioners who have successfully deployed GenAI systems at scale.
This book bridges that gap by providing 32 battle-tested design patterns that address the recurring problems you’ll encounter when building production-grade GenAI applications. These patterns aren’t theoretical constructs—they codify proven solutions that are often derived from cutting-edge research and refined by practitioners who have successfully deployed GenAI systems at scale.
Supervised machine learning (ML) involves training a problem-specific model on a large training dataset of example inputs and outputs—but GenAI applications rarely include a training phase. Instead, they commonly use general-purpose foundational models. This book is focused on design patterns for AI applications that are built on top of foundational models, such as Open AI’s GPT, Anthropic’s Claude, Google’s Gemini, or Meta’s Llama.
Who Is This Book For?
This book is for software engineers, data scientists, and enterprise architects who are building applications powered by GenAI foundational models. It captures proven solutions you can employ to solve the common challenges that arise when building GenAI applications and agents. Read it to learn how experts in the field are handling challenges such as hallucinations, nondeterministic answers, knowledge cutoffs, and the need to customize a model for your industry or enterprise. The age-old problems of software engineering have new solutions in this realm. For example, ways to meet latency and constrain costs include distillation, speculative decoding, prompt caching, and template generation.
Understanding the different patterns in this book requires different levels of background knowledge. For example, Chain of Thought (Pattern 13) requires no more than a knowledge of basic programming, Tool Calling (Pattern 21) requires an understanding of API design, and Dependency Injection (Pattern 19) requires some experience developing large-scale software. However, Content Optimization (Pattern 5) requires familiarity with statistics and ML, and Small Language Model (Pattern 24) requires an understanding of hardware optimization. We expect that 75% of the book can be read and understood by a junior software engineer or a third-year computer science student. The remainder will require specialized knowledge or experience.
AI engineering overlaps heavily with software engineering, data engineering, and ML—but in this book, we’ve limited our focus to core AI engineering. We encourage you to think of this book as a companion to the literature on patterns in related areas. Specifically, the book Machine Learning Design Patterns (O’Reilly), also co-authored by Valliappa Lakshmanan, covers proven solutions to recurring issues you’ll encounter when training a bespoke machine-learning model for a specific problem.
You’ll also likely find yourself working with both bespoke ML models and general-purpose foundational models, depending on the use case. In some situations, you might start with a foundational model but then find that edge cases require you to customize (or fine-tune) it for your problem. This book and Machine Learning Design Patterns are complementary and will help you work with both models, so we recommend that you read both.
Generative AI Design Patterns
|
Machine Learning Design Patterns
|
Data Engineering Design Patterns
|
Cloud Application Architecture Patterns
|
Design Patterns for Cloud Native Applications
|
Learning JavaScript Design Patterns
|
|
|---|---|---|---|---|---|---|
| Customer Reviews |
4.6 out of 5 stars 26
|
4.6 out of 5 stars 417
|
4.0 out of 5 stars 20
|
4.4 out of 5 stars 34
|
4.2 out of 5 stars 52
|
4.1 out of 5 stars 48
|
| Design Patterns from O'Reilly Media | no data | no data | no data | no data | no data | no data |
Editorial Reviews
About the Author
Hannes Hapke is a Senior Machine Learning Engineer at Digits, and has co-authored multiple machine learning publications, including the book Building Machine Learning Pipelines and Machine Learning Production Systems by O'Reilly Media. He has also presented state-of-the-art ML work at conferences like ODSC or O’Reilly’s TensorFlow World and is an active contributor to TensorFlow's TFX Addons project. Hannes is passionate about machine learning engineering and production machine learning use cases using the latest machine learning developments.
Product details
- ASIN : B0FN37DV9N
- Publisher : O'Reilly Media
- Publication date : November 11, 2025
- Edition : 1st
- Language : English
- Print length : 506 pages
- ISBN-13 : 979-8341622661
- Item Weight : 1.92 pounds
- Dimensions : 7 x 1.02 x 9.19 inches
- Best Sellers Rank: #115,096 in Books (See Top 100 in Books)
- #22 in Software Design Tools
- #40 in Software Design & Engineering
- #72 in Generative AI (Books)
- Customer Reviews:
About the authors

Dr. Valliappa ("Lak") Lakshmanan is co-founder and CTO of Obin AI, a startup that's building deep domain AI agents for finance. He sets the technology and science direction of the company and is responsible for building the product.
Prior to this, Lak was an operating executive at an investment firm, the Director for Data Analytics and AI Solutions on Google Cloud and a Research Scientist at NOAA. He co-founded Google's Advanced Solutions Lab and is the author of several O'Reilly books and Coursera courses. He was elected a Fellow of the American Meteorological Society (the highest honor offered by the AMS) for his data science work.

As one of Digits's principal machine learning engineers since 2020, Hannes Hapke is fully immersed in developing innovative ways to use machine learning to boost productivity for accountants and business owners.
Before joining Digits, Hannes solved machine learning infrastructure problems in various industries, including healthcare, retail, recruiting, and renewable energies. He was previously a senior machine learning scientist at Concur Labs at SAP Concur, where he explored innovative ways to improve the experience of business travelers.
Hannes is an active contributor to TensorFlow's TFX Addons project and has co-authored multiple machine learning publications, including "Building Machine Learning Pipelines" and "Machine Learning Production Systems," both published by O'Reilly Media.
Hannes has been recognized as a Google Developer Expert for Machine Learning and continues to be passionate about machine learning engineering and production machine learning applications.










![Claude AI for Beginners Bible: [5 in 1] The Ultimate Guide to Automate Your Work, Save Hours Every Week, and Use AI for Real-World Results](https://m.media-amazon.com/images/I/415+fSJacsL._AC_SR100,100_QL65_.jpg)

