Skip to product information
RAG Master: LLM Service Completed with Langchain
RAG Master: LLM Service Completed with Langchain
Description
Book Introduction
RAG, the core of LLM service implementation
Everything you need to know about Advanced RAG in just one volume!


This book combines practical expertise with theoretical knowledge from four developers and data scientists who have built real-world RAG-based services. It covers everything from the fundamental principles of RAG to advanced techniques, including the use of lang graphs and ReAct agents, and fine-tuning LLM and embedding models to maximize RAG performance.
With a hands-on approach using Langchain, you can learn by following along in Google Colab and complete your own RAG system through practical examples in each chapter.
From beginners looking to build a solid foundation to working developers looking to perfect their LLM system with advanced techniques, this book systematically guides you through all the RAG technologies most needed today.
  • You can preview some of the book's contents.
    Preview

index
Recommendation
Entering
Structure of this book
Setting up your practice environment

Chapter 1: Exploring the Langchain

1.
Langchain Overview
__1.1 Langchain main package
__1.2 Langchain version-specific feature updates
__1.3 Why should I use Langchain?
__1.4 Key Use Cases of Langchain
2.
Large-scale language models
__2.1 Langchain vs. OpenAI API
__2.2 Setting large-scale language model parameters
__2.3 Major large-scale language models available in LangChain
3.
Langchain expression language
__3.1 Runnable Standard Interface
__3.2 How to chain runnables
4.
prompt
__4.1 Fewshot Prompt
__4.2 Prompt Hub
5.
Output parser
__5.1 Three main methods of the output parser
__5.2 PydanticOutputParser
__5.3 SimpleJsonOutputParser
__5.4 JsonOutputParser
6.
Memory Management: Maintaining Conversation History
__6.1 Basic conversation history transfer
__6.2 Conversation History Management and Processing
__6.3 Automatic conversation history management
__6.4 Conversation History Summarization and Trimming

Chapter 2: Search Augmentation Generation Fundamentals and Practice

1.
Search Augmentation Generation Overview
__1.1 Text Embedding
__1.2 Cosine similarity
__1.3 Using the Langchain Embedding API
2.
Document Loader
__2.1 Web Page Loader
__2.2 PDF Loader
__2.3 CSV Loader
3.
Text segmentation
__3.1 Recursive character text splitting by length and delimiter
__3.2 Semantic chunking that splits based on meaning
4.
Vector database
__4.1 Chroma
__4.2 Pie
5. RAG Chatbot Practice
__5.1 RAG Chatbot Implementation
__5.2 Applying Streamlet UI to Chatbot

Chapter 3 Complex Data Processing Using Multimodal RAG

1.
Multimodal RAG Overview
__1.1 What is multimodal RAG?
__1.2 Why Multimodal RAG is Difficult
2.
How to implement multimodal RAG
__2.1 Including all modalities in the same vector space
__2.2 Expressing all modalities as one base modality
__2.3 Handling different modalities in separate repositories
3.
Multimodal RAG Practice
__3.1 Environment Settings
__3.2 Data Preprocessing
__3.3 Multi-Vector Finder
__3.4 Multimodal RAG Implementation

Chapter 4: RAG Enhancement Strategies to Optimize Search and Response

1.
chunking strategy
__1.1 Parent-child split
2.
Query transformation
__2.1 Creating multiple queries
__2.2 Virtual Document Embedding
3.
Search algorithm
__3.1 Sparse Search
__3.2 Dense Search
__3.3 Ensemble Search
4.
Document post-processing
__4.1 High-Performance, Large-Scale Language Model-Based Reranking
__4.2 Cross-encoder-based reranking
5.
Extended RAG methodology
__5.1 Self-RAG Overview
__5.2 Self-RAG Implementation

Chapter 5 Graph RAG using Knowledge Graph

1.
Graph RAG Overview
__1.1 Limitations of the existing RAG method
__1.2 What is a knowledge graph?
__1.3 Graph RAG operation process
2.
Building a graph DB
__2.1 Graph DB construction process
__2.2 Graph DB Construction Practice
3.
Graph RAG query
__3.1 Graph RAG query process
__3.2 Graph RAG Query Practice
4.
Implementing GraphRAG using Neo4j and Langchain
__4.1.
Knowledge Graph and Neo4j Integration

Chapter 6: Designing RAG Pipelines with Langgraph

1.
Components of a langgraph
__1.1 Graph
__1.2 status
__1.3 node
__1.4 Edge
2.
Using Langgraph
__2.1 Implementing a loop
__2.2 Implementing conditional statements
__2.3 Streaming
__2.4 Saving the state
__2.5 Interrupting the loop
3.
Langgraph practice
__3.1 Self-Correction-RAG
__3.2 Code Assist Chatbot

Chapter 7 RAG with React Agents

1.
Chain of Thoughts
2.
Agent RAG
__2.1 Preparing libraries and data
__2.2 Creating an Agent Tool
__2.3 Agent prompt settings
__2.4 Creating an agent object
__2.5 Agent RAG Practice

Chapter 8 LLM Fine-Tuning to Improve RAG Performance

1. Review the RAFT paper
__1.1 Negative sample
__1.2 Chain of Thoughts
2.
Tips for improving performance
__2.1 No response data
__2.2 Source Citation
3. Examining the RAG training dataset
__3.1 Introduction to Training Data
__3.2 Exploring Training Data
4.
Fine-tuning your local LLM Qwen
__4.1 Setting up a practice environment using Runpot
__4.2 Data Preprocessing
__4.3 Understanding the Qwen Template
__4.4 Settings for Laura learning
__4.5 Settings for learning
__4.6 Integer encoding
__4.7 Testing the Model
__4.8 Shutting down the GPU

Chapter 9 Fine-Tuning the Embedding Model

1.
Learning principles of embedding models
__1.1 Contrastive learning
__1.2 Dataset composition
__1.3 Negative sampling within a batch
__1.4 MultipleNegativesRankingLoss
__1.5 Understanding the learning code
2.
How to improve performance during learning
__2.1 Increasing the batch size
__2.2 Hard Negative Selection
__2.3 Other tips to improve learning performance
3.
Practical fine tuning
__3.1 Loading data
__3.2 Hard Negative Selection
__3.3 Generating synthetic data
__3.4 Loading the model
__3.5 Evaluation data preprocessing
__3.6 Training the Model
__3.7 Search Performance Evaluation Index
__3.8 Evaluating the Fine-Tuning Model

In conclusion
Search

Detailed image
Detailed Image 1

Publisher's Review
From multimodal to graph RAG, lang graph, ReAct agent, and fine-tuning
Practical LLM service completed with RAG

Despite their outstanding performance, large-scale language models (LLMs), such as ChatGPT, have limitations in providing up-to-date information or detailed information about specific documents.
A representative technology that solves this problem is RAG (Augmented Search Generation).

This book covers everything from the fundamental principles of RAG, essential for building LLM-based services, to various advanced techniques.
In addition to the basic RAG concepts, we will guide you step-by-step through advanced topics required in practice, such as multimodal RAG, graph RAG, pipelines using lang graphs, agent RAG, and fine-tuning.
Additionally, we systematically cover essential technologies for RAG implementation, such as text embedding, semantic-based text segmentation, and vector database utilization, through both theory and practice.
This provides useful knowledge and know-how to everyone, from beginners new to LLM service development to developers seeking to gain practical experience.

In particular, this book covers in detail how to use LangChain, a framework optimized for RAG implementation.
LangChain is a powerful framework that provides various functions and modules to easily and quickly develop LLM-based AI applications.


All examples are designed to be easy to follow for anyone without complex setup, utilizing Google Colab and LangChain.
By following the vivid RAG exercises provided in this book step by step, you will naturally acquire the ability to develop AI applications that can be immediately applied to real-world business situations, such as chatbots and knowledge retrieval systems based on corporate data.

Recommended for these people!

● Beginner-intermediate Python users interested in AI development
● College students, developer community, and researchers who want to learn Langchain and RAG
● Developers and engineers who want to develop LLM and RAG-based systems
● Practitioners considering building a chatbot and knowledge retrieval system based on corporate data

- Structure of this book -

This book consists of nine chapters, covering the core principles of RAG technology step by step, from the basics to various practical application methods.

Chapter 1 explains in detail the main concepts and functions of Langchain.
We thoroughly cover the concepts that form the basis of RAG implementation, including understanding the language model used in LangChain, prompt writing methods, utilizing output parsers, and memory management techniques.

In Chapter 2, we will learn and practice the basic principles of RAG.
We'll build a solid foundation by covering concepts like text embedding and cosine similarity, document loading and segmentation methods, and the basic chatbot implementation process using a vector database.

In Chapter 3, we will look at multimodal RAG, which can be used with various data types such as images as well as text.
From the necessity of multimodal RAG to implementation methods and actual practice, you will learn practical application methods.

In Chapter 4, we will learn specific advanced strategies to improve the performance of RAG.
We cover effective document chunking strategies, query transformation methods, retrieval algorithms, document reranking, and even the Self-RAG technique, which further develops these strategies.

Chapter 5 introduces Graph RAG, which overcomes the limitations of RAG by utilizing knowledge graphs.
We will learn how to build a graph database using Neo4j and use it for real-world queries.

Chapter 6 covers how to make the RAG system more flexible and sophisticated by leveraging langgraphs.
Understand the concepts and core components of lang graphs, and learn how to implement complex RAGs, such as conditional statements and loop structures, through practice.

Chapter 7 explains how to implement a more intelligent and automated RAG system by leveraging React agents.
Understand the working principles of agents, create agent tools, and practice actual RAG.

Chapter 8 covers fine-tuning the language model to further improve the performance of RAG.
We provide detailed explanations of the need for fine-tuning, data preparation methods, learning environment setup, and the process of fine-tuning an actual local LLM model (Qwen), providing guidance that can be directly applied in practice.

Finally, Chapter 9 delves into how to directly fine-tune the embedding model to maximize retrieval performance, which is the core of RAG.
Learn the principles and application of effective embedding learning methods, and acquire practical knowledge from building training data using real-world data to model training, retrieval performance evaluation, and performance optimization tips.
GOODS SPECIFICS
- Date of issue: April 28, 2025
- Page count, weight, size: 568 pages | 972g | 182*232*35mm
- ISBN13: 9788965404101
- ISBN10: 896540410X

You may also like

카테고리