What you will learn in Building Reliable AI Systems
Applications and agents you can trust
Chapter by chapter
Chapter 1: AI reliability: Building LLMs for the real world
The introduction contrasts rapidly expanding LLM capabilities with their unreliable performance in production, then defines reliability and its three layers.
What you learn in chapter 1 →Chapter 2: Generating trustworthy responses with prompt engineering
The introduction explains how prompt engineering guides LLM outputs and why plausible hallucinations make reliable prompting important.
What you learn in chapter 2 →Chapter 3: Grounding outputs with RAG
This introduction explains why prompting and training alone cannot keep a chatbot current, and how RAG uses retrieved information to ground its answers.
What you learn in chapter 3 →Chapter 4: Embeddings and vector search
The introduction shows how embeddings enable RAG retrieval and why poor embedding quality can make an otherwise capable chatbot unreliable.
What you learn in chapter 4 →Chapter 5: Fine-tuning LLMs for improved performance
The introduction explains why specialized tasks may call for fine-tuning and defines it in contrast to prompting and RAG.
What you learn in chapter 5 →Chapter 6: Creating effective AI agents
The chapter introduction contrasts a standalone LLM’s ability to respond with an agent’s ability to interact with real-world systems, and notes a production risk that reliable agents must control.
What you learn in chapter 6 →Chapter 7: Tool integration and MCP
This introduction explains why connecting AI assistants to external systems becomes fragile at scale and presents MCP as a standardized alternative to one-off integrations.
What you learn in chapter 7 →Chapter 8: Multi-agent systems
The introduction explains why a customer request spanning images, products, and policies calls for coordinated specialist agents rather than isolated tools or one overloaded model.
What you learn in chapter 8 →Chapter 9: Evaluation and performance for LLMs and agents
The chapter introduction explains why increasingly capable LLM and agent systems need attention to both silent hallucinations and performance under production load.
What you learn in chapter 9 →Chapter 10: Deploying and monitoring
This introduction explains why an LLM that succeeds in testing can still fail in production and why evaluation must be backed by operational infrastructure.
What you learn in chapter 10 →Chapter 11: Bias, privacy, and responsible AI
The introduction shows how historical inequalities in training data can become amplified discrimination in production AI systems.
What you learn in chapter 11 →Concepts explained in this book
- retrieval-augmented generationA retrieval-augmented generation approach that retrieves and synthesizes stored information without taking actions in the real world.
- embeddingAn embedding is a numerical representation of content that captures semantic meaning in a form suitable for comparison.
- metadata filterSelecting or excluding records according to their associated descriptive attributes.
- semantic cachingA caching technique that reuses results for queries with similar meanings, rather than requiring exact textual matches.
- vectorizationA model that maps input content to numerical vectors that capture semantic properties.
- fine-tuningFine-tuning is the adaptation of a pretrained model by further training it, typically on task- or domain-specific data.
- AI agentA software system that interprets information, makes decisions, and takes actions to pursue goals.
- low-rank adaptationLow-Rank Adaptation is a parameter-efficient fine-tuning method that trains added low-rank matrices while keeping a pretrained model's weights frozen.
- QLoRAQuantized Low-Rank Adaptation combines low-rank fine-tuning with quantized model weights to reduce memory requirements.
- monitoringThe ongoing observation of a deployed AI system's behavior, performance, and quality.
- memoryA memory mechanism stores and retrieves information so an AI system can retain context across task steps or interactions.
- multimodel fallbackA model-routing strategy that sends simpler queries to a cheaper model and escalates harder or inadequately answered queries to a more capable model.
- vector databaseA vector database is a database designed to store and retrieve vector representations, often by similarity.
- batchingTemporarily grouping incoming application requests to manage concurrency and reduce processing overhead.
- biasBias is a systematic tendency in an AI system that produces unfairly skewed or discriminatory outcomes.
- hybrid searchA retrieval technique that combines multiple approaches to find relevant information.
- reliabilityThe ability of an AI system to behave dependably and maintain accurate, safe performance under its intended operating conditions.
- similarity searchA search technique that retrieves content based on meaning or semantic similarity rather than only exact keyword overlap.
- prompt engineeringThe deliberate design of instructions and context to guide a language model's behavior and outputs.
- hallucinationA hallucination is a model-generated output that presents fabricated or unsupported information as if it were true.
- temperatureTemperature is a language-model generation parameter that controls the randomness of token selection.
- evaluation datasetA collection of examples used to assess a model or system's behavior against defined criteria.
- multi-agent systemA system composed of multiple AI agents that coordinate to perform tasks.
- cachingStoring results so they can be reused instead of recomputed or retrieved again.
- GPTCacheGPTCache is a library that intercepts requests to GPT-based endpoints and caches exact or semantically similar queries.
- preprocessingThe cleaning and transformation of raw data before it is supplied to a machine-learning process.
- evaluatorAn evaluation technique in which a large language model assesses the quality of another model's output.
- ReActAn agent framework that interleaves reasoning, actions, and observations to guide task execution.
- training datasetTraining data is the data used to fit a machine-learning model's parameters.
- MCPA protocol for connecting AI applications and agents to external data sources and tools.
- routingThe technique of directing different queries or tasks to selected models according to their requirements or cost.
- prompt-completion paradigmA fine-tuning data pattern in which each example pairs an input prompt with an expected output completion.
- validation setA held-out subset of data used to assess a model during development without fitting its parameters on that subset.
- tool integrationThe process of connecting tools to an AI system so it can invoke them as part of its operation.
- two-pass routingA method that evaluates a task with one model, then escalates to another model if the first result is inadequate.
- Tree-of-thoughtA prompting method in which a language model explores and evaluates multiple reasoning paths before selecting a solution.
- PineconePinecone is a managed vector database service for storing and searching vector embeddings.
- approximate nearest neighbor algorithmA search method that efficiently finds vectors close to a query vector while allowing approximate rather than exact nearest neighbors.
- working memoryAn agent memory that temporarily retains information, typically for the duration of a single session.
- privacyThe protection of information about people from inappropriate collection, access, use, or disclosure.
- state managementState management is the handling and maintenance of an application's current state as it executes and responds to interactions.
- implicit feedbackImplicit feedback is evaluative information inferred from user behavior rather than directly supplied by users.
- NormalFloat4NF4 is a four-bit quantization data type with quantization bins distributed according to a normal distribution.
- grounding defect rateGrounding Defect Rate is a metric for quantifying the rate of unsupported claims in generated responses.
- token streamingThe incremental delivery of generated text as tokens become available, rather than waiting for a complete response.
- costThe monetary expense of using an API service, typically based on usage.
- exact string matchingA matching technique that considers two strings a match only when their text is identical.
- precisionRetrieval precision is the proportion of retrieved text chunks that are relevant to a query.
- dual-encoder architectureA retrieval architecture with separate encoders that independently represent queries and candidate items in a comparable embedding space.
- cross-encoderA cross-encoder is a model architecture that jointly processes a pair of inputs to produce a relevance or similarity score.
- groundingA technique for anchoring an AI system's outputs in external information or evidence.
- lexical searchA retrieval method that searches using sparse representations of content, such as term-based vectors.
- tool usageAn AI capability in which a model invokes external tools to obtain information or perform actions.
- chain-of-thought promptingChain-of-thought prompting is a prompting method that elicits explicit intermediate reasoning steps from a model.
- chunkingA method for dividing source material into segments for processing or retrieval.
- decision frameworkA structured approach that guides an AI agent in reasoning, selecting tools and actions, and sequencing tasks.
- metadataDescriptive information associated with documents or other data, such as titles, filenames, and keywords.
- distillationA training process that transfers the performance of a larger model to a smaller model.
- feedback loopA process that uses information about a system's outputs to guide its later behavior or improvement.
- RetrieverA retrieval component that finds relevant information from an external collection for use as model context.
- promptInput instructions or context supplied to an AI model to guide its response.
- evaluationThe systematic measurement of an AI system's behavior and quality against defined criteria.
- transparencyThe degree to which an AI system's behavior, decisions, and relevant processes can be understood or inspected.
- LLMOpsLLMOps is the engineering discipline of managing large language models in production, including their deployment, evaluation, and ongoing operation.
- context windowThe maximum amount of input content a model can process in a single input.
- message listAn ordered collection of messages that can retain a conversation's history.
- top-p filteringTop-p sampling is a language-model generation setting that samples from the smallest set of tokens whose cumulative probability reaches a specified threshold.
- fairnessThe property of an AI system treating people and groups equitably and avoiding unjustified disparities in outcomes.
- reliable agentAn AI agent that performs tool use and multi-step workflows while taking safe actions.
- gradient accumulationA technique that sums gradients across multiple mini-batches before updating model parameters.
- end-to-end testingTesting that evaluates a system by simulating a complete task from its initial input through its final outcome.
- BM25BM25 is a keyword-based ranking algorithm that scores documents according to query-term frequency while accounting for document length and term saturation.
- hybrid deploymentA hybrid deployment architecture combines multiple deployment approaches or environments within one system.
- semantic similarityA measure of how closely the meanings of two pieces of content correspond.
- buffer memoryA conversation-memory pattern that retains the complete history of messages rather than compressing it.
- summary memoryA conversation-memory pattern that maintains a compressed summary of the conversation instead of its complete message history.
- content-aware chunkingA chunking method that uses content structure or meaning to create segments, potentially with shared content between adjacent segments.
- HNSWHierarchical Navigable Small World is an approximate nearest-neighbor search algorithm that organizes vectors in a multilayer graph.
- parameter-efficient fine-tuningFine-tuning methods that adapt a small subset or representation of a model’s parameters to reduce training resource requirements.
- versioningA technique for associating entries with versions so entries from an outdated version can be invalidated.
- action executionThe capability of carrying out tasks by interacting with external systems rather than merely describing possible solutions.
- observability systemA software platform that collects and presents information about system behavior to support analysis and troubleshooting.
- N×M integration problemThe N×M integration challenge is the scaling problem in which integrating N AI applications with M external systems requires a separate custom integration for each pairing.
- chunk granularityThe size of a text segment produced when source content is divided for processing or retrieval.
- adversarial test setA collection of challenging or ambiguous inquiries designed to expose likely model errors such as hallucinations.
- dense vectorA numerical vector in which most or all dimensions have nonzero values.
- grounding datasetA collection of authoritative information or evidence used to support or verify system responses.
- vector spaceA mathematical space whose elements are vectors and in which vector operations are defined.
- multi-stage retrievalA retrieval technique that finds and ranks results through a sequence of specialized filtering and ranking stages.
- specialized agentA specialized agent is an AI agent configured to perform a focused class of tasks within a broader coordinated system.
- generatorA model component that produces a response from a query and supplied context.
- semantic relevance filteringA retrieval technique that filters information according to semantic similarity to a query or other reference.
- data annotationThe process of adding human-provided labels, rankings, or other judgments to data.
- overfittingA model-training outcome in which a model fits training examples too closely and generalizes poorly to new data.
- information retrievalRetrieval is the process of finding relevant information from an external collection to supply as model context.
- degradationA decline in the quality of a system's outputs compared with an earlier or expected level.
- agentic RAGA retrieval-augmented generation approach in which an AI agent controls the retrieval process, including deciding when multiple retrievals are needed.
- human-in-the-loopHuman supervision of an AI system's outputs, decisions, and operation.
- MCP serverAn MCP server is a server component that implements the Model Context Protocol and exposes tools or data capabilities to compatible AI applications.
- consistencyThe degree to which a language model produces stable and coherent outputs across responses.
- open-source modelA model whose weights are made available under terms that permit users to obtain and run it, and potentially modify or adapt it.
- shadow testingShadow testing evaluates a system or change alongside a live system without allowing the test results to affect user-facing behavior.
- checkpointingThe practice of saving execution state so a process can be paused and later resumed.
- LangGraphLangGraph is a library for building stateful, graph-based applications with language models and agents.
- managed APIA hosted API is an application programming interface provided by an external service whose infrastructure runs the underlying model or software.
- cosine similarityCosine similarity is a measure of the angular similarity between two vectors, calculated from the cosine of the angle between them.
- stress testStress testing evaluates a system under unusually high loads or demanding conditions to identify weaknesses and failure modes.
- booking conversion rateThe proportion of relevant user visits or interactions that result in a booking.
- cold start problemThe difficulty of producing useful recommendations or representations for new items that lack interaction history.
- de-biasing techniqueA method for reducing systematic distortions in data or model behavior so learned patterns better reflect the underlying signal.
- position biasA distortion in interaction data caused by users being more likely to engage with results because of their displayed position.
- branchConditional routing is the technique of directing execution to different agents or workflow paths according to the current request or state.
- language modelA model that represents patterns in language to predict or generate sequences of text.
- quantizationQuantization reduces the numerical precision used to represent model values, often lowering storage or computation requirements.
- FActScoreFActScore is a metric that evaluates the factual accuracy of generated text by decomposing it into atomic facts and checking each fact.
- customer satisfactionThe degree to which users are satisfied with a system or its outcomes.
- model selectionThe process of choosing an AI model for a particular application or task.
- red-teamingThe practice of deliberately probing a system for weaknesses, unsafe behavior, or failure modes.
- rerankingReranking is the reordering of retrieved results using a further relevance-scoring step.
- relevanceA measure of how directly an answer addresses the question or task posed.
- embedding driftA gradual divergence between user queries and the vector representations of documents in an index, caused by changes in how people ask questions or in language and terminology.
- product quantizationProduct quantization compresses vectors by dividing them into subvectors and representing them with entries from learned codebooks.
- summarizationThe process of condensing information into a shorter representation that preserves important content.
- user input leakageA user-input leak is the exposure of sensitive information supplied by a user to an AI system.
- vector compressionA technique for reducing the memory footprint of high-dimensional embeddings while preserving most of their semantic properties.
- rule-based systemA system that makes decisions by applying predefined logic or rules to inputs.
- dialogueA record of the messages exchanged during a conversation.
- agent harnessA harness is orchestration infrastructure that manages an AI agent's loop, state, tools, approvals, tracing, and output channels.
- student modelA model trained to imitate a teacher model, often with the aim of being smaller or more efficient.
- teacher modelA larger, more capable model whose behavior or outputs serve as the target for a smaller model to learn.
- personal dataInformation relating to an identified or identifiable person.
- PII detectionThe process of identifying information in data or outputs that can identify a specific person.
- agent orchestrationThe coordination and sequencing of multiple task steps to accomplish a larger objective.
- HIPAAThe Health Insurance Portability and Accountability Act is a United States federal law that includes requirements for protecting health information.
- retrieved documentInformation selected from an external knowledge source and supplied to a model as response context.
- LangChainLangChain is an open-source software framework for building applications that coordinate language models with prompts, data sources, tools, and retrieval workflows.
- guardrailA constraint that defines behavior a model should or should not exhibit.
- responsible AIPractices that address the safety, fairness, accountability, transparency, and societal impact of AI systems.
- output formatAn output organized according to a predefined schema so that both people and software can interpret its contents consistently.
- zero-shot promptingZero-shot prompting is instructing a model to perform a task without providing task-specific examples in the prompt.
- testTesting is the systematic execution of queries or other inputs to assess a software system's behavior and identify defects.
- text chunkA segment of text produced by dividing a larger document for processing or retrieval.
- list_toolsAn MCP server endpoint that returns machine-readable descriptions of its available tools and their inputs.
- CrewAICrewAI is a framework for building multi-agent systems with role-based agent definitions.
- HaystackHaystack is an open-source framework for constructing modular search and language-model pipelines.
- continuous improvementAn ongoing process of using system information to make iterative changes that improve performance or quality.
- right to erasureA data-protection right allowing a person to request deletion of their personal data under applicable conditions.
- deploymentThe release of software or a software change into an environment where it can operate.
- RagasRAGAS is an open-source framework for evaluating retrieval-augmented generation systems.
- multi-step reasoningReasoning that reaches a conclusion through multiple connected inferential steps.
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.
