In the previous days, we built a RAG system step by step by working directely with embeddings, FAISS, Top-K retrieval, and a locally served Qwen model throught vLLM. That manual approach helped us understand what happends inside a retrieval pipeline, but as the application grows, connecting and managing every component by hand becomes harder. In Day 10, we will introduce LangChain as a structured way to organize these components and rebuild our RAG workflow using reusable abstractions for documents, retrievers, prompts, and LLMs.
Building RAG manually is useful because it helps us understand what happens inside the pipeline. In the previous days, we created embeddings, stored them in FAISS, searched for the most relevant vectors, constructed a prompt, and then sent that prompt to the LLM. By implementing each step ourselves, we can clearly see how retrieval and generation work togethe
Manual RAG
Documents
↓
Chunking
↓
Embedding Model
↓
FAISS
↓
Similarity Search
↓
Top-K Documents
↓
Build Prompt
↓
LLM
Here's after using LangChain to implement and become structured:
Documents
↓
LangChain Components
↓
Vector Store / Retriever
↓
Prompt
↓
LLM
After briefly talking about the theoretic part: we are heading to the practical session.
Install the packages:
pip install -U \
langchain \
langchain-community \
langchain-huggingface \
langchain-openai \
sentence-transformers \
faiss-cpu
Start Qwen with vLLM:
vllm serve Qwen/Qwen2.5-7B-Instruct \
--host 127.0.0.1 \
--port 8000 \
--max-model-len 8192 \
--gpu-memory-utilization 0.90
Create langchain_rag.py:
nano langchain_rag.py
from langchain_core.documents import Document
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_huggingface import HuggingFaceEmbeddings
from langchain_community.vectorstores import FAISS
from langchain_openai import ChatOpenAI
python3 langchain_rag.py


Conclusion:
Day 10 takes the RAG system built manually in the previous days and reorganises it into a modular LangChain application: local documents are loaded and chunked, embedded with a Hugging Face model, indexed in FAISS, retrieved through LangChain's retriever interface, injected into a prompt, and finally sent to Qwen2.5-7B-Instruct running behind a local vLLM server. This is a classic 2-step RAG architecture: retrieval always occurs before generation, which LangChain characterises as straightforward and predictable. LangChain does not replace embeddings, FAISS, or vLLM; its primary value here is providing standard interfaces that make those components easier to connect, swap, test, and maintain.
The result is therefore not inherently a “smarter” RAG system than the manual implementation—it is a better-structured foundation on which later features such as routing, tools, agents, tracing, and evaluation can be added. LangChain's current documentation explicitly treats document loaders, splitters, embedding models, vector stores, and retrievers as modular retrieval building blocks.
Reference: