Share E-Book

Mastering LangChain and LangGraph Build RAG and Agentic AI Applications with LLMs, MCP, and LangChain Agents (Ankur Kulshreshtha) (z-library.sk, 1lib.sk, z-lib.sk)

Author

Rating No ratings yet

Log in to rate

AI
Language English

Mastering LangChain and LangGraph is a comprehensive, hands‑on guide for developers, data scientists, and AI practitioners looking to build robust, production‑ready applications using large language models, retrieval‑augmented generation (RAG), and agentic systems. The book begins by establishing a clear foundation, introducing the LLM ecosystem and core concepts such as RAG and AI agents, before guiding readers into the LangChain framework and its practical abstractions. Readers will explore essential building blocks including chat models, prompt templates, and structured output generation, followed by in‑depth coverage of document loaders, text splitters, embeddings, vector stores, and retrievers—key components for creating scalable, knowledge‑grounded AI systems. As the book progresses, it introduces LangGraph, enabling readers to design stateful, multi‑step, and resilient agent workflows with fine‑grained control over execution. Advanced chapters dive into tools and the Model Context Protocol (MCP), checkpointing, memory management, and middleware design, providing the infrastructure needed to manage complexity in real‑world applications. Topics such as human‑in‑the‑loop workflows, time travel, and streaming demonstrate how to build systems that are transparent, debuggable, and interactive. The book concludes with a focused exploration of LangChain agents, tying together tools, memory, and control flow into cohesive agentic architectures. Blending conceptual clarity with practical implementation guidance, this book equips readers with the skills to design, build, and scale modern AI applications that go beyond simple prompts—delivering intelligent, reliable, and extensible systems ready for production use. Who this book is for: This book is for software developers, data scientists, and AI practitioners who want to move beyond basic prompt engineering and build production‑ready AI applications using large language models.

Format PDF
Size 17.4 MB
5
Views
(First 20 pages)

Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Page 1
Mastering LangChain and LangGraph Build RAG and Agentic AI Applications with LLMs, MCP, and LangChain Agents — Ankur Kulshreshtha
Page 2
Mastering LangChain and LangGraph Build RAG and Agentic AI Applications with LLMs, MCP, and LangChain Agents Ankur Kulshreshtha
Page 3
Mastering LangChain and LangGraph: Build RAG and Agentic AI Applications with LLMs, MCP, and LangChain Agents ISBN-13 (pbk): 979-8-8688-2945-1 ISBN-13 (electronic): 979-8-8688-2946-8 https://doi.org/10.1007/979-8-8688-2946-8 Copyright © 2026 by Ankur Kulshreshtha This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein. Managing Director, Apress Media LLC: Welmoed Spahr Acquisitions Editor: Celestin Suresh John Coordinating Editor: Gryffin Winkler Cover designed by eStudioCalamar Cover image by Markus Spiske from Pixabay Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza, New York, NY 10004. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a Delaware LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation. For information on translations, please e-mail booktranslations@springernature.com; for reprint, paperback, or audio rights, please e-mail bookpermissions@springernature.com. Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales web page at http://www.apress.com/bulk-sales. Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub (https://github.com/Apress). For more detailed information, please visit https://www. apress.com/gp/services/source-code. If disposing of this product, please recycle the paper Ankur Kulshreshtha Noida, Uttar Pradesh, India
Page 4
I dedicate this book to my father, the late Pradeep Kumar Kulshreshtha, and my mother, Kumkum Kulshreshtha, who have always been my source of strength and inspiration.
Page 5
(This page has no text content)
Page 6
(This page has no text content)
Page 7
(This page has no text content)
Page 8
(This page has no text content)
Page 9
(This page has no text content)
Page 10
(This page has no text content)
Page 11
(This page has no text content)
Page 12
(This page has no text content)
Page 13
(This page has no text content)
Page 14
(This page has no text content)
Page 15
(This page has no text content)
Page 16
(This page has no text content)
Page 17
xvii About the Author Ankur Kulshreshtha is a data architect at Infosys with 16 years of experience across Data Engineering, Machine Learning, and Generative AI. He is an expert in designing enterprise solutions for AI and data-driven projects and has worked with leading telecom and media clients from Europe, the United States, Saudi Arabia, and the Asia-Pacific. Ankur is an AI evangelist who creates awareness and consults with various project teams and clients on AI adoption. Ankur holds an MTech in Software Systems with a specialization in Data from BITS Pilani. He also likes writing blogs and spreading knowledge on AI/ML through his blog website at https://machinelearningknowledge.com/, which receives thousands of views each month. Visit https://ankurkulshreshtha.com/ to explore his detailed portfolio.
Page 18
xix About the Technical Reviewer Yash Yamsanwar is a Machine Learning architect with deep expertise in Generative AI, large language models, and cloud infrastructure. At Amazon Web Services, he works on designing and scaling LLM-powered systems, including distributed inference platforms, multi-agent applications, and Retrieval-Augmented Generation solutions. He is passionate about bridging the gap between cutting-edge AI research and reliable, production- grade engineering and enjoys mentoring engineers and sharing knowledge with the broader AI community.   
Page 19
xxi Acknowledgments This is my first experience of authoring a book, and I would like to thank Celestin for accepting my proposal and giving me the opportunity to publish with Springer Apress. I would also like to thank him and his team, including Nirmal and Gryffin, for their patience with me amid multiple deadline slips for completing this book due to my hectic office work. This is a great opportunity to acknowledge my mentors cum bosses at Infosys: Navaz Husain Nazeer (Senior Technology Architect), Vimal Balajee Viswanathan (Senior Principal Technology Architect), and Gnanapriya Chidambaranathan (AVP, Unit Technology Officer, CMT Unit). Under their guidance and leadership, I got the right opportunity to grow in the space of GenAI/LLMs/Agentic AI, which in turn gave me the confidence to author this book. And I would also like to thank the other seniors and team members of the Data Architecture (CATS) group at Infosys for their continued support. Also, I am thankful to Amada Echeverría (Community Manager, LangChain) and Mason Daugherty (Maintainer of OSS LangChain package) for their quick input to help make this book better and more relevant with the latest LangChain architecture. Yash Yamsanwar, for doing a great technical review that helped me to give finishing touches to the book. Finally, I am grateful to be surrounded by a beautiful family and some lovely friends who always supported me through thick and thin.
Page 20
xxiii Introduction This book primarily focuses on the two open source frameworks LangChain and LangGraph. Although LangChain and LangGraph are available in both Python and JavaScript, this book will exclusively cover the Python version. Throughout the book, the term "LangChain" refers to both the framework and the company, and readers should interpret its meaning in context. The book is aligned with v1 of both LangChain and LangGraph, released in 2025. The code examples in this book have been tested and verified with LangChain v1.3.10 and LangGraph v1.2.6 versions. The future version compatibility test details for LangChain and LangGraph will be published on https://masteringlangchainlanggraph.com/, which is the official website of this book. Structure of the Book The book is primarily divided into six distinct parts as follows: Part 1: It includes introductory chapters on large language models (LLMs), Retrieval- Augmented Generation (RAG), and agents, along with an introduction to LangChain. Part 2: It covers chapters focused primarily on working with LLMs in LangChain. It includes the Chat Model integration, techniques for generating structured output from LLMs, and prompt templates. Part 3: This part covers chapters on different LangChain components and the utilities required to create RAG solutions. This includes chapters on Document Loaders, Text Splitters, Embeddings, Vector Store, and Retrievers. Part 4: This part includes chapters on the LangGraph framework, covering fundamentals of building agents and advanced topics such as Checkpointers, Memory, Human-In-The-Loop (HITL), and Time Travel. It also includes a LangChain-based chapter on tools and MCP (Model Context Protocol), but it is included here because it’s related to agents.
The above is a preview of the first 20 pages. Register to read the complete e-book.

Recommended for You

Loading recommended books...
Failed to load, please try again later

Tip the Site

Scan the WeChat Pay or Alipay code to tip. No login required.

WeChat Pay
Alipay
← Back to List