Cover image for RAG from First Principles

RAG from First Principles

Engineering retrieval-augmented generation systems with Python, LangChain, and LlamaIndex

JH

Created by Jia Huang

Explore the inner workings of retrieval-augmented generation by building each layer yourself. Move beyond plug-and-play frameworks to truly understand how ingestion, chunking, hybrid retrieval, and evaluation all fit together. Gain the skills to optimize, debug, and extend your own RAG systems with confidence.

Packt | May 2026 | 492 min

What You Will Learn

You will build RAG systems from the ground up, focusing on each architectural layer and the reasoning behind every design choice. Through hands-on coding and real-world scenarios, you will learn to analyze tradeoffs and apply best practices that hold up even as frameworks evolve. The focus is on understanding, not just implementation.

Key Features

  • Ingest and parse diverse data types, including PDFs, tables, and web content
  • Optimize retrieval quality with advanced chunking, embedding, and reranking methods
  • Design and debug hybrid RAG pipelines using Python, LangChain, and LlamaIndex

Target Audience

Perfect for AI engineers, ML practitioners, and developers who have built basic RAG pipelines and want to deepen their expertise. If you are aiming to design, optimize, or troubleshoot production-grade retrieval systems, and already know Python and LLM basics, you will find the systematic, code-driven approach especially valuable.

Related courses