What you will learn in Context Engineering
Build consistent, accurate, predictable AI systems
Chapter by chapter
Chapter 1: Introduction to context engineering
The chapter introduction defines context engineering as supplying an LLM with the information needed for a task while respecting its context-window limit.
What you learn in chapter 1 →Chapter 2: Instructions for AI agents
Introduces instructions as the context source that sets rules and behavioral expectations for LLM-based systems.
What you learn in chapter 2 →Chapter 3: External knowledge and retrieval
This introduction explains why LLM-based systems use external knowledge and distinguishes retrieval, caching, and direct injection as ways to supply it.
What you learn in chapter 3 →Chapter 4: Tools in AI agents
Introduces tools as a way for AI agents to act on external systems and explains how tool use dynamically changes the context window.
What you learn in chapter 4 →Chapter 5: Memory and state in agentic systems
The introduction identifies memory and state as context sources an LLM-based system maintains across turns, distinguishing retained information from current status.
What you learn in chapter 5 →Chapter 6: User prompts for LLMs
Introduces user prompts as the context source that expresses a user’s immediate intent and guides the model toward a specific outcome.
What you learn in chapter 6 →Chapter 7: Context management and orchestration
The introduction distinguishes the six sources of context from the two layers that handle context during execution: management for a single model call and orchestration across a multi-step execution.
What you learn in chapter 7 →Chapter 8: Evaluation and observability
The introduction positions evaluation and observability as assurance disciplines that help diagnose context problems and assess whether LLM-based systems behave as intended.
What you learn in chapter 8 →Chapter 9: Governance and operations
Introduces governance and operations as the assurance disciplines that help context-aware AI systems run reliably and responsibly in production.
What you learn in chapter 9 →Chapter 10: AI frameworks for context engineering
The introduction explains why framework choice matters for context engineering: frameworks package capabilities that teams rarely build entirely from scratch, while affecting visibility and control over the context lifecycle.
What you learn in chapter 10 →Chapter 11: Context engineering for software development
Introduces software development as a domain where dependable AI assistance depends on context flowing across the development lifecycle, not just stronger models.
What you learn in chapter 11 →Chapter 12: The state of the art in context engineering
This chapter introduction previews a synthesis of context engineering’s mathematical foundations, research challenges, technical frontiers, applications, and future directions.
What you learn in chapter 12 →Concepts explained in this book
- context engineeringContext engineering is the discipline of selecting, organizing, and updating information supplied to a model in an appropriate form and at an appropriate time.
- agent orchestrationAgentic orchestration coordinates an agent's actions, tools, and execution steps toward a task.
- MCP serverAn MCP server is a software component that exposes capabilities or information to AI applications through the Model Context Protocol.
- compactionA process that summarizes an agent conversation and discards lengthy details while preserving high-level task information.
- memoryInformation retained across interactions or steps so an AI system can use it later.
- evaluationEvaluation is the structured testing and measurement of an AI system's behavior and performance.
- agent skillA reusable set of instructions and resources that extends an agent's capabilities for a specialized workflow.
- context assemblyContext selection is the choice of which information enters an AI system's active context.
- context managementContext management is the shaping of context through selecting, writing, compressing, and isolating information before model consumption.
- AI governanceGovernance comprises the structures, processes, policies, and controls that direct how AI systems are developed and operated.
- toolA tool is a callable capability outside a language model that an AI system can use to obtain information or perform an operation.
- stateInformation representing a system's current situation or progress.
- context windowA context window is the bounded amount of token context a language model can process for an inference request.
- LLM-as-a-judgeAn evaluator is a component that assesses outcomes against specified criteria or metrics.
- working contextModel context is the information available to a model during inference that influences its output.
- agentic RAGAgentic retrieval-augmented generation uses an AI agent to plan, perform, and evaluate retrieval while producing an answer.
- A2AA2A is an open protocol standard for interoperability and context exchange between independent agentic applications.
- LLMOpsOperational practices for developing, deploying, monitoring, and maintaining systems based on large language models.
- observabilityObservability is the ability to understand a system's internal behavior through signals such as logs, traces, and metrics.
- promptA prompt is an input supplied to a language model to elicit a response or guide its behavior.
- AI frameworkA software framework that provides reusable components and abstractions for building AI-powered applications.
- AI agentAn AI agent is a system that pursues goals by interpreting tasks, planning actions, using resources, and adapting its behavior with limited human intervention.
- prompt injectionPrompt injection is an attack that attempts to manipulate an AI system by introducing instructions into its input or context.
- taskAn A2A task is a stateful unit of work with an explicit lifecycle that can support long-running operations and multi-turn collaboration.
- evaluation-driven developmentA software engineering paradigm that makes evaluations the proactive driver of development.
- context writingContext writing is the technique of moving information out of an active prompt into storage while retaining a reference to relevant stored information.
- context sourceA context source is a source of information supplied to an AI model for interpreting or executing a task.
- human-in-the-loopHuman oversight is the involvement of people in monitoring, reviewing, or controlling consequential AI decisions and actions.
- working memoryShort-term memory is information about the current user-agent session, including prior turns and agent actions, that ends with the session.
- agent cardAn agent card is a standardized capability manifest that describes an agent’s identity, capabilities, skills, interfaces, and security requirements.
- ai application platformAn environment that integrates tools and services for building, deploying, monitoring, and operating AI applications.
- agent orchestration frameworkAn agent orchestration framework is a software framework for controlling multi-step behavior, state, tool use, and collaboration among agents.
- instruction fileA project-specific document or configuration that gives operational instructions to an AI agent.
- context isolationSeparating work into distinct context windows so unrelated or competing information does not occupy the same working set.
- agent harnessA harness is a surrounding system of guides, tools, constraints, and feedback loops that shapes an AI agent's behavior within an environment.
- retrieval-augmented generationA retrieval-augmented generation pipeline sequences retrieval and generation operations to supply retrieved information to a generative model.
- reasoning-based retrievalVectorless retrieval-augmented generation retrieves information without vector similarity, often by navigating document structure, and supplies it as context to a language model.
- sandboxingExecution of generated code or commands within a restricted environment that limits their access and effects.
- demonstrationA demonstration supplied in a model's context to guide its response to a task.
- prompt templateA prompt template is a predefined text structure containing slots or instructions into which task-specific inputs and context are inserted.
- prompt engineeringPrompt engineering is the practice of designing and refining inputs to a language model to influence the quality and character of its output.
- telemetryAutomatically collected runtime evidence about a software system's operation, including events, measurements, and request-flow data.
- continuityContinuity is the preservation of relevant state and information across interaction turns, sessions, or workflow steps.
- mcp promptAn MCP prompt is a reusable, parameterized message or sequence of messages that an MCP server exposes for a client to retrieve.
- MCP resourceA data or information item that a Model Context Protocol server makes available to an AI application.
- chunkingChunking is the division of large documents into smaller, coherent text segments for downstream processing and retrieval.
- stale dataStale data is information that is outdated because it does not reflect events or changes after the data’s last update.
- assembly functionAn assembly function combines instructions, retrieved passages, tool schemas, memory, state, and a request into a model’s context.
- generation pipelineA generation pipeline is an online workflow that retrieves relevant information at query time and uses it to produce a model response.
- GraphRAGA retrieval-augmented generation approach that uses a graph's entities and relationships to retrieve structured context.
- artifactAn A2A artifact is a concrete output produced by a server agent, such as a report, diagram, data table, or code file.
- groundingGrounding is the practice of supplying a model with evidence that supports or constrains its generated response.
- specificationA description of the requirements, intended behavior, interfaces, and constraints that a software system is expected to satisfy.
- model adaptationModel customization is the adaptation of a general-purpose model to a particular task, domain, or organizational context.
- model managementModel management is the ongoing administration of deployed models to sustain reliability, safety, and traceability.
- parameter-efficient fine-tuningParameter-efficient fine-tuning adapts a model by training a small number of parameters while keeping most base weights frozen.
- AgentOpsAgentOps is the operational discipline for governing agent tool usage, memory, state management, and orchestration.
- ReActReAct is an agent reasoning pattern that alternates between internal reasoning and external actions such as tool invocation.
- prompt cachingPrompt caching reuses previously computed representations of prompt context, particularly shared prefixes, to avoid processing them again.
- token limitA token budget is a limit on the tokens allocated to an AI system or request.
- agent discoveryThe process by which a client agent retrieves another agent’s capabilities and connection parameters.
- client agentThe client agent is the example application’s agent that discovers the server agent and sends it a request.
- server agentA server agent is an A2A interaction role that exposes compatible endpoints, processes requests, and returns results.
- evaluation datasetAn evaluation set is a collection of test cases and expected or judged outcomes used to assess a system's performance.
- test suiteA test suite is a collection of software tests run to check whether a program behaves as expected.
- routerA routing agent analyzes an incoming query and directs it to a specialized retrieval tool or knowledge store.
- compressionThe process of representing information with fewer bits or tokens while retaining relevant information.
- specification-driven developmentSpec-driven development is a software development approach in which a specification guides planning, task breakdown, and implementation.
- context graphA graph representation of the artifacts and runtime events that shape an AI system’s behavior during an interaction, task, or workflow.
- AGENTS.mdA portable Markdown file that provides project-specific instructions for AI coding agents.
- attention budgetAn attention budget is the finite capacity a model has to distribute attention across the information it receives.
- indexing pipelineAn indexing pipeline is a sequence of processing steps that transforms source documents into structures suitable for retrieval.
- augmentationThe augmentation stage adds retrieved information to a model’s input to provide context for generation.
- external memoryNon-parametric memory is information outside a model that can be saved, retrieved, and updated at runtime.
- hybrid retrieval-augmented generationHybrid RAG is a retrieval-augmented generation approach that combines multiple retrieval methods over structured and unstructured data.
- instructionA directive supplied to an AI system that specifies desired behavior, constraints, or task requirements.
- RAGOpsRAGOps is the operational discipline of building, deploying, and sustaining retrieval-augmented generation pipelines in production.
- securitySecurity is the protection of systems and information from unauthorized access, disruption, or misuse.
- cache-augmented generationCache-augmented generation is a generation approach that preloads relevant knowledge and reuses its processed context across multiple interactions.
- promptopsPromptOps is the operational discipline of managing prompts through versioning, testing, evaluation, deployment, monitoring, and ongoing revision.
- key-value cacheA key-value cache stores previously computed transformer attention keys and values for reuse during generation.
- summarizationThe production of a shorter representation of information while retaining selected content.
- tool useTool calling is a model capability for requesting that an external tool or operation be invoked.
- MCPThe Model Context Protocol is a protocol that enables external servers to expose tools, resources, and prompts to AI applications.
- hybrid searchHybrid retrieval combines keyword-based and semantic retrieval to find relevant information.
- context editingThe removal or modification of information in an agent’s active context to manage its contents and size.
- reasoning modelA language model optimized to solve demanding problems by generating intermediate reasoning steps before a final output.
- deployment postureAn adoption model is an organizational approach to integrating and operating generative AI within systems, processes, and governance boundaries.
- SKILL.mdA Markdown file that defines an agent skill's metadata and procedural instructions.
- trajectoryA trace describes a request or operation’s flow across components, typically as a sequence of related spans.
- validationValidation checks data or operations against expected requirements before further processing.
- DSPyDSPy is an open-source framework for programming language-model systems with declarative modules and signatures that can be optimized against metrics and examples.
- command-line interfaceA command-line interface is a text-based interface through which users interact with a computer program by entering commands.
- output formatAn output format is the required structure or representation of a model-generated result.
- privacyPrivacy is the protection of people or their information from unauthorized collection, access, use, or disclosure.
- mcp clientA connector component that maintains a connection with an MCP server and translates between host operations and MCP requests and responses.
- similarity searchNearest-neighbor search, or vector similarity search, finds stored items whose vector representations are most similar to a query representation.
- parameterA model parameter is a learned numerical value, such as a weight or bias, that determines how a model transforms its inputs.
- deploymentDeployment is the process of releasing an AI system or a part of it into an environment serving users or production workloads.
- episodic memoryEpisodic memory is retained information about past experiences and specific historical interactions.
- prompt frameworkA repeatable structure specifying the information and instructions a prompt contains and their order.
- context injectionContext stuffing inserts external knowledge directly into a model's context window.
- tool descriptionA tool definition specifies a tool's name, purpose, and expected arguments so a system can determine how to invoke it.
- procedural memoryProcedural memory is retained information encoding reusable routines, workflows, and patterns for carrying out actions.
- semantic memorySemantic memory is durable factual, conceptual, and stable knowledge that remains consistent across contexts.
- schemaA schema is a formal specification of the permitted structure, fields, and constraints of data or outputs.
- sessionAn ongoing interaction between a user and an assistant.
- knowledge graphA graph-structured representation of entities and their relationships.
- redactionThe removal or masking of sensitive information from data before it is shared, stored, exposed, or processed.
- parametric knowledgeParametric memory is knowledge embedded in a model’s parameters through training.
- API integratorAn API integrator is an adoption posture in which an organization builds application-side context and orchestration pipelines that connect to hosted model endpoints.
- llm off-the-shelfLLM off-the-shelf is an adoption posture in which an organization deploys provider-supplied or open-weight foundation models in its managed environment.
- SaaS consumerA SaaS consumer is an adoption posture in which an organization uses vendor-hosted AI products while the provider manages the underlying stack.
- subagentA subagent is an agent assigned a subordinate task within a larger agent-driven process.
- memory management modelThe process of allocating, retaining, replacing, and releasing information in a system's working memory.
- context-as-codeAn approach that treats persistent instructions for AI agents as maintainable engineering artifacts.
- fairnessFairness is the property of treating people and groups equitably, including avoiding unjustified disparities in system outcomes.
- versioningThe practice of tracking and managing changes to files so changes can be reviewed and earlier versions restored.
- isolationSeparating context content or reasoning scopes to control information exposure.
- monitoringMonitoring is the ongoing collection and examination of system signals and events to assess behavior and health.
- resultThe final state of an environment at the end of an evaluation trial.
- ContextOpsContextOps is an operational framework concerned with shaping how a model is used through its context sources.
- accountabilityAccountability is the obligation to take responsibility for AI-system decisions and their consequences.
- pipelineA pipeline is a sequence of connected computational components that passes data through processing steps.
- temperatureAn inference parameter that controls the randomness of token selection during generation.
- interoperability protocolAn interoperability protocol is a standardized set of rules and formats for exchanging information across system boundaries.
- chain-of-thoughtStep-by-step reasoning is a reasoning technique that decomposes a complex task into a sequence of smaller logical operations.
- retention policyA retention policy specifies rules for how long records are kept and when they are deleted.
- context rotContext rot is degradation in the usefulness of accumulated context as a task evolves and its information loses relevance, structure, or priority.
- tool resultA tool output is information returned by a tool after it runs, such as a response, computed value, or command result.
- recallRetrieval recall is the proportion of relevant items that a retrieval system successfully retrieves.
- indexingIndexing organizes information into a structure that supports efficient search and retrieval.
- cachingThe technique of storing information or computation results for reuse to reduce repeated processing or retrieval.
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.
