liveBook · Manning

Prompt engineering

Prompt engineering is the deliberate design and refinement of inputs, instructions, and context to guide an AI model’s behavior or outputs.

How 38 Manning books explain it

Introduction to Generative AI, Second Edition

Prompt engineering is the deliberate design of inputs to guide a generative model's behavior or output.

How it is used
Guides generative model behavior toward specific tasks and contexts through carefully designed inputs.
How deep it goes
Explains prompt design as an iterative process of drafting, testing, evaluating, and revising, with techniques for structuring complex tasks.
Examples
Uses a cybersecurity executive summary, a noir-style moon-landing account, and a chatbot that gives overly long answers.
What you can do after
Practice designing and revising prompts, then compare their responses across representative sample contexts.

Read how Introduction to Generative AI, Second Edition explains prompt engineering →

Coding with AI

Prompt engineering is the systematic design and refinement of instructions and context provided to an AI system to elicit desired outputs.

How it is used
Guides AI coding assistants toward clearer code, documents, designs, requirements, and tests.
How deep it goes
Explains prompt components, types, refinement, decomposition, and iterative evaluation without guaranteeing model correctness.
Examples
Demonstrates HAM radio quiz design, email validation, discount calculation, HTTP requests, and iterative multiplication prompts.
What you can do after
Apply it via AI coding tools to specify outputs, refine responses, and review generated work critically.

Read how Coding with AI explains prompt engineering →

LLMs in Production

Prompt engineering is the practice of designing and refining input instructions to influence an AI model's behavior and output.

How it is used
Guides general-purpose models toward consistent application behavior without retraining for every task.
How deep it goes
Explains prompt design and production trade-offs, then demonstrates optimization with a worked DSPy example.
Examples
Uses a coding copilot with mismatched instruction examples and a DSPy grade-school math task.
What you can do after
Apply prompt design and DSPy optimization to guide model outputs and evaluate task performance.

Read how LLMs in Production explains prompt engineering →

AI for Everyday IT

Prompt engineering is the deliberate design and refinement of instructions supplied to an AI system to improve the quality or relevance of its responses.

How it is used
Improves AI interactions by shaping requests for practical content creation, learning, analysis, and problem-solving.
How deep it goes
Explains construction principles, prompting modes, advanced techniques, iteration, and limitations without covering model internals.
Examples
Uses database comparisons, IT-ticket classification, ESL tutoring, project-management advice, and Oracle-to-SQL Server conversion prompts.
What you can do after
Apply it via AI chatbots to create clearer requests, iterate on responses, and produce more actionable work outputs.

Read how AI for Everyday IT explains prompt engineering →

Generative AI in Action

Prompt engineering is the deliberate design and refinement of inputs provided to generative models to elicit desired outputs.

How it is used
Steers generative models toward task-specific outputs and provides a starting point for enterprise model adaptation.
How deep it goes
Explains prompt components, iterative refinement, operational practices, and risks through practical guidance and examples.
Examples
Uses sales-report prompt refinement, Celsius-to-Fahrenheit examples, and text and image generation to illustrate steering.
What you can do after
Apply prompt engineering by specifying tasks and constraints, evaluating outputs, and iterating on instructions and examples.

Read how Generative AI in Action explains prompt engineering →

Knowledge Graphs and LLMs in Action

Prompt engineering is the deliberate design and iterative refinement of instructions and examples given to a language model to obtain desired outputs.

How it is used
Deploys natural-language instructions and examples to extract domain-specific entities and relations for knowledge graphs.
How deep it goes
Explains iterative design, class naming, examples, configuration, and failure modes, but defers model internals and detailed fine-tuning.
Examples
Demonstrates diary-entry extraction, abbreviated names and titles, normalized relations, OpenAI API calls, and chain-of-thought prompting.
What you can do after
Build it from scratch by iterating prompts, selecting examples and parameters, and evaluating structured LLM outputs for a domain task.

Read how Knowledge Graphs and LLMs in Action explains prompt engineering →

Natural Language Processing in Action, Second Edition

Prompt engineering is the deliberate design and revision of prompts to influence a language model's behavior and outputs.

How it is used
Shapes chatbot behavior through iterative instructions while accommodating differences among language models.
How deep it goes
Works through prompt revision and tests for a tutor’s onboarding, while cautioning that explicit directives do not ensure compliance.
Examples
Uses a math tutor’s parent-permission dialogue and a number-sequence quiz to expose successes and failures.
What you can do after
Apply it via LangChain by revising a conversation template and inspecting generated turns.

Read how Natural Language Processing in Action, Second Edition explains prompt engineering →

The Art of AI Product Development

Prompt engineering is the deliberate design and refinement of instructions provided to a generative model to elicit desired outputs.

How it is used
Steers language-model behavior for application-specific tasks and enables rapid prototyping without changing model weights.
How deep it goes
Provides technique-selection guidance and an iterative process for testing, collaboration, reusable components, and version control.
Examples
Uses marketing blog tone instructions to illustrate how prompt changes affect client-facing content.
What you can do after
Apply prompt engineering through iterative testing, reusable templates, and version control to improve application-specific outputs.

Read how The Art of AI Product Development explains prompt engineering →

Building LLM Applications with DSPy

The practice of manually iterating on and rephrasing prompts to improve language-model responses.

How it is used
Frames manual prompt iteration as a reliability and maintenance challenge for language-model applications and a contrast with prompt programming.
How deep it goes
Explains prompt-component edits, heuristics, evaluation pitfalls, and trade-offs, then contrasts them with automated optimization.
Examples
Uses a customer-intent classification prompt with class labels, a JSON response format, and a labeled demonstration.
What you can do after
Evaluate and understand prompt changes, their testing risks, and when automated optimization may reduce manual work.

Read how Building LLM Applications with DSPy explains prompt engineering →

Software Testing with Generative AI

Prompt engineering is the deliberate design of inputs, instructions, constraints, and examples to influence a large language model toward a desired output.

How it is used
Applies deliberate prompt patterns to testing, development feedback, test-case creation, and synthetic-data generation.
How deep it goes
Explains prompt construction through constraints, delimiters, examples, decomposition, and evaluation, while stopping short of eliminating model errors.
Examples
Demonstrates Contact Us risk prompts, authorization API test cases, simulated rubber-duck feedback, and delimited room-data schemas.
What you can do after
Apply prompt tactics to formulate specific testing tasks and obtain more structured, context-relevant LLM assistance for human review.

Read how Software Testing with Generative AI explains prompt engineering →

Grokking AI Applications

Prompt engineering is the systematic design and refinement of prompts to influence a generative model's outputs.

How it is used
Shapes LLM responses to match an application's tone, style, objectives, and user needs.
How deep it goes
Explains prompt clarity, length trade-offs, and refinement techniques without descending into model internals.
Examples
Uses a business-plan request, a “not found” fallback, repeated instructions, and self-validation prompts.
What you can do after
Apply it by balancing context and concision, decomposing tasks, adding fallbacks, and requesting self-validation.

Read how Grokking AI Applications explains prompt engineering →

Starting Data Analytics with Generative AI and Python

Prompt engineering is the deliberate design and refinement of instructions supplied to a generative AI system.

How it is used
Uses prompt tailoring and iterative dialogue to steer generative AI throughout data analysis.
How deep it goes
Explains practical prompt adjustments and follow-up questions, while distinguishing a more advanced scientific approach without developing it.
Examples
Uses sarcasm in sentiment analysis, genetic drift rephrasing, and Portuguese tokenization to illustrate prompt adjustments.
What you can do after
Apply it through iterative dialogue to specify context and audience, request revisions, and question particular aspects of an answer.

Read how Starting Data Analytics with Generative AI and Python explains prompt engineering →

Machine Learning Platform Engineering

Prompt engineering is the deliberate design and refinement of inputs provided to generative models to influence their outputs.

How it is used
Guides documentation-assistant responses and query routing by shaping instructions, examples, and retrieved context.
How deep it goes
Explains versioned prompt management and token-saving revisions, but does not specify a complete prompt-testing implementation.
Examples
Compares verbose and concise documentation prompts and uses a minimal complexity-classification prompt for model routing.
What you can do after
Apply it via Langfuse to version and compare prompts, then refine token use without sacrificing quality.

Read how Machine Learning Platform Engineering explains prompt engineering →

Prompt Engineering in Practice

The deliberate construction of a prompt's instructions, context, constraints, and output requirements.

How it is used
Makes language-model prompts reliable, reviewable interfaces for software products, workflows, and shared prompt libraries.
How deep it goes
Defines the practice and lays out composition, testing, iteration, and management; stops short of changing model weights.
Examples
Uses a pull-request summary, an API migration notice, and revisions of architecture-diagram and ADR-summary prompts.
What you can do after
Build it from scratch as a testable prompt contract, then refine failures and maintain its change history.

Read how Prompt Engineering in Practice explains prompt engineering →

AI Agents and Applications

Prompt design is the practice of formulating instructions and context to influence a language model's behavior and output.

How it is used
Guides language-model behavior across chatbots, research workflows, and multi-agent routing.
How deep it goes
Explains templates and few-shot prompting, then outlines task-specific prompt stages and iteration for reliability.
Examples
Uses interactive summarization, web research reports, and customer-service agent routing as applications.
What you can do after
Apply it via ChatGPT and LangChain to create and refine task-specific prompts.

Read how AI Agents and Applications explains prompt engineering →

AI Agents in Action

Prompt engineering is the deliberate design and refinement of inputs to a language model to obtain desired and consistent outputs.

How it is used
Improves direct LLM interactions and helps shape agent profiles for tasks.
How deep it goes
Works through clear instructions and systematic evaluation, then introduces reasoning techniques including self-consistency and tree of thought.
Examples
Uses movie recommendations and time-travel problems to illustrate prompt refinement and reasoning.
What you can do after
Apply it via Microsoft prompt flow to compare prompt variants using rubric scores.

Read how AI Agents in Action explains prompt engineering →

Effective Data Analysis

Prompt engineering is the practice of designing and refining instructions supplied to generative models to obtain desired outputs.

How it is used
Supports analytics, software integration, internal efficiency, and stakeholder-facing use of generative AI.
How deep it goes
Explains iterative prompt design, model review, output constraints, and evaluation, but does not detail model internals or fine-tuning.
Examples
Uses customer-login statistics, support-text summaries, rat-sighting analysis, predictive models, Python code, and agency recommendations.
What you can do after
Apply prompt refinement to request analyses, code, metrics, models, and constrained stakeholder recommendations from chatbots.

Read how Effective Data Analysis explains prompt engineering →

Deep Learning with JAX

The practice of shaping input prompts to get better outputs from a pretrained language model without changing its weights.

How it is used
Uses structured input text to steer pretrained language models toward desired task outputs.
How deep it goes
Defines prompt structuring and names chain of thought, but defers detailed techniques and implementation.
Examples
Uses a GPT-J prompt that requests SQL from natural language enclosed in triple backticks.
What you can do after
Evaluate generated outputs for formatting, multiplicity, repetition, and syntax errors before using them.

Read how Deep Learning with JAX explains prompt engineering →

How Large Language Models Work

Prompt engineering is the practice of designing and modifying input text to influence a language model's behavior or output.

How it is used
Constrains an instruction-following LLM to a task, goal, detail level, or tone through carefully designed input text.
How deep it goes
Defines prompts, demonstrates modifications, and explains brittleness, while stopping short of a procedural optimization method.
Examples
Uses car-selling bots, CSV formatting, survey-theme summarization, and question rewriting for search.
What you can do after
Apply explicit prompts to repetitive, fuzzy tasks while testing results rather than treating fluent output as guaranteed accuracy.

Read how How Large Language Models Work explains prompt engineering →

Financial AI in Practice

Prompt engineering is the deliberate design and refinement of instructions supplied to generative models to elicit desired outputs.

How it is used
Guides LLMs to turn retrieved financial information into a premium digest or structured, auditable news signals.
How deep it goes
Works through role, evidence boundaries, two-stage context, JSON fields, and response validation; leaves production retrieval beyond the digest snippet.
Examples
Uses a personalized investment-post digest, a two-stage uranium-news analyst prompt, and a fraud-guidelines query.
What you can do after
Apply it via the OpenAI Responses API to produce validated, structured signals from supplied news context.

Read how Financial AI in Practice explains prompt engineering →

AI-Powered Search

Prompt engineering is the deliberate design and manipulation of model inputs to influence the behavior or output of a language model.

How it is used
Guides language models toward task-specific search outputs by injecting context into each inference request.
How deep it goes
Explains context steering and DSPy-based optimization, then stops short of model-weight training internals.
Examples
Uses unicorn queries, role-and-expertise context, DSPy signatures, evaluation metrics, and tracked prompt responses.
What you can do after
Evaluate and optimize prompts using task signatures, response metrics, tracked outputs, and automated prompt-variation testing.

Read how AI-Powered Search explains prompt engineering →

Effective Conversational AI

Prompt engineering is the design of instructions, context, examples, and input data supplied to a language model to influence its output.

How it is used
Guides language-model outputs for conversational answers and generates candidate utterance variants for chatbot coverage.
How deep it goes
Defines prompt components and works through iterative synonym requests, without detailing model internals.
Examples
Contrasts generic and customer-contextualized prompts for synonyms of “password” and “forgot.”
What you can do after
Practice/perform iterative prompt revision and test changes against logged user requests and updated test sets.

Read how Effective Conversational AI explains prompt engineering →

The AI Pocket Book

The practice of designing prompts to steer a language model toward better or more reliable outputs.

How it is used
Improves off-the-shelf generative AI outputs, including hallucination mitigation, task customization, and output disambiguation.
How deep it goes
Demonstrates few-shot and chain-of-thought prompting, then compares prompting with fine-tuning without detailing model internals.
Examples
Uses arithmetic word problems, world-record tables, RAG context, and Midjourney image references as concrete examples.
What you can do after
Apply prompting through demonstrations, reasoning examples, retrieved context, and reference images before attempting fine-tuning.

Read how The AI Pocket Book explains prompt engineering →

Deep Learning with R, Third Edition

Prompt engineering is the systematic design and refinement of inputs to a generative model to improve its performance on a task.

How it is used
Improves language-model performance by shaping prompts for particular outputs, roles, constraints, or reasoning tasks.
How deep it goes
Explains prompt construction through continuations, role instructions, constraints, and phrasing sensitivity, but does not provide a formal optimization procedure.
Examples
Uses brownie recipes, role instructions, harmful-topic constraints, reasoning riddles, and an invented-president question to demonstrate prompt effects.
What you can do after
Apply prompt engineering by constructing contextual openings, role instructions, constraints, and wording variations for language-model tasks.

Read how Deep Learning with R, Third Edition explains prompt engineering →

AI-Powered Developer: Build software with ChatGPT and Copilot

Prompt engineering is the deliberate design and iterative refinement of instructions given to an AI model to influence its outputs.

How it is used
Guides LLMs toward targeted code, designs, and explanations by improving task instructions over successive interactions.
How deep it goes
Defines refinement and persona patterns, then demonstrates them through linked-list, system-design, and code-generation prompts.
Examples
Uses singly linked lists, an IT asset management system, and depreciation strategies to demonstrate prompt refinement.
What you can do after
Apply it via ChatGPT or GitHub Copilot to specify requirements, refine generated code, and check outputs against intended rules.

Read how AI-Powered Developer: Build software with ChatGPT and Copilot explains prompt engineering →

Building Reliable AI Systems

The deliberate design of instructions and context to guide a language model's behavior and outputs.

How it is used
Guides language-model behavior and reduces hallucination risk, from initial prompt design through production quality control.
How deep it goes
Describes iterative refinement, prompting techniques, testing, and production feedback, while deferring external knowledge integration to retrieval-augmented generation.
Examples
Uses an e-commerce support chatbot, a legal-document assistant, and a Python prompt-version listing.
What you can do after
Apply prompt engineering by refining instructions, testing real queries against a quality bar, and using feedback to guide revisions.

Read how Building Reliable AI Systems explains prompt engineering →

The Complete Obsolete Guide to Generative AI

Prompt engineering is the deliberate design and refinement of instructions and context supplied to a generative model to influence the quality of its output.

How it is used
Guides language-model responses toward task-specific formats, context, constraints, and desired results.
How deep it goes
Explains practical prompt strategies and iterative refinement, without descending into language-model internals.
Examples
Uses investment-counselor roles, CSV output, Python loop questions, error messages, car descriptions, and 4K video conversion.
What you can do after
Apply it via ChatGPT to ask focused questions, refine weak responses, and troubleshoot generated code.

Read how The Complete Obsolete Guide to Generative AI explains prompt engineering →

Build AI-Enhanced Web Apps

Prompt engineering is the design and refinement of instructions and contextual information supplied to an AI model to guide its outputs.

How it is used
Optimizes AI-generated outputs and user interactions by tailoring instructions and context to web-application requirements.
How deep it goes
Explains strategies, prompt types, structured-output techniques, token limits, and versioning, but does not descend into model internals.
Examples
Uses structured JSON generation, few-shot task adaptation, semantic search, content recommendations, and interview feedback.
What you can do after
Apply it to improve accuracy, contextual relevance, structured output reliability, and user experience in AI-powered web applications.

Read how Build AI-Enhanced Web Apps explains prompt engineering →

Data Analysis with LLMs

Prompt engineering is the systematic design and search of prompts or prompt templates to guide a language model toward better task results.

How it is used
Guides language models toward better task results through deliberate prompt and prompt-template design.
How deep it goes
Explains task specification, contextual prompting, template experimentation, and few-shot examples without detailing model internals.
Examples
Uses sentiment classification, labeled reviews, constrained positive-or-negative answers, and alternative prompt templates.
What you can do after
Build it from scratch by designing and testing prompt templates for familiar or novel language-model tasks.

Read how Data Analysis with LLMs explains prompt engineering →

AI Agents in Action, Second Edition

Prompt engineering is the deliberate design and refinement of instructions and contextual input to elicit desired behavior from a language model.

How it is used
Shapes agent personas, reasoning, workflows, tool use, and response constraints for predictable task completion.
How deep it goes
Moves from instruction principles to complete workflows, examples, constraints, typed outputs, and tracing, while deferring deep model internals.
Examples
Uses a search-agent workflow, source-selection examples, typed research plans, strict length limits, tool calls, repeated runs, and trace inspection.
What you can do after
Apply it via the OpenAI Agents SDK to refine prompts, enforce structured results, add tools, and inspect execution traces.

Read how AI Agents in Action, Second Edition explains prompt engineering →

Learn AI-Assisted Python Programming, Second Edition

The practice of designing and refining instructions for an AI system to improve the relevance and correctness of its outputs.

How it is used
Improves AI-assisted programming by shaping requests, correcting generated code, and eliciting useful explanations.
How deep it goes
Explains precision, testing, and prompt revision procedurally, while deferring detailed prompt patterns beyond function requests and explanation requests.
Examples
Uses function headers, docstrings, rewritten function prompts, /explain, and line-by-line explanation requests.
What you can do after
Diagnose/debug with it by testing Copilot output, identifying errors, and revising prompts to seek better code or explanations.

Read how Learn AI-Assisted Python Programming, Second Edition explains prompt engineering →

Transformers in Action

Prompting is the practice of providing input instructions or context to a generative model to elicit a desired output.

How it is used
Guides model behavior by formulating tasks and supplying context for generation.
How deep it goes
Defines prompting variants and works through few-shot classification and the steps of thread-of-thought prompting.
Examples
Uses sentiment classification and large or chaotic context analysis to illustrate prompting approaches.
What you can do after
Practice constructing prompts with examples or stepwise context analysis to guide task responses.

Read how Transformers in Action explains prompt engineering →

Deep Learning with Python, Third Edition

The practice of crafting prompts to elicit better performance from a large language model on a task.

How it is used
Improves large language model performance by formulating prompts for particular tasks.
How deep it goes
Defines phrasing sensitivity, gives a riddle and instruction example, and stops short of a systematic prompt-design procedure.
Examples
Uses the Alice riddle, altered variable values, step-by-step instructions, and Python list sorting with a requested style.
What you can do after
Apply it via deliberate prompt variation and explicit instructions to improve task performance and test reliability.

Read how Deep Learning with Python, Third Edition explains prompt engineering →

Build an AI Agent (From Scratch)

Prompt engineering is the practice of designing prompts and instructions to elicit accurate or appropriately formatted outputs from a language model.

How it is used
Guides a general-purpose language model to act consistently as an agent across user requests.
How deep it goes
Defines user and system prompts and gives actionable guidelines for autonomy, clarification, and tool use.
Examples
Uses a weather-search request and sample instructions for acting on clear intent to illustrate agent behavior.
What you can do after
Operate/configure an agent by specifying when to act, clarify intent, and use tools proactively.

Read how Build an AI Agent (From Scratch) explains prompt engineering →

Build Financial Software with Generative AI (From Scratch)

Prompt engineering is the practice of designing clear, specific inputs that guide a language model toward useful responses.

How it is used
Guides requests to generative AI when developing and refining software requirements.
How deep it goes
Defines core prompt qualities and demonstrates iterative code refinement, but does not detail individual prompting techniques.
Examples
Uses ChatGPT-generated Python for reading, formatting, and returning a financial balance.
What you can do after
Apply it via ChatGPT to express software requirements and iteratively improve generated code.

Read how Build Financial Software with Generative AI (From Scratch) explains prompt engineering →

Investing for Programmers

Prompt engineering is the practice of designing and refining instructions and contextual inputs to obtain more useful outputs from an AI system.

How it is used
Improves LLM queries for financial research, especially due diligence and company scorecards.
How deep it goes
Defines specificity, context, examples, and investor profiles but stops short of a formal optimization workflow.
Examples
Uses investor profiles, company-management questions, and detailed investment inquiries instead of generic stock recommendations.
What you can do after
Apply it via detailed prompts that include goals, risk tolerance, tax residency, context, and reference examples.

Read how Investing for Programmers explains prompt engineering →

WordPress Power Toolkit: Harness AI to build next-level websites

Prompt engineering is the practice of designing and refining instructions supplied to an AI system to influence its behavior and outputs.

How it is used
Improves AI requests for website planning, WordPress resource discovery, writing revision, and other multi-step tasks.
How deep it goes
Demonstrates combined techniques through complete prompts and iterative refinement, but notes that systems may not follow pause-and-wait instructions.
Examples
Uses Instant Pot website planning, WordPress resource selection, Claude prompt generation, and prose revision in a simple, clear style.
What you can do after
Apply it via Claude’s Generate a Prompt feature, then edit and test expanded instructions for a specific task.

Read how WordPress Power Toolkit: Harness AI to build next-level websites explains prompt engineering →

Optimization Algorithms: AI techniques for design, planning, and control problems

An optimization approach that describes an optimization task in natural language and prompts a large language model to generate improved solutions or instructions.

How it is used
Uses natural-language descriptions of optimization tasks to enlist large language models as optimizers.
How deep it goes
Defines OPRO as simple and effective but does not provide implementation steps, parameters, or algorithmic internals.
Examples
Names maximum coverage, MaxCut, minimum vertex cover, SAT, TSP, and vehicle routing as application problems.
What you can do after
Evaluate natural-language optimization as an emerging machine-learning approach across benchmark optimization problems.

Read how Optimization Algorithms: AI techniques for design, planning, and control problems explains prompt engineering →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.