Shape of a conversational retrieval chain
Before we write any code, let us look at the full pipeline. Every conversational RAG system has the same shape. Once you see the pieces, the code in the workshop becomes obvious.
The conversational retrieval pipeline
Two phases: indexing (once) and querying (every turn).
# The workshop code maps 1:1 onto the pipeline diagram
from langchain_text_splitters import RecursiveCharacterTextSplitter
from langchain_huggingface import HuggingFaceEmbeddings
from langchain_community.vectorstores import FAISS
from langchain.chains import ConversationalRetrievalChain
from langchain_openai import ChatOpenAI
from docling.document_converter import DocumentConverter
# Indexing: loader -> splitter -> embeddings -> FAISS
# Querying: ConversationalRetrievalChain wraps retriever + LLM + history
The imports tell the story. Each component has a single responsibility, and the chain is the glue that wires them into a memory-aware retrieval flow.
Matching exercise: Match each component to its job
Loading practice…
Indexing is expensive: Docling parsing can take a minute for a large book, and embedding every chunk runs the model once per chunk. Querying has to feel instant. Running indexing on every query would be unacceptable. By persisting the FAISS index to disk, you pay the indexing cost once and get sub-second retrieval for every turn after that.
Quiz: Quiz
Loading practice…