Advanced RAG¶
A production-quality course covering Retrieval-Augmented Generation from the ground up — from the basic loader → splitter → retriever → LLM pipeline to advanced patterns like RAG Fusion, HyDE, Agentic RAG, Graph RAG, and RAGAS evaluation.
Based on the Advanced RAG course by CampusX. Reference code: campusx-official/Advanced_Rag_Codes.
Why this course exists¶
LLMs without retrieval have four hard limits:
- Knowledge cutoff — models are frozen in time, can't access recent information.
- Hallucinations — they generate plausible-sounding but false content.
- No source attribution — you can't verify or trace where information came from.
- No private data access — they can't read your company's documents.
RAG fixes all four by grounding the LLM in external, retrievable knowledge at query time.
The standard RAG pipeline¶
flowchart LR
A[User Query] --> B[Embedder]
B --> C[Vector Store]
C --> D[Retriever]
D --> E[Top-k Docs]
E --> F[Prompt Template]
A --> F
F --> G[LLM]
G --> H[Answer]
Knowledge ingestion happens once, offline:
flowchart LR
A[Raw Docs] --> B[Loader]
B --> C[Splitter]
C --> D[Chunks]
D --> E[Embedder]
E --> F[Vector Store]
This course covers each box, then builds the advanced patterns on top.
Syllabus¶
| # | Chapter | What you learn |
|---|---|---|
| 1 | Introduction to RAG | The four LLM problems, the RAG fix, full pipeline overview |
| 2 | Document Loaders | PDFs, HTML, websites, databases — getting data into LangChain |
| 3 | Text Splitters | Chunking strategies, recursive/markdown/code splitters, overlap |
| 4 | Text Embeddings | Vectors, semantic similarity, OpenAI/HuggingFace embeddings |
| 5 | Vector Stores | FAISS, Chroma, pgvector, persistence, indexing |
| 6 | Retrievers | Similarity, MMR, threshold retrievers — the bread and butter |
| 7 | Advanced Retrievers | Multi-query, contextual compression, parent-doc, self-query, ensemble |
| 8 | RAG Fusion | Sub-query generation, Reciprocal Rank Fusion, ensemble retrieval |
| 9 | HyDE RAG | Hypothetical document embeddings to bridge query/doc style gap |
| 10 | Agentic RAG | LLM as router/orchestrator over multiple knowledge sources + tools |
| 11 | Graph RAG | Knowledge graphs in Neo4j, entity extraction, hybrid retrieval |
| 12 | RAGAS Evaluation | Faithfulness, answer relevance, context precision/recall metrics |
Prerequisites¶
- Python basics — Python track
- LangChain fundamentals — chains, prompts, models, output parsers
- A passing familiarity with embeddings helps but isn't required
What you'll need¶
| Tool | What for |
|---|---|
| Python 3.10+ | Runtime |
langchain + langchain-openai |
The framework |
| OpenAI API key (or Anthropic / local model) | LLM + embeddings |
| FAISS or Chroma | Local vector store for dev |
| Neo4j Aura (free tier) | Only for the Graph RAG chapter |
ragas |
Only for the evaluation chapter |
Most chapters work with a pip install and a free API key. Graph RAG needs Neo4j; RAGAS needs an LLM for the judge.