Manning Early Access Program (MEAP)
Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
The responses from Large Language Models (LLMs) are more accurate, consistent, and explainable when you provide specific relevant information, or context, to support your prompts. Context engineering is the discipline of selecting, organizing, updating, compressing, prioritizing the precise context a model needs to generate accurate responses. This book shows you how to combine well-designed prompts with smart search, content filtering, and advanced RAG techniques incorporating many types of stored data to create reliable responses in your AI applications.
Because context engineering is typically implemented programmatically, automation is essential as applications evolve from simple prompts to workflows, agents, and agentic systems. Context engineering is particularly critical with the rise of autonomous agents and context windows that can take in a million or more tokens. Irrelevant or poorly selected context raises the chance of hallucinations, brittle agents, and unpredictable outputs. In Context Engineering, author Boni Garcia helps you design an AI’s information environment with the same rigor as your codebase. It unifies every part of the context stack—including RAG, memory, and harness engineering—into one coherent discipline.
The book takes you hands-on with the entire context engineering stack. You'll learn how to build context-aware AI applications using frontier models from OpenAI, Anthropic, and Google using tools such as DSPy, LangChain, CrewAI, and LlamaIndex. Because each chapter builds intuition first and ends with a practical hands-on section grounded in real tools, you’ll come away thinking like a system designer who knows exactly what enters the context window, what stays out, what gets retrieved just in time, and what becomes persistent memory or state.
what's inside
Build RAG pipelines that ground responses in external knowledge
Add short-term and long-term memory the right way
Manage state in workflows, agents, and agentic systems
Orchestrate multi-step AI behavior with continuity
Evaluate context quality and detect failures
Observability with traces, logs, tokens, and tool calls
about the reader
For AI engineers, data scientists, and engineering managers familiar with the basics of LLMs and agents.
about the author
Boni García is an Associate Professor at Universidad Carlos III de Madrid with extensive experience in software engineering, test automation, and applied AI. He is a tech lead on the Selenium project, creator and maintainer of WebDriverManager and Selenium Manager, and author of several books on Java. His current research focuses on the intersection of software engineering and AI—exploring how large language models, agents, and context-aware systems are reshaping how modern software is built.
Introductory offer Save 50% for a limited time!
eBook
pdf, ePub, online
$47.99
$23.99
you save $24.00 (50%)
Introductory offer Save 50% for a limited time!
print
includes eBook
$59.99
$29.99
you save $30.00 (50%)
with subscription
free or 50% off
$24.99
pro $24.99 per month
access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!